Hi guys,
I’m having issues with the following script, I’m unable to get it to speak anything when using if statements within the message, anyone any ideas?
danhomelauraatwork:
alias: "Dan arrived Home Laura at work"
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.living_room_home
volume_level: 0.9
- wait_template: '{{ states.input_boolean.motion.state == "on"}}'
- service: tts.amazon_polly_say
data_template:
entity_id: media_player.living_room_home
message: >
{% if now().strftime("%H")|int < 12 %}
'Good morning Dan, Welcome Home! Laura is still at work, the weather will be {{ states.sensor.dark_sky_minutely_summary.state }} and {{ states.sensor.yr_temperature.state | round(0)}} degrees.'
{% elif now().strftime("%H")|int < 18 %}
'Good afternoon Dan, Welcome Home! Laura is still at work, the weather will be {{ states.sensor.dark_sky_minutely_summary.state }} and {{ states.sensor.yr_temperature.state | round(0)}} degrees.'
{% else %}
'Good evening Dan, Welcome Home! Laura is still at work, the weather will be {{ states.sensor.dark_sky_minutely_summary.state }} and {{ states.sensor.yr_temperature.state | round(0)}} degrees.'
{% endif %}
The wait condition is fine as i use it in other scripts without issue so it has to be down to the message.