agittins / agittins/bermuda

area_last_seen kind of sensor that means the last known area it was seen in

Aperta
#714 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
2k
Fork
70
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Is your feature request related to a problem? Please describe.**

I lose my stuff all the time, and I want to use Bermuda as a best-effort asset tracker for around the house. I have a bluetooth proxy in each room, and all I really want is a list of all bluetooth devices ever seen along with the room they were last seen in (and how long ago). This is particularly good for devices that advertise infrequently.

The *_area_last_seen sensor seems ideal for this, but quite often this seems to transition to Unknown or None. This seems at odds with the name of the sensor - if it becomes Unknown or None, then surely it should remain in the area last seen?

I think that the transition happens when a device is no longer observed (leaves the house, powers off, stops advertising, confidence expires), *_area_last_seen is Unknown or None. I can see maybe this being useful for presence detection, but I really need a persistent value for this, or if not, another sensor that is "_last_known_area" maybe.

I'd argue that the "_last_known_area" shouldn't ever be Unknown or None, because for that bluetooth device to be visible, it must have been picked up by a proxy, right?

**Describe the solution you'd like**

Add an additional, derived sensor per device, for example:

sensor.bermuda__last_known_area

with the following semantics:

Updates only when area_last_seen transitions to a real area value

Ignores unknown and None; should not be possible to be either. Never transitions to unknown on its own. Persists across restarts (e.g. via RestoreEntity)

The last changed attribute is useful, but adding a last_confirmed attribute would possibly also be more useful as a device could have been seen in an area without it having changed in ages.

This sensor would coexist with area_last_seen without changing its behaviour, enabling Bermuda to support both presence detection and asset / inventory tracking use cases.

**Describe alternatives you've considered**

Using area_last_seen alone: loses the last known location when the device disappears

Querying recorder/history data: heavy and not dashboard-friendly

Trigger-based template sensors: works but doesn’t scale, requires manual YAML or code generation, and hides semantics outside the integration. I want to automatically add all bluetooth devices.

Forking Bermuda: possible, but undesirable if this can be addressed upstream

**Additional context**

I run ESPHome Bluetooth proxies in every room, mapped to Home Assistant Areas, and track many Bluetooth devices that are frequently misplaced. The desired UX is something like: “Last seen in the Kitchen (2 hours ago)”, even if the device is no longer advertising.

I’d be happy to attempt to implement, test, or document this feature if the approach is acceptable.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.