Device trackers created via device_tracker.see
don’t survive restarts. This is frustrating since whenever I’m using this service its because I have a device that isn’t natively trackable and instead I’m tracking any time my phone is near it. Therefore losing the value isn’t ok since I don’t really have any way to get it back.
I’m not really sure how common this problem is but I think in general device trackers should survive restarts. I think the idea behind not doing so is that they’ll just report in again soon after but that can be frustrating since not all integrations report in at the same rate. And manual ones like the ones I’m describing definitely don’t.
Not very common, I would guess… Because I couldn’t find anything about it at the time when I was trying to find a solution. I use the device_tracker.see
service to track BLE beacon using ESPHome. Because I want to include this information as a device tracker on a person. I ended up basically “restoring” the state by using the associated person’s phone to determine home
/not_home
state on startup.
I have thought about this for a while, I’m of the opinion that a device_tracker
template would really be the solution. It would retain the state without having to do something odd in the device_tracker.see
service call and it would them allow power users, like myself, the ability to define device trackers from custom built solutions.
Arguably, and I will acknowledge this fact, a custom integration might be a better choice for my use case just based on the fact I used custom built solution to describe what I’m doing.