Closed bruvv closed 2 years ago
This generally happens when you flash multiple ESP devices with the exact same binary firmware file (so, that is already an issue on your network in that case)
This generally happens when you flash multiple ESP devices with the exact same binary firmware file (so, that is already an issue on your network in that case)
I did not. I use wireless flashing and the yaml file I use in esphome is included. I also removed the esphome configuration that gets discovered after a restart but to no avail.
🤷 Cannot make more of it. The device name determines the unique ID. The only way to create duplicates in ESPHome right now, is by flashing the same ESPHome name twice (and as they have to be unique within ESPHome itself, it would result in flashing the same firmware twice).
Any otherway I can debug this? Since I am 1000% sure that it is a different rom.
Any otherway I can debug this?
Check the names of the devices they expose e.g., ESPHome. They should differ.
@frenck you mean the device_name: home-assistant-glow
for example the is double? I copy pasted the current yaml files so that it's clear that there is no double entry
esphome documentation esphome source (message by IssueLinks)
Hey there @ottowinter, @jesserockz, mind taking a look at this issue as it has been labeled with an integration (esphome
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
I usually delete the devices and then readd them, nothing seems to be lost but clears these up. For me I've flashed something twice or similar. There's a YouTube video out there explaining why.
@callacomp mind sharing the video URL you're talking about? I've already tried readding them to home assistant but that didn't work.
There's this one to clean it up https://youtu.be/aI3Pndv2Oo0, this one to rename devices https://youtu.be/ekOOb8qAe7c. I'm sure there's one on deleting and reading devices but can't find it yet. But it's just that, delete the devices you think could be at fault, even stale or unused ones and add them back in.
@callacomp did not know esphome kept so much crap in storage, I removed the whole folder, restarted esphome and reinstered my yaml files. Now it seems gone! Thanks
And just updated to 2022.3.3
and the error came back...
Platform esphome does not generate unique IDs. ID 8caab5c0c1e2-wifisignal already exists - ignoring sensor.house_energy_meter_wifi_signal
Platform esphome does not generate unique IDs. ID 8caab5c07d6d-wifisignal already exists - ignoring sensor.co2meter_wifi_signal
But they're there:
@bruvv the only thing I can think of right now is that you renamed the wifi signal entity, which doesn't change its unique_id (this is a legacy bit of code for some sensors only) but it tries to create a new entity with that new entity_id but the existing unique_id.
@jesserockz but as can be seen in the screenshot and in the log they're unique and I did not change anything to the entity. (I have removed them and readded them but still the same error)
What I mean is did you use that same ESP chip and flash with a different yaml config (Or a differently named wifi signal) in the past? The unique id it is complaining about is {mac address}_wifi_signal
which is not affected by the name, but if you change the name it tries to create a new entity but with the same unique_id.
Its very confusing as these details are hidden in the layers the user does not see.
Ah that might explain it @jesserockz I did buy it second hand so it should have had another flash stuff on it and yes I think I've had other stuff on it too. How can I get rid of this message ?
After looking through the entity platform code, I believe the only way to get that message is if two entities with the same unique_id
are registered during a HA session. That means, it doesn't matter what friendly_name
it had, what device
/config_entry
it belonged to historically, only that not two entities with equal are async_add_entities()
'd.
You can test this with this config
sensor:
- platform: wifi_signal
name: Test32 Wifi Signal
and changing the sensor name to Test32 Wifi Signal 1
/ moving it to another ESP chip, all of those work fine (at least for me).
The real cause likely is one of these:
wifi_signal
entries are in your configNote: These are dependent on the unique ID being based on the mac address of the ESP. For entities with the default unique ID generation, I think this issue should be resolved with fw 2021.11+ and https://github.com/home-assistant/core/pull/64559.
Thanks for the explenation @OttoWinter ! What I did is as follows: These are the only entities that I have. I removed them both like so: Restarted home assistant In esphome addon (from this url: https://github.com/esphome/esphome) I am running: ESPHome Current version: 2022.2.6 I have both the entites here that are online (the yaml is in the first post) I just reflashed them using the wireless function. Logs: logs_home-assistant-glow_upload.txt After another reboot of home assistant it starts with a new notification: I click submit: And finished: After another reboot, in the logs I can see:
Platform esphome does not generate unique IDs. ID 8caab5c07d6d-wifisignal already exists - ignoring sensor.co2meter_wifi_signal
Platform esphome does not generate unique IDs. ID 8caab5c0c1e2-wifisignal already exists - ignoring sensor.house_energy_meter_wifi_signal
Can it be that my average wifi signal is not working?
sensor:
- platform: wifi_signal
name: "${friendly_name} WiFi Signal"
update_interval: 30s
id: "${device_name}_wifi_signal"
- platform: wifi_signal
name: "${friendly_name} WiFi Signal Gemiddelde"
update_interval: 30s
filters:
- exponential_moving_average:
alpha: 0.003 # We want ~6 hour averaging, at 10s update, that's 6*3600/10 = 2160 points, thus alpha should be 2/2160 ~ 0.001
send_every: 1
id: "${device_name}_wifi_signal_gem"
That is what I have. It uses different names and uses different ID's too.
Can it be that my avareage signal wifi is not working?
Yes, that's it ("Two or more wifi_signal entries are in your config"). You can only have one of wifi_signal
entry in your config at the moment
It uses different names and uses different ID's too.
Yes, for most sensors that would work. But wifi_signal
sets the unique_id
(different thing from id
) itself to the mac address of the ESP chip -wifisignal
. The user can't change the unique_id
.
Tbh, it's too easy to get this wrong for the user, so we should either implement some incremeting counter like _2
or IMO better, just remove the unique_id here. Then you can't even get this issue with situation 3 in my previous post).
I had no idea that it was also when you do different ids+names. I removed them and so far so. Will wait 24 hours to see if they come back otherwise close this issue. Thanks @OttoWinter !
Now I understand that unique_id
is not the same as a unique id
! Perhaps this 'entity' can be added in the docs to have some explanation about it?
This could be a use for the new copy
platform =)
https://esphome.io/components/copy.html#copy-sensor
@OttoWinter I think either we need to limit the use of platforms that have the unique_id override like this one, or remove the unique_id override and let it use the default like all other sensors.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
I see the following in my logs:
But as can be seen from the log the id is unique... Help? I have had this issue since 2022.1.0 when I started using esphome.
What version of Home Assistant Core has the issue?
2022.3.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ESPHOME
Link to integration documentation on our website
https://esphome.io/
Diagnostics information
No response
Example YAML snippet
co2.yaml
and homeassistant glow