Hey there,
I’m looking for a way to replace my daylong routines in Google with something in HomeAssistant. I tried creating an automation using if-else statements, and wait for time options and it is not working to run the automations at the times set.
Here is a copy of the YAML that I’m trying to use
alias: Workday Automation Test
description: ""
trigger:
- platform: time
at: "08:55:00"
condition:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: "on"
- condition: state
entity_id: input_boolean.holiday
state: "off"
action:
- if:
- condition: state
entity_id: input_boolean.holiday
state: "off"
then:
- service: script.announce_the_time
data: {}
- wait_for_trigger:
- platform: state
entity_id:
- media_player.speaker_group
to: idle
- service: script.start_workday
data: {}
- wait_for_trigger:
- platform: time
at: "09:00:00"
- if:
- condition: state
entity_id: input_boolean.holiday
state: "off"
then:
- service: script.announce_the_time
data: {}
- wait_for_trigger:
- platform: state
entity_id:
- media_player.speaker_group
to: idle
- service: script.checkin
data: {}
- wait_for_trigger:
- platform: time
at: "10:00:00"
timeout:
hours: 0
minutes: 0
seconds: 0
milliseconds: 0
- if:
- condition: state
entity_id: input_boolean.holiday
state: "off"
then:
- service: script.announce_the_time
data: {}
- wait_for_trigger:
- platform: state
entity_id:
- media_player.speaker_group
to: idle
- service: tts.google_translate_say
data:
cache: false
entity_id: media_player.speaker_group
message: "Message "
- wait_for_trigger:
- platform: time
at: "13:30:00"
timeout:
hours: 0
minutes: 0
seconds: 0
milliseconds: 0
- if:
- condition: state
entity_id: input_boolean.holiday
state: "off"
then:
- service: script.announce_the_time
data: {}
- wait_for_trigger:
- platform: state
entity_id:
- media_player.speaker_group
to: idle
- service: tts.google_translate_say
data:
cache: false
entity_id: media_player.speaker_group
message: >-
"Message"
- wait_for_trigger:
- platform: time
at: "16:00:00"
timeout:
hours: 0
minutes: 0
seconds: 0
milliseconds: 0
continue_on_timeout: false
- if:
- condition: state
entity_id: input_boolean.holiday
state: "off"
then:
- service: script.announce_the_time
data: {}
- wait_for_trigger:
- platform: state
entity_id:
- media_player.speaker_group
to: idle
- service: tts.google_translate_say
data:
cache: false
entity_id: media_player.speaker_group
message: "Message "
- wait_for_trigger:
- platform: time
at: "16:55:00"
timeout:
hours: 0
minutes: 0
seconds: 0
milliseconds: 0
continue_on_timeout: false
- if:
- condition: state
entity_id: input_boolean.holiday
state: "off"
then:
- service: script.announce_the_time
data: {}
- wait_for_trigger:
- platform: state
entity_id:
- media_player.speaker_group
to: idle
- service: tts.google_translate_say
data:
cache: false
entity_id: media_player.speaker_group
message: >-
"Message"
mode: single
I have redacted some of the finer details
Right now I have the 8:55AM session go off normally, then the 9:00AM one the rest all go off simultaneously
Can anyone make suggestions how to fix this or if there is a better way for me to do this?