When I press button 2 or 3…, I want to turn off the LED on button 1 and when I press this other one, the LED on it turns on, 1 turns off and the next one turns on. There will be 5 buttons in total.
I tried to use this code to test turning 1 LED on and off but I didn’t get the response I wanted.
- platform: gpio
id: button1
pin:
number: GPIO4
mode: INPUT_PULLUP
inverted: true
on_press:
then:
- if:
condition:
binary_sensor.is_on: button1
then:
- output.turn_off: light_output
else:
- output.turn_on: light_output
name: "Test LED Button"
device_class: light