Skip to content
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

Support Floor sensor entity based on currently detected Area. #431

Open
agittins opened this issue Jan 14, 2025 · 4 comments
Open

Support Floor sensor entity based on currently detected Area. #431

agittins opened this issue Jan 14, 2025 · 4 comments

Comments

@agittins
Copy link
Owner

Now that HA has floors, Bermuda can/should support exposing a sensor for the current floor of a device.

In simple terms, this would simply look up the Floor for the current Area, and expose that. Some points to consider, though:

  • One could average the area distances by floor and use that to determine floor and also narrow down which area (ie if you are close to two rooms on ground floor, and close to one room on first floor, you are probably on the ground floor). This only holds if the distribution of proxies is similar on each floor (having two proxies close above you and one distant on your level would give a poor result).
  • Not all installations will have floors defined, perhaps sensor should be disabled by default (and auto-enabled if floors are found, if that's possible).
  • Possible confusion when trilat is done if it also exposes a floor sensor.
@fft1010
Copy link

fft1010 commented Jan 14, 2025

HI,
I just had the idea, that this might be solvable in HA only, if one only wants to know if the sensor is at a specific floor.
My idea: Having a binary sensor for each floor-sensor combination, that is true, if this sensor is in any area of the floor.
just an idea
Juergen

@agittins
Copy link
Owner Author

Yes, one can certainly solve this using helpers like template sensors, it just gets a bit cumbersome if you have a lot of devices you want to track (creating a helper for each device). Blueprints can make that a little easier to maintain, I guess - but it's hard to beat the convenience of having something built-in.

@fft1010
Copy link

fft1010 commented Jan 15, 2025

but it's hard to beat the convenience of having something built-in.

for sure true. But code has to be maintained, and if it is a rarer problem, it might be worth not implementing it :-) I know I raised the issue, but if I am the only one, ...

I have many other addons installed, and pressing the "update HA" button makes my pray more and more every time :-)

Now I have an update, that works on my test HA machine and not on the real HA instance :-(

anyway. It just dropped to my mind, that "less might be more".

thanks
Juergen

@Lash-L
Copy link
Contributor

Lash-L commented Jan 20, 2025

Not all installations will have floors defined, perhaps sensor should be disabled by default (and auto-enabled if floors are found, if that's possible).

That should definitely be possible. Typically the approach is to not call async_add_entities for that entity if you don't want it and just do the check if floors exist to then call async_add_entities for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants