Hi, I have tried the below automation and it works in the template editor and if I manually trigger the automation, but it isn’t firing based on any temperature change. Any ideas not? Here is my yaml
alias: Fan Automation
trigger:
platform: template
value_template: "{%- if states('sensor.dark_sky_temperature') | int > 64 -%} True {%- endif -%}"
condition:
condition: or
conditions:
- condition: state
entity_id: 'group.all_devices'
state: 'home'
- condition: numeric_state
entity_id: 'sensor.dark_sky_temperature'
above: 85
action:
- service: fan.set_speed
entity_id: fan.ceiling_fan
data_template:
speed: "{% if 65 < states('sensor.dark_sky_temperature') | int < 70 %}
low
{% elif 71 < states('sensor.dark_sky_temperature') | int < 75 %}
medium
{% elif 76 < states('sensor.dark_sky_temperature') | int %}
high
{% endif %}"
- service: fan.set_speed
entity_id: fan.bedroom_fan
data_template:
speed: "{% if 65 < states('sensor.dark_sky_temperature') | int < 70 %}
low
{% elif 71 < states('sensor.dark_sky_temperature') | int < 75 %}
medium
{% elif 76 < states('sensor.dark_sky_temperature') | int %}
high
{% endif %}"
Edit: I believe I solved it by changing True
to true
in the template trigger