This seems really simple but i can’t seem to get my head around it.
I have an RGB Controller with a Button.
When the button is pressed it toggles the LED.
What i want is that a Double Press will toggle a Switch to enable sleep mode. I have created the switch, and the Binary Sensor, but the Switch won’t stay on. Do i need to declare a Global Variable?
binary_sensor:
- platform: gpio
pin:
number: GPIO0
inverted: True
name: button
on_click:
min_length: 50ms
max_length: 350ms
then:
- light.toggle:
id: me
# on_double_click:
# min_length: 50ms
# max_length: 350ms
# then:
# - switch.toggle:
# id: id_stu_sleep_mode
switch:
- platform: template
name: "Stu Sleep Mode"
id: id_stu_sleep_mode
output:
- platform: esp8266_pwm
id: output_red
pin: GPIO4
- platform: esp8266_pwm
id: output_green
pin: GPIO12
- platform: esp8266_pwm
id: output_blue
pin: GPIO14