Help with Automation (not being) triggered by template sensor

I want to turn on (restart) my wood pellet stove when I’ve determined it has failed, which it does often for multiple reasons. Mostly, and most annoyingly, it shuts off with a “Goodbye” message for no apparent reason. It happen multiple times a day and night.

The only trigger I’ve been able to get to work at all is when the room temp falls below a specific value. That works. None of my attempts at Template sensors work.

The. Automation

alias: "Fix wood stove error "
description: ""
trigger:
  - platform: template
    value_template: >-
      "{{ states('sensor.esph_house_stove_current_temp')|float(0) +4  <=
      states('sensor.esph_house_stove_set_temp')|float(0) }}
  - platform: state
    entity_id:
      - sensor.stove_error
    from: "False"
    to: "true"
  - platform: numeric_state
    entity_id: sensor.esph_house_stove_current_temp
    below: 64
condition: []
action:
  - service: climate.set_hvac_mode
    data:
      hvac_mode: heat
    target:
      entity_id: climate.house_wood_pellet_stove
  - service: notify.mobile_app_jeffs_128gb_ipad
    data:
      message: >-
        Stove Error. House Temp={{
        states('sensor.esph_house_stove_current_temp')}}. Set 
        temp={{states('sensor.esph_house_stove_set_temp')}}
  - service: notify.mobile_app_jeffs_iphone_se
    data:
      message: >-
        Stove Error. House Temp={{
        states('sensor.esph_house_stove_current_temp')}}. Set
        temp={{states('esph_house_stove_set_temp')}}
mode: single

The sensor i created trying another way:

  stove_error:
    value_template: "{{ states('sensor.esph_house_stove_current_temp')|float(0) +4  <= states('sensor.esph_house_stove_set_temp')|float(0) }}"

This isn’t rocket science but it won’t fire. The stove_error sensor goes from false to true and my template in the automation does the same in the template inspector.
From this


To this:

And in the template inspector

What am I doing wrong???

Binary sensor… that’s the key that unlocks it and triggers the automation based on state change. Nothing else worked.

binary_sensor:
  - platform: template
    sensors:
      bs_stove_error:
        friendly_name: "BS Stove Error"
        value_template: >-
          {{ float( states('sensor.esph_house_stove_current_temp') , 0)  <=  float(states('sensor.esph_house_stove_set_temp') , 0)-4 }}

Automation:

platform: state
entity_id: binary_sensor.bs_stove_error
to: "on"

Finally!

#1

platform: template
value_template: >-
  "{{ states('sensor.esph_house_stove_current_temp')|float(0) +4  <=
  states('sensor.esph_house_stove_set_temp')|float(0) }}

The issue is likely the ".

#2

platform: state
entity_id:
  - sensor.stove_error
from: "False"
to: "true"

Without seeing the sensor configuration it’s impossible to say for sure, but this one is likely not working due to improper capitalization. State triggers are case sensitive… “true” != “True”.

Just for kicks, I went back and tested #1 without the quote and disabled my existing triggers. It worked.
And the capitalization. It also worked.

I must have looked at those trigger statements 100 times… attention to details matter. knowing which details matter matters even more!

1 Like