Why doesn't it work

can someone explain to me why my automation is not working.
When I put the trigger in the developer tool it shows “true”
If I release the trigger manually, I get an email.

- id: '1605697247760'
  alias: batterie test
  description: ''
  trigger:
  - platform: template
    value_template: '{{ state_attr(''climate.az_heizung2'', ''battery'') | float <=
      3.1 }}'
  condition: []
  action:
  - service: notify.sendmail_battery
    data:
      message: Batterie leer :*
      title: Batterie leer
  mode: single

Because to trigger the template has to change from false to true. If it is always true it will never trigger.

1 Like

ahh ok, then I’ll try if I can somehow fool him
thanx

Also you don’t need a template to do this since version 0.115, you can trigger on numeric attributes directly:

  trigger:
  - platform: numeric_state
    entity_id: climate.az_heizung2
    attribute: battery
    below:  3.2  # same as <= 3.1
1 Like

I tried that before. Of course that didn’t work either :slight_smile:

Because of the same issue. It has to go from above 3.2 to below 3.2 for the trigger to activate. If it stays below 3.2 nothing will happen.

1 Like