I’ve been working on this automation for a while and just can’t seem to get it right so would appreciate any help please.
The automation closes my window blind in the evening. At the moment it asks for the windows to be closed regardless whether they are open or closed so I want to make the speech part conditional. It should only speak if one or both windows are open so that we can close the windows before the blind closes. I have added the section for the condition but can’t figure out what I’m doing wrong with the logic.
- alias: 'Lounge Blind - close at night'
initial_state: true
trigger:
platform: numeric_state
entity_id: sun.sun
value_template: '{{ state.attributes.elevation }}'
below: 0
action:
# The service: tts.google_say routine should run only if one or both
# of the windows are open. The rest of the automation should run
# every time.
- condition: state
entity_id:
- binary_sensor.lounge_window_left
- binary_sensor.lounge_window_right
state: 'open'
- service: tts.google_say
entity_id: media_player.chromecast_hass
data:
message: 'Please close the windows.'
# End of conditional part - run rest of automation every time
- delay: '00:00:30'
- service: cover.close_cover
data:
entity_id:
- cover.lounge_blind