I want to create a binary sensor that will be true if two device trackers are in the same zone. This should be easy enough using a data template. But how the heck can you get the zone name for a device tracker? state
isn’t reporting anything for me in the template designer.
device_tracker.foo_iphone
device_tracker.bar_iphone_xs
I figured it out. I was missing an “s” in states. Here is my binary_sensor for reporting if two trackers are in the same zone. I do a lot of event reporting for one phone, but don’t want the phones going apesh** with notifications if they are both travelling together. It gets super obnoxious.
foo_and_bar_same_zone:
friendly_name: "Foo & Bar in same zone"
value_template: "{{ ((states('device_tracker.foo')) == (states('device_tracker.bar'))) }}"
1 Like