Hey folks,
I’m trying to mimic the “cat tracking” from this Reddit thread. While I was able to work out with the ESPHome folks how to make this work on my bluetooth proxies (and added proxies to each room in my condo), I’ve hit a wall with trying to get this template to work:
- platform: template
sensors:
cat_location:
friendly_name: Tuck’s Location
entity_id:
- sensor.outside_bluetooth_proxy_tuck_outside_rssi
- sensor.back_basement_bluetooth_proxy_tuck_back_basement_rssi
- sensor.basement_bluetooth_proxy_tuck_basement_rssi
- sensor.ben_bedroom_bluetooth_proxy_tuck_ben_bedroom_rssi
- sensor.hallway_bluetooth_proxy_tuck_hallway_rssi
- sensor.guest_bedroom_bluetooth_proxy_tuck_guest_bedroom_rssi
- sensor.upstairs_bathroom_bluetooth_proxy_tuck_upstairs_bathroom_rssi
- sensor.living_room_bluetooth_proxy_tuck_living_room_rssi
- sensor.downstairs_bathroom_bluetooth_proxy_tuck_downstairs_bathroom_rssi
- sensor.front_door_bluetooth_proxy_tuck_front_door_rssi
- sensor.kitchen_bluetooth_proxy_tuck_kitchen_rssi
icon_template: mdi:cat
value_template: >-
{{
[
(states("sensor.outside_bluetooth_proxy_tuck_outside_rssi"), "Outside")
(states("sensor.back_basement_bluetooth_proxy_tuck_back_basement_rssi"), "Back Basement")
(states("sensor.basement_bluetooth_proxy_tuck_basement_rssi"), "Main Basement")
(states("sensor.living_room_bluetooth_proxy_tuck_living_room_rssi"), "Living Room")
(states("sensor.downstairs_bathroom_bluetooth_proxy_tuck_downstairs_bathroom_rssi"), "Downstairs Bathroom")
(states("sensor.kitchen_bluetooth_proxy_tuck_kitchen_rssi"), "Kitchen")
(states("sensor.front_door_bluetooth_proxy_tuck_front_door_rssi"), "Front Door")
(states("sensor.hallway_bluetooth_proxy_tuck_hallway_rssi"), "Hallway")
(states("sensor.ben_bedroom_bluetooth_proxy_tuck_ben_bedroom_rssi"), "Ben Bedroom")
(states("sensor.upstairs_bathroom_bluetooth_proxy_tuck_upstairs_bathroom_rssi"), "Upstairs Bathroom")
(states("sensor.guest_bedroom_bluetooth_proxy_tuck_guest_bedroom_rssi"), "Guest Bedroom")
]
|rejectattr(0, "equalto", "nan")
|rejectattr(0, "equalto", "unavailable")
|min(default=(0, "Unknown"))
|last()
}}
It appears from what I’m seeing in the logs that this type of configuration has been deprecated, but even after looking over the configuration variables for templates, I’m still not sure how to resolve this.
Basically, what I’m looking to do is what the OP in that Reddit thread managed to do: figure out what room the cat(s) are in based on which proxy they’re closest to. This may seem like a ridiculous use case, but one of my cats has FHV and can get quite sick very quickly, so trying to find her during those times can be trying. At least with the tracker I’ll know what room to be concetrating on.
Apologies in advance for being an idiot.