espHome-NBS-files/tablesoccer.yaml

87 lines
1.5 KiB
YAML
Raw Normal View History

esphome:
name: tablesoccer
platform: ESP8266
board: nodemcuv2
on_boot:
priority: 600
then:
- output.turn_on: power_control
mqtt:
broker: !secret mqtt_broker_1
username: !secret mqtt_broker_1_username
password: !secret mqtt_broker_1_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
logger:
external_components:
- source:
type: local
path: external_components/
components: [ tablesoccer_btn_helper ]
ota:
password: !secret streamsign_password
output:
- platform: gpio
pin: 14
id: power_control
tablesoccer_btn_helper:
keep_alive: power_control
reset_pin:
number: 12
mode:
input: true
pullup: true
undo_pin:
number: 13
mode:
input: true
pullup: true
id: btn_helper
binary_sensor:
- platform: gpio
id: sensor_goal_blue
pin:
number: D1
mode:
input: true
pullup: true
filters:
- delayed_on: 10ms
on_press:
then:
- lambda: |-
id(btn_helper).send_score("0");
- platform: gpio
id: sensor_goal_red
pin:
number: D2
mode:
input: true
pullup: true
filters:
- delayed_on: 10ms
on_press:
then:
- lambda: |-
id(btn_helper).send_score("1");
#pinMode(5, INPUT_PULLUP);
#pinMode(4, INPUT_PULLUP);
#pinMode(14, OUTPUT);
#pinMode(12, INPUT_PULLUP);
#pinMode(13, INPUT_PULLUP);