espHome-NBS-files/pingpongfuss1.yaml

110 lines
2.1 KiB
YAML
Raw Permalink Normal View History

esphome:
name: pingfuss1
platform: ESP8266
board: nodemcuv2
on_boot:
priority: 300
then:
- output.turn_on: st_led
# Enable logging
logger:
# Enable Home Assistant API
# DISABLED - We currently do not need it for operation. Maybe someday
# api:
# encryption:
# key: !secret ttf_key
ota:
password: !secret ttf_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
# Example configuration entry
mqtt:
broker: !secret mqtt_broker_1
username: !secret mqtt_broker_1_username
password: !secret mqtt_broker_1_password
on_connect:
then:
- output.turn_off: st_led
on_disconnect:
then:
- output.turn_on: st_led
output:
- platform: gpio
pin:
number: D0
mode: output
inverted: true
id: st_led
# Example configuration entry
binary_sensor:
- platform: gpio
pin:
number: D2
inverted: true
mode:
input: true
pullup: true
id: "Fusstaste_BLAU"
internal: true
#filters:
# - delayed_on: 10ms
# - delayed_off: 50ms
on_multi_click:
- timing:
- ON for at most 700ms
- OFF for at least 50ms
then:
- mqtt.publish:
topic: tabletenniscounter/control/score/count
payload: "1"
qos: 2
- timing:
- ON for at least 1s
then:
- mqtt.publish:
topic: tabletenniscounter/control/score/undo
payload: ""
qos: 2
- platform: gpio
pin:
number: D3
inverted: true
mode:
input: true
pullup: true
id: "Fusstaste_ROT"
internal: true
#filters:
# - delayed_on: 10ms
# - delayed_off: 50ms
on_multi_click:
- timing:
- ON for at most 700ms
- OFF for at least 50ms
then:
- mqtt.publish:
topic: tabletenniscounter/control/score/count
payload: "0"
qos: 2
- timing:
- ON for at least 1s
then:
- mqtt.publish:
topic: tabletenniscounter/control/score/undo
payload: ""
qos: 2