Hi there,
Basically I’m trying to perform a restart with a restart switch when the button on my Sonoff S26 is pressed for 5 seconds.
I’ve got the followig code:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff-S26_1 przycisk"
id: button
on_click:
then:
- switch.toggle: przekaznik
on_press:
- logger.log: "on_press"
- if:
condition:
for:
time: 5s
condition:
binary_sensor.is_on: button
then:
- logger.log: "5 seconds!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- switch.toggle: switch_restart
and this action is never trigerred. Any ideas why??
then:
- logger.log: "5 seconds!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- switch.toggle: switch_restart
I’ve tried using two on_click
triggers with different min/max times, but in this case I’ve got a YAML error that there is a double key on_click
.