Automation issue release 115 syntax


I’m sure I’ve not understood the spirit of the changes in release 115 !

I have still some ‘automation’ issues with the new syntax:

    - platform: template
      value_template: "{{ sensor.compteur_presence | int = 0 }}"
    - platform: numeric_state
      identity_id: sensor.compteur_presence
      below: 1 

I’ve tried both options : template and/or numeric_state
Can you please help me with the correct syntax ?

You probably want to read the templating docs - that template is wrong.

Oh, and entity_id not identity_id :wink:

    - platform: template
      value_template: "{{ state('sensor.compteur_presence') | int = 0 }}"
    - platform: numeric_state
      entity_id: sensor.compteur_presence
      below: 1 

What’s the actual question though?

Your first template will not work, you need to have syntax as below:
"{{ states.sensor.compteur_presence.state | int == 0 }}"
if your sensor.compteur_presence has only two states TRUE and FALSE, you woun’t need interger casting for template to work.

Thanks to both of you !
A stupid typo and I I was only thinking to the ‘automation’ warning when you restart HA.

Btw what is the exact role of the “Check configuration 'Tool ?
I thought it was a kind of pre-compiler” to check the correct syntax, the typo mistakes and others…
Obviously not !

thanks for the explanation, if you have it !

The UI check does basic checks only, the command line check does a full config load and check.

thanks for the explanation