Hi,
I am connecting some arcade style buttons to my esp32 to use them as GPIO switches. They have internal LEDs that make the buttons light up. I am searching for a way to control the LED within ESPHome.
The code I came up so far is this:
binary_sensor:
- platform: gpio
id: gpio25
pin:
number: 25
name: "Button"
internal: True
filters:
- delayed_on: 100ms
on_state:
then:
- output.turn_on: light_output
light:
- platform: binary
name: "Desk Lamp"
output: light_output
id: led
output:
- id: light_output
platform: gpio
inverted: true
pin: GPIO26
This works as far as the button lights up when I push it the first time, but I can’t figure out a logic to make the LED toggle on every hit of the button.
Unfortunately output.toggle: light_output
doesn’t work.
I know this should be quite simple for experienced people in ESPHome but I am just starting out, so any help is much appreciated.
Best,
Chris