ESPHome Device keeps getting "discovered"

I have an ESPHome Device that keeps getting “discovered”. But the device is configured and shows in ESPHome Devices. I can ignore it, but a short time later, it’s back.

Any ideas what’s wrong?

I occasionally get duplicated devices in integrations after updates.

I have to delete the ESPHome device in Integrations, then let it be discovered (or add it manually). If you have deleted the original device completely the new one will have the same entity names.

try the following:

open the ESPHome web-UI where you can edit your devices.
delete the device (the yaml file will be moved to the trash folder).
then go to the ESPHome integration and delete the same device via the 3 dots.
then go to your add-ons and choose ESPHome, restart the add-on.
restart or plug your device in, it should be rediscovered.
copy the file in the trash folder back to the main esphome folder, or create a new device with the same yaml code.
from now on it shouldn’t be rediscovered again.

Actually, the addon has nothing to do with the integration; it doesn’t even has to run (or be on the same machime). The addon is only used to compile the binary files and flash the esp. After that it is of no functional use to HA in any way.

Deleting the esphome device might do the trick though?
Question, do you use a fixed IP or DHCP reservations?

I’m not so sure, I had the same issue about 1h ago, and tried all sorts to resolve it, but the only thing that worked was deleting the device in both places and restarting the add-on.
after searching online it seems restarting the add-on was/is the solution for many.
anyways, it won’t hurt trying :slightly_smiling_face:

I am….

I used to compile the bins on my windows machine using python command line to compile and flash my esp’s and let HA discover them…
So i didn’t have the esphome addon installed at all :grin:

cd c:\workshop\esphome

pip install esphome
pip install esphomeflasher
pip install --upgrade git+ https://github.com/esphome/esphome

esphome myespdevice.yaml wizard
esphome myespdevice.yaml compile

esphomeflasher

using the compiled C:\_workshop\esphome\myespdevice\.pioenvs\myespdevice\firmware.bin

But why don’t you just try… stop the addon (and don’t let it start during boot) and restart HA… you won’t notice the difference :wink:

I do believe you.
I’m not an expert, but just sharing my findings and what worked for me.

highly doubtful…as i mentioned you don’t even need the addon to use esphome devices :thinking:

I found some of it here:

We are not talking about devices being re-discovered after re-compiling…or are we??

But one of the solutions of your link might be interesting…dashboard-import
Which happens to be @stevemann own question from 2 years ago…

If the source code of that import changes, fair change it affects the modules online behavior.
This is because with every compile it will download the latest source code and insert it in the yaml…:thinking:
And it appears to be a complete set of yaml, not much left to do yourself there

To prevent that from happening, just copy the code from the external code, and paste it into your own yaml (and skip the external import)

(which i recommend anyway, so you know what’s in your yaml and never face (nasty?) surprises from 3rd parties :thinking:)

I had done all this, and… See below.

No. I did recompile the device YAML, then discovery found it. I clicked on “Configure” and. Ten minutes or so later, it was discovered again. Yet the device was present in my ESPHome integration. I clicked “Ignore” and, a few minutes later, the cat came back.

My “fix” was to again delete the device and create a new device with a new name.

Are you still importing the yaml?

package_import_url:

Because your yaml could be completely changed without you even realizing it (which might explain the re-discovery :wink:)

(PS, no need the delete it in the addon, deletion from the integration suffices :wink:)

I don’t use package_import. I just recompiled in the add-on to a binary file then used the device web page to do an OTA update.