@gromar wrote:
First of all I decided to switch on/ off ventilation using Xiaomi switch.
The automation looks like that (and it works flawlessly):# Załączamy/ Wyłączamy Wentylator w Łazience - alias: Załącz/ Wyłącz Wentylator w Łazience trigger: platform: event event_type: xiaomi_aqara.click event_data: entity_id: binary_sensor.switch_158d000373c264 click_type: single action: service: switch.toggle data: entity_id: switch.przelacznik_lazienka_wentylator
Next thing I decided to add is a delay to auto-switch off after 5 minutes if I forget to press a button. I modified the code:
# Załączamy/ Wyłączamy Wentylator w Łazience - alias: Załącz/ Wyłącz Wentylator w Łazience trigger: platform: event event_type: xiaomi_aqara.click event_data: entity_id: binary_sensor.switch_158d000373c264 click_type: single action: - delay: '00:05:00' - service: switch.off entity_id: switch.przelacznik_lazienka_wentylator
I can switch it on/ off via pressing a button but unfortunately the delay doesn’t work. What’s wrong with the code here?
Posts: 4
Participants: 3