I am helping on the development of a custom integration. One thing that has been bothering me for a while is that I get an error Entity id already exists every time I reboot HA.
I believe it is caused by the following “for” loop:
for d in hilo.devices.all:
LOG.debug(f"Adding device {d}")
new_entities.extend(generate_entities_from_device(d, hilo, scan_interval))
if d.has_attribute("power"):
# If we opt out the geneneration of meters we just create the power sensors
if generate_energy_meters:
create_energy_entity(d)
I looked at the documentation but unless I looked wrong I was not able to locate a way to check if an entity already exists before creating it.
I’m not too sure how to check the entity registry and run the for loop against it.
Im not sure being able to check the entity exists before creating it is your issue here. It maybe that you are trying to create the same entity more than once, in which case, you need to look at this. If you want to post a link to your full code, happy to have a look for you and give some pointers.