Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 96121

Adding delay to Xiaomi Switch

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>