Patrick762 / hassio-bluetti-bt

Bluetti Integration for Home Assistant
MIT License
30 stars 9 forks source link

[Bug]: Still cannot rename entities #95

Closed TarheelGrad1998 closed 1 month ago

TarheelGrad1998 commented 2 months ago

What happened?

A continuation of https://github.com/Patrick762/hassio-bluetti-bt/issues/49, which was erroneously closed...

I upgraded to 0.0.22, which did fix the breaking change that blocked me in that original thread. Then I decided to go ahead with renaming all my entities. I assumed it was working, but now I see I have two of each entity again, the names I provided and a copy with "_2". My originally named entities are all unavailable. So the entity renaming is still not working for me.

image

Version

0.0.17

What device are you seeing the problem on?

EB3A

What bluetooth connection are you using?

ESPHome bluetooth proxy

Have you changed the integration settings?

Yes (Please write down the changed settings in the next step)

Integration settings (if you changed them)

Use Controls On
Persistent Connection Off
Polling interval 450
Polling timeout 10
Retries 5

Relevant log output

I did not check the log on the reboot where the duplicate entities, but this is after my last reboot:

2024-04-19 06:43:59.140 WARNING (MainThread) [custom_components.bluetti_bt] You are using controls with this integration at your own risk!
2024-04-19 06:43:59.191 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform bluetti_bt does not generate unique IDs. ID network_bluetti_ac_output already exists - ignoring binary_sensor.network_bluetti_ac_output_2
2024-04-19 06:43:59.192 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform bluetti_bt does not generate unique IDs. ID network_bluetti_dc_output already exists - ignoring binary_sensor.network_bluetti_dc_output_2
TarheelGrad1998 commented 2 months ago

I have a theory. I've noticed that usually upon restarting HA, all of the sensors are unavailable until the first refresh interval passes. My theory is, if I restart HA again before they have loaded for the first time, that might trigger creating the duplicate entities.

As a potential fix, I've created an automation to update the entities on HA startup. If my theory is correct, that could solve the issue.

TarheelGrad1998 commented 1 month ago

This has not recurred with the above fixes, and several updates and reboots. So I think it's fixed. Plus it was getting ignored anyway.