FR: Integration with Bermuda #447
Replies: 6 comments
-
Hey @agittins! Thanks so much for reaching out! This feature is indeed what I intend to work on next so it's super cool that you pinged me in such opportune moment. I did a quick survey on MA's Discord and seems that we have users that use Bermuda (such as myself, thanks for the great integration!), people who use room assistant, espresence and others. In order to keep open the compatibility, the way I'm thinking on implementing it is to let the user point out the sensor (like the bermuda sensor) and then say "compare [state/attribute xyz] to [area name/area id]" with a couple dropdowns (and a text input for the attribute name) and that should cover most of the folks. I might abstract the complexity a bit by just asking "what's your sensor" and then have a dropdown for the platform (bermuda/room assistant) that auto-sets the other two (then hidden field). What do you think? Is that a good path to follow? |
Beta Was this translation helpful? Give feedback.
-
I was thinking this approach is fine for 1-on-1 mapping between trackers and presence-indicating-entities (person/pet). But for persons we might have multiple trackers (phone/watch/wallet/etc), so in those cases it might be beneficial to use (something like) person entities or at least some way to say "these trackers govern the presence/location of 1 person" (which cannot be in 2 areas at the same time) |
Beta Was this translation helpful? Give feedback.
-
Awesome! 😀
That sounds like a good, flexible way to do it. I'm not familiar with your integration yet so I'd think that whatever fits with the "MA Way" of doing things will be the way to go :-) Another option could be to use labels, but then you'd probably still have to do a per-sensor check of how to handle sensors from different integrations etc. I think a useful thing would be for you to have a reliable way for your integration to identify the source of any given sensor, so that it can make decisions about how to handle it or present options to the user. In that vein... Currently Bermuda's area sensors have a That way, if you choose to, you can easily identify that an area sensor comes from Bermuda (something like I'm guessing you'll just subscribe to updates from the entity registry and filter for the ones you're interested in. Does that sound reasonable? If there's anything else that would help MA to identify Bermuda sensors, or if it could benefit from access to some other info, just let me know! |
Beta Was this translation helpful? Give feedback.
-
Alright, I've managed to squash the bugs (so far) on the next release so I'm already getting ready to work on this.
In short, when you create a "Magic Area Instance", you can either choose to create it for one of your existing areas or the so-called "Meta-Areas" that are kinda "groups" of the regular areas. In Magic Areas, you can specify if the area is interior or exterior. Meta-Areas will group those into a new Interior/Exterior Meta-Area (if you create them) and also a Global one which groups all areas. (Floors can be grouped that way too) Magic Areas and Magic Meta-Areas allows the user to select which features (plugins) they want to enable. Some features are only available for regular areas, others for meta-areas and some for both. This "BLE tracking" functionality would be a feature. My tenets for this feature are the following
I see BLE trackers are more of a "Global" thing, as in there isn't much area-specific configuration to be done, so I recon this would be a feature where you would enable in your "Global" Magic Meta-Area instead of in every single area where you want the BLE tracker to be considered. On the UI, user would enable the feature, then go to the options for that feature and select the entities to track and maybe the provider (Bermuda, mqtt-room) if the parameters diverge (i.e. one presents area name in state vs other in attributes only). Magic Areas main sensor "Area State" tracks multiple The Global area instance is the one that tracks the BLE Tracker sensors (e.g. Bermuda sensor) and when the value of it equals the an area that we have a magic area instance for it, we force update ( With this approach, users only have to configure the feature once, and all the tracking stuff would work out of the box. @tbrasser, you that are most familiar with both integrations, what do you think? @agittins this approach wouldn't need any updates on your side, but I'd also love your input as a dev on this one |
Beta Was this translation helpful? Give feedback.
-
Alright folks, it's in the oven. Head over to the PR for more info! |
Beta Was this translation helpful? Give feedback.
-
@agittins in addition to above PR (that lets us assign ble trackers/beacons that will make areas active in magic_areas) would it be an idea to have the option in bermuda to sync the current area with the device its area? For example my plant sensors might move between areas, having this option would auto-update its home-assistant area (and with latest magic_areas beta, auto-reload magic_areas). lmk what you think, I can open a FR in bermuda repo if you like it. |
Beta Was this translation helpful? Give feedback.
-
Howdy! I might have heard a rumour that you might be considering integrating support for Bermuda into your integration - I just wanted to reach out and let you know that the possibility sounds awesome, and if there's anything that would make that easier on the Bermuda side just let me know!
Bermuda creates a
sensor
to publish the Area name, and has attributes for thearea_id
.Would it be useful if Bermuda pushed an event to the bus each time the area for a device changed?
Let me know if you have a "preferred" way to do things and I'll see what I can learn! 😅
Beta Was this translation helpful? Give feedback.
All reactions