-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/question: area occupation sensors #203
Comments
It's an interesting idea, and I can certainly see the use-case. Just trying to think through how we could implement this, I think it would need the ability to tag which devices are "occupants", since you wouldn't want to count all devices in an area, but typically specific ones that indicate "persons" are present (versus say a tile tag in a backpack that isn't EDC, etc). We'd also need a sensor for each area. On the flip-side, thinking about how to implement it outside of Bermuda... perhaps using the new Labels feature in HA. So you'd label the entities you use to track people (or pets, or whatever) with a given label, then create a template sensor that basically does "count the entities labelled I think any cooldown value will be very automation-specific (timeout for exhaust fan vs lights vs HVAC etc will all be widely different) but unlike PIR sensors it does stay "on" until a device is no longer detectable in an area (or moves closer to another area), and does have a timeout already if signal is lost, so I think that part is probably good as-is. I'll let the idea percolate in my head for a while, I think you might be right that doing it in Bermuda would be better than externally, but I want to consider the possibilities since it adds some more complexity to the integration, plus I am keen to try and prioritise the trilateration work at this stage - which might lead to a different way of implementing this idea as well. So for now I'll file it as a lower-prio enhancement to keep in the back of my mind, if that's OK. At this stage I think it's probably worth building in, but I think I want to get some other features in first as they might have some bearing on how this would best be implemented. |
Necrocommenting here, but if you add a label "Trackable Entity" (which gets sluggified to {% set entities = label_entities('trackable_entity') | select('is_state_attr', 'area_id', 'living_room') | list %}
{{ entities | count > 0 }} That gives you "true" or "false" that there are devices tracked to that area. Remove the It's nice, too, since it will listen for state changed events for all the entities with that label. |
I really like this solution, plus it was just posted in the dev chat that "Labels are considered userland, so there are no public APIs to use with labels" so I am very much leaning toward this being the correct way to implement the feature. I think this is probably worth adding to the wiki as a solution to that particular need, so it's easier for folk to find it. |
Is your feature request related to a problem? Please describe.
I want to know if at least a single device is in an area.
Describe the solution you'd like
Per-Area occupancy sensor (true/false), optionally with a list of devices currently in that area and a "cooldown time".
Describe alternatives you've considered
It would probably be possible to do this with automations and helpers "by hand", but that is no elegant solution.
Not too sure if this is still in scope for bermuda though.
The text was updated successfully, but these errors were encountered: