True/False "value_template" based on condition

Hi,
I’m trying to create a True/False sensor to determine if anybody is at home.

In the below code I would like to change the state of the “nobody_home” sensor to True when the sensor is 0. What am I missing?

nobody_home:
       value_template: "{{ sensor.people_at_home | int = 0 }}"

Do you have a people_at_home sensor already?

If so you want the state of that and add an extra equals sign between int and 0

states('sensor.people_at_home') | int == 0

Great, thanks

1 Like