I have five push buttons connected to one NodeMCU (with ESPHome). I am trying to make these push buttons toggle switches for various lights (mainly connected to other ESPHome nodes with traditional relays. Cannot get the toggle function to work properly. Any tip with the code?
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode:
input: true
pullup: true
inverted: true
name: Button Black
filters:
- delayed_off: 20ms
on_press:
then:
- homeassistant.service:
service: light.toggle
data:
entity_id: switch.relay_light_over_sea_map