#Broadcast message when window opened and then humidity stops falling

1 messages · Page 1 of 1 (latest)

candid valley
#

I am attempting to create a voice reminder letting me know I can close the windows after I have opened it and humidity has stopped falling.
I am using a trend helper to get the trend data.

I am struggling with the part where the automation is waiting for the condition to be met. I have read I should not use the wait for option, as it is not persistent across restarts.

What is the next simplist solution (wait for sounds exactly like what I need :X )

description: ""
triggers:
  - type: opened
    device_id: 894a63522b9da7fb6fc844e6486cbb20
    entity_id: 3662ae3d221dd44f082dd10a86ff4c59
    domain: binary_sensor
    trigger: device
    for:
      hours: 0
      minutes: 5
      seconds: 0
conditions:
  - type: is_off
    condition: device
    device_id: fd7919e4f46dbaa17879443a1476022f
    entity_id: 4da8484e6b2233d7cc14ca1f7c9f3469
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 30
actions:
  - action: tts.speak
    metadata: {}
    data:
      cache: true
      media_player_entity_id: media_player.living_room_speaker_2
      message: You can close the bathroom window
mode: restart```
polar galleon
#
  1. don't use device triggers if you can help it - state triggers are better and wayyy more readable
  2. conditions are there to stop it running when a trigger goes off - so WHEN TRIGGER - IF CONDITION - DO ACTION
#

So for this - what you could do is move the condition to a "wait for" block in the action before the tts.speak, and i'd also put a condition around the tts speak that checks the window is still open