I don’t see an id for the automation, I don’t know if its required now but you could try, you also could change the action to something simple like switching a light. This way you could troubleshoot where the automation stops working.
You could also trigger the automation via the services tab.
I already have it wrapped in the condition section, but as per the docs, the coma’s are not used for the initial_state. The input boolean is definitely ‘on’ whebn checked on the dev page
Is your automation activated in Dev Tools/states?
If not, i assume the problem is the initial_state: 'on' in the automation.
Should be True or maybe on
I did try but as no one was home I’m not sure if it just sat and waited at the wait_template or not. I need to wait until I’m back home later in the week. I guess if no one see’s any issue in my code then surely it should work… but it has never actually produced the TTS audio
So, just to start at the basics, do normal time-based automations work as expected? I.E. do they trigger at times that are specified.
2nd thing i’d look at is your wait template. Verify that the wait template is actually waiting. I’ve seen weirdness with those.
Also, there is an alternative to this automation if you can’t get it working. You could build 2 counters, and fire once based on the movement between the 5am to 9am and 5pm to 9pm. It’s much more overhead though so I’d try to get this method working.
EDIT: Now that I think about it, you aren’t even trying to only fire the message once. You could just do the automation this way:
automation:
- alias: Feed Dog TTS
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.kitchen_multi_sensor_sensor
to: 'on'
condition:
- condition: or
conditions:
- condition: time
before: "09:00:00"
after: "05:00:00"
- condition: time
before: "21:00:00"
after: "17:00:00"
- condition: state
entity_id: input_boolean.dog_feeding_reminder
state: 'on'
action:
- service: tts.google_say
entity_id: media_player.kitchen
data:
message: "Yo, Bella is looking hungry"
and if you don’t mind templates:
automation:
- alias: Feed Dog TTS
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.kitchen_multi_sensor_sensor
to: 'on'
condition:
- condition: template
value_template: >
{% if is_state('input_boolean.dog_feeding_reminder','on') %}
{{ 5 <= now().hour < 9 or 17 <= now().hour < 21 }}
{% else %}
False
{% endif %}
action:
- service: tts.google_say
entity_id: media_player.kitchen
data:
message: "Yo, Bella is looking hungry"
My nornal time based automatinos do work. I have tested this automation by clicking ‘trigger’ and absolutely nothing happens… I would expect it to start the wait_template, which makes me think that is the problem. ie: if i click ‘trigger’ then walk in front of the motion sensor, I get no TTS audio. Nothing in the log.
Your option will work although it would produce TTS audio every time I go in front of the motion sensor between those times. I would need to include an input_boolean to shut it off, which isnt a problem. I’m happy to change the automation to work this way but I really want to see the wait_template work, it’s annoying me!
I finally got around to looking into this and found an issue with the media_player that I was sending the TTS to. A small entity_id code change and it is now working