Something about this syntax is wrong and I can’t figure it out. I’ve even copy and pasted this from other posts on the forum.
- service_template:
"{% if is_state('sensor.dark_sky_icon', 'rain') %}
script.abbott_rain
{% elif is_state('sensor.dark_sky_icon', 'snow') %}
script.abbott_snow
{% endif %}"
That should be all anyone needs to help me out, but in case not, here’s the full automation:
- id: auto_lifx_weather_jelly
alias: Weather Jelly
trigger:
- at: '11:02:00'
platform: time
condition: []
action:
- service_template: "{% if states('sensor.dark_sky_daytime_high_temperature_0de') | float > 80 %}\n script.turn_abbott_red\n\
{% elif states('sensor.dark_sky_daytime_high_temperature_0d') | float > 70 %}\n script.turn_abbott_orange\n\
{% elif states('sensor.dark_sky_daytime_high_temperature_0d') | float > 60 %}\n script.turn_abbott_yellow\n\
{% elif states('sensor.dark_sky_daytime_high_temperature_0d') | float > 50 %}\n script.turn_abbott_green\n\
{% elif states('sensor.dark_sky_daytime_high_temperature_0d') | float > 30 %}\n script.turn_abbott_blue\n\
{% elif states('sensor.dark_sky_daytime_high_temperature_0d') | float > 0 %}\n script.turn_abbott_icey_blue\
\ \n{% else %}\n script.turn_abbott_purple\n{% endif %}\n"
- service: persistent_notification.create
data:
message: "Temp high = {{ states('sensor.dark_sky_daytime_high_temperature_0d') | float }}"
title: "Debugging"
- service_template:
"{% if is_state('sensor.dark_sky_icon', 'rain') %}
script.abbott_rain
{% elif is_state('sensor.dark_sky_icon', 'snow') %}
script.abbott_snow
{% endif %}"
And the error code:
Error while executing automation automation.weather_jelly. Invalid data for call_service at pos 3: Service does not match format .