techman25
(Mark Smith)
January 5, 2023, 10:36pm
1
Since updating to HA 2023.1 my NRF52810 iBeacon reports the source as a MAC address not the source name. It was working in previous versions. Is this a known problem? Not sure where to report it.
1 Like
I just noticed this as well and did a bit of digging and found a couple of github issues related to it.
opened 10:54AM - 06 Jan 23 UTC
integration: esphome
### The problem
I'm using the iBeacon integration with my Android phone as an i… Beacon and ESP32 BLE proxies in each room. Until recent the iBeacon source attribute represented the name of my ESP device, for instance kitchen-esp32 or livingroom-esp32. But now the iBeacon source attribute represents the MAC address of my ESP device.
Also, is there a convention that the mac address should be upper or lower case? As the ESPs give their mac address in lowercase and my Raspberry Pi in upper case
### What version of Home Assistant Core has the issue?
2023.1.0 & 2023.1.2
### What was the last working version of Home Assistant Core?
2022.12.x
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
ESPHome
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/esphome/
### Diagnostics information
_No response_
### Example YAML snippet
_No response_
### Anything in the logs that might be useful for us?
_No response_
### Additional information
https://github.com/home-assistant/core/pull/83741
home-assistant:dev
← home-assistant:esphome-unique-id
opened 02:24AM - 11 Dec 22 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Breaking change
<!--
If your PR contains a breaking change for existing users, it is important
to tell them what breaks, how to make it work again and why we did this.
This piece of text is published with the release notes, so it helps if you
write it towards our users, not us.
Note: Remove this section if this PR is NOT a breaking change.
-->
Technically not a breaking change but I am going to mention it anyway, just in case:
It's no longer possible to take a device down, reflash the config to a new device, and have the new device "become" the old device inside HA.
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
Use the MAC address of the board running ESPHome as the unique ID of the config entry.
Previously it used the configuration name which is a user provided name. This is against the rules of Home Assistant. It's also causing havoc when a user renames an ESPHome device.
Existing config entries are automatically migrated the first time they are set up.
Basing unique ID on MAC simplifies the config flow code. There was a bunch of logic matching on hostname and config names to update config entries. This is now all reduced to using the built-in unique ID matching.
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [x] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [ ] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] The code has been formatted using Black (`black --fast homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [ ] Untested files have been added to `.coveragerc`.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[manifest-docs]: https://developers.home-assistant.io/docs/en/creating_integration_manifest.html
[quality-scale]: https://developers.home-assistant.io/docs/en/next/integration_quality_scale_index.html
[docs-repository]: https://github.com/home-assistant/home-assistant.io
rsampayo
(Ramon)
January 11, 2023, 1:53am
3
Same here, I put Ibecons on my keys and used the source to find the room they were in. Now its giving me the MAC address which makes it harder for me to know which proxy its close to.
teskanoo
(Teska Noo)
January 15, 2023, 7:22am
4
Yeah - messed up my room presence tracking - the MAC Addresses mean nothing to me visually at all
Will I be forced to create template sensors and create and retain mappings to accommodate this ‘feature’?
Hi…anyone have a solution for this? I tried to adapt my template sensors and replaced the esp-hostnames to match the mac adresses, but i can´t get this template sensor to work:
bt_state_pixel_6:
friendly_name: "Bluetooth Location Pixel 6"
value_template: >-
{% if is_state_attr('device_tracker.bt_pixel_6', 'Source', '78:21:84:9d:d0:78') %}
Obergeschoss
{% elif is_state_attr('device_tracker.bt_pixel_6', 'Source', '78:21:84:9d:e2:18') %}
Wohnzimmer
{% elif is_state_attr('device_tracker.bt_pixel_6', 'Source', 'ec:62:60:9c:af:cc') %}
Keller
{% elif is_state_attr('device_tracker.bt_pixel_6', 'Source', '00:1A:7D:DA:71:10') %}
Eingang
{% else %}
N/A
{% endif %}
No matter where the ibeacon is connected to, I always get “N/A”, even though i see the right MAC Adress in the ibeacons attribute:
techman25
(Mark Smith)
April 30, 2023, 4:18pm
6
Hi - here’s the solution that worked for me
##### Convert tracker MAC address to name tracker 1
- platform: template
sensors:
tracker1_sourcename:
unique_id: 954cae86-32e0-4152-bb5c-f0af3b8dd50c
friendly_name: "Tracker1 source name"
value_template: >-
{% set sourcemac = state_attr('device_tracker.holy_iot_c00a','source') %}
{% if sourcemac == "30:c6:f7:2a:2f:04" |lower %}
Office
{% elif sourcemac == "30:C6:F7:2A:59:9C" |lower %}
Kitchen
{% elif sourcemac == "C8:C9:A3:C9:D7:F4" |lower %}
Study
{% elif sourcemac == "30:C6:F7:28:F1:5C" |lower %}
Lounge
{% else %}
Unknown location
{% endif %}
The “LOWER” statement forces the MAC address to lowercase as the ESP32 is inconsistent in how it reports the address. The one thing I want to add is a condition for distance to ensure that the iBeacon really is in the room reported by the template.
Mark.
Thank you Mark, this works perfectly
i just don´t get it…it works for 3 of 4 BT Proxies. I don´t know where my mistake is.
See the attribute of my smartphone:
And now see the template output:
Why the heck is he showing “N/A” while the correct MAC is one line above?
mmiller7
(Matt Miller)
December 27, 2023, 3:28am
9
This seems like such a silly thing…is there no better way?
So every time you decide to add an additional tracker (or replace one if it dies)…you have to go manually edit ALL the templates for every item you want to track?