jaalperin
(Jeff Alperin)
October 28, 2021, 8:48pm
1
Some time in the past I configured a nodemcu device by adding an ESPhome Integration. That was done by supplying an IP and a password. Voila! One device and a binary_sensor entity were added. Today I noticed that the binary_sensor was unavailable. I rummaged around and eventually looked at the ESPhome integrations. I found that the integration for the particular nodemcu now had multiple devices. I further found that other integrations also had multiple devices, and some included the nodemcu device in question. I cleaned up the integrations (deleted and recreated). Now the binary_sensor (and who knows what else) is again working. But, how does this come to pass (that ESPhome integrations acquire additional and conflicting devices over time)?
tom_l
October 28, 2021, 11:31pm
2
Usually that only happens when the device is removed but the entities arenât. Then when the device is added back the duplicate entities are created.
I have some ESPHome devices that are 2-3 years old. None have duplicate entity ids.
jaalperin
(Jeff Alperin)
October 29, 2021, 12:13am
3
Not talking about duplicate entities. Talking about additional devices showing up (including more entities) that donât belong in an integration.
Having the same issue.
Look at âwater softenerâ and it has multiple integrations.
When I click on it, I get this:
Notice all the info on âDevice Infoâ
1 Like
miche000
(Miche000)
September 3, 2023, 7:47am
6
Hi, same problem here. Any reason/solution?
JulianDH
(Julian Hall)
September 3, 2023, 10:28am
7
Delete the specific integration ( and any duplicates) and reintegrate again
In the future it shouldnât be possible anymore to have one esphome integration with more than one device
home-assistant:dev
â home-assistant:esphome_wrong_device
opened 11:46PM - 21 Aug 23 UTC
## Breaking change
To prevent cross-linked devices, replacing a named ESPHome⌠device with a different board is no longer allowed. Instead, delete the config entry and re-added the new device when the Mac address of the board changes.
## 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.
-->
If the DHCP reservation changed and there is now a different ESPHome device at the saved IP address, abort the connection to avoid cross linking devices.
Note: this will not fix existing cross linked devices. It will only prevent the problem from happening again. Existing config entries with the issue will have to be removed manually and set up again.
This is a more general problem as #97457 (tplink) and #92955 (lifx) also have the same problem (shelly was just fixed in #98807). This solution is similar to the used in `flux_led` https://github.com/home-assistant/core/blob/3e7ec88703cf724ef29b00732b467704cf66c5e2/homeassistant/components/flux_led/__init__.py#L196
## 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
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] 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 #97913
- 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.
-->
- [x] 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]
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
- [ ] The code has been formatted using Black (`black --fast homeassistant tests`)
- [x] 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/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
1 Like