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

Breaking Change: Retrieve beacon name for beacon monitor sensor #2941

Closed
wants to merge 2 commits into from

Conversation

dshokouhi
Copy link
Member

@dshokouhi dshokouhi commented Oct 2, 2022

Summary

Fixes: #2932 by retrieving the name in the Beacon Monitor.

This will be a breaking change as we are changing the attribute format

Leaving as a draft to get feedback and also need some help in making the array look better in the attributes. Not really sure what type of conversion we need to do there. As of now its a string 🤷‍♂️

Example of new attributes in current state of this PR:

icon: mdi:bluetooth
friendly_name: Pixel 6 Pro Beacon Monitor
1a01a2b8-13a7-4c98-a732-496554720c3d_100_1: {distance=1.1, name=null, uuid=1a01a2b8-13a7-4c98-a732-496554720c3d, major=100, minor=1}
50765cb7-d9ea-4e21-99a4-fa879613a492_15841_33291: {distance=18.54, name=null, uuid=50765cb7-d9ea-4e21-99a4-fa879613a492, major=15841, minor=33291}
9d05c5cc-b742-4b1d-96b8-6b8626854119_100_1: {distance=4.76, name=null, uuid=9d05c5cc-b742-4b1d-96b8-6b8626854119, major=100, minor=1}

Screenshots

image

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#pending

Any other notes

@dshokouhi dshokouhi marked this pull request as draft October 2, 2022 03:10
@leroyloren
Copy link

I'm afraid this would again complicate/break the work in e.g. NodeRED, do you think it's good to use attributes in an attribute?
How important are individual values?
I would expect the app to give me a list of available beacons with a unique ID to trigger the action, not other sub-attributes.
I think the most important thing is to announce the availability and possibly the distance, everything else is not necessary.

@Mincka
Copy link
Contributor

Mincka commented Oct 3, 2022

everything else is not necessary.

Sorry but this is not about what you need, or what works or not out of the box with NodeRed.
The beacons are providing additional information that is not be limited to their name or their distance.

If you don't need this additional data, can't you use a simple regex or something similar to filter them out in NodeRed?

We don't know yet what will be the final format to hold this information but as far as we respect general guidance and practices, I am fine with that. I fully support the request to avoid spaces in the name of the attributes. Beyond that, I suggested another format in the original issue that seems more "YAMLish", but maybe not better than this original draft proposal.

In your case, I think it would be even better if you could specify the "sub attribute" for your beacon, something like:
new_state.attributes.1a01a2b8-13a7-4c98-a732-496554720c3d_100_1.distance
or
new_state.attributes.1a01a2b8-13a7-4c98-a732-496554720c3d_100_1['distance']

@leroyloren
Copy link

In your case, I think it would be even better if you could specify the "sub attribute" for your beacon, something like: new_state.attributes.1a01a2b8-13a7-4c98-a732-496554720c3d_100_1.distance or new_state.attributes.1a01a2b8-13a7-4c98-a732-496554720c3d_100_1[distance]

This could very well be 👍

zachowj/node-red-contrib-home-assistant-websocket#667

@dshokouhi
Copy link
Member Author

update: Looks like we cannot change the name as its supposed to already be transmitting the friendly device name however I am not sure if it is.

AltBeacon/android-beacon-library#987 (comment)

bluetoothName is only populated (sometimes) after scanning, and only if the BLE device detected with that beacon has also recently advertised its name in a separate packet.

Will need to update this PR to reflect that.

@dshokouhi dshokouhi changed the title Breaking Change: Set and retrieve beacon name for transmitter and monitor Breaking Change: Retrieve beacon name for and monitor Oct 8, 2022
@dshokouhi dshokouhi changed the title Breaking Change: Retrieve beacon name for and monitor Breaking Change: Retrieve beacon name for beacon monitor sensor Oct 11, 2022
@dshokouhi
Copy link
Member Author

closing this PR as the approach is not right for this

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

Successfully merging this pull request may close these issues.

Beacon Transmitter / Monitor - Ability to advertise and get additional attributes such as the name
4 participants