agittins / agittins/bermuda

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

未关闭
#714 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
2k
派生
70
PR 合并指标
30 天内没有已合并 PR

描述

**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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。