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 !