Data Template Multiple Entities

I’m trying to create a sensor for two device trackers but I’m a little lost. I only want the state to be true if two device trackers are home, if one of them is not but the other is then set to false.

Try this with a template binary_sensor:
value_template: '{{ states("device_tracker.device1") == "home" and states("device_tracker.device2") == "home" }}'

That’s perfect, thank you.

1 Like