Olen / homeassistant-plant

Alternative Plant component of home assistant
308 stars 23 forks source link

Reloading causes error of Plant Integration #141

Closed saschaludwig closed 5 months ago

saschaludwig commented 7 months ago

Just out of nowhere, the integration no longer shows the values of my plant sensor, even though I verified the involved entities in /root/config/.storage/core.config_entries and the plant integration config looks correct. All entities involved have current values and are beeing updated now and then. But the plant integration doesn't show them.

Upon reloading the Plant Integration via HA-UI, it throws the following error and the Plant Integration is broken.

Logger: custom_components.plant
Source: helpers/entity_platform.py:636
Integration: Plant monitor ([documentation](https://github.com/Olen/homeassistant-plant/), [issues](https://github.com/Olen/homeassistant-plant/issues))
First occurred: 23:34:18 (2 occurrences)
Last logged: 23:34:21

Platform plant does not generate unique IDs. ID ca90fec8f054aec2bffc843c6888bd92 is already used by plant.gerandeter_drachenbaum - ignoring plant.gerandeter_drachenbaum
Platform plant does not generate unique IDs. ID 390acadb407d555b1b1d5215ab35c382 is already used by plant.bogenhanf - ignoring plant.bogenhanf

Here is a screenshot of the integration just after I tried to reload the two plants: Bildschirmfoto 2024-02-19 um 23 43 05

How can I fix that?

saschaludwig commented 7 months ago

Looks like this project is dead. :-(

Olen commented 7 months ago

The project is not dead just because YOU have had some kind of issue for a week.

Try to remove your plants and add them again after restarting HA.

Sometimes things break internally in HA, and the only way to fix them is to set them up again from scratch.

Reloading this integration will not do anything.

saschaludwig commented 7 months ago

The project is not dead just because YOU have had some kind of issue for a week.

No need to get personal here. Please stop that attitude! Now I feel like I wasted your time. Open PRs for over 3 months, bugs open for over 1 year, and no reaction to my issue did look like a dead project to me.

Reloading this integration will not do anything.

So this isn't a bug/issue that I can't reload the integration? And the fact that unique IDs aren't generated is also not a bug?

For now, the integration is in a broken state for me and I can't use it any more. Really sad, because I really liked what you created. Could you please clarify if you are going to fix the above issues?

Thank you, Sascha

Olen commented 7 months ago

The last release was on Feb. 3, just a few weeks ago, and several commits have been made after that as well.

The Open PR is just a bump of a github-ci-script (which even had some issues, which is why I have not merged it) The old Issues are not really bugs, but more akin to feature requests or functional discussion that have not been concluded.

My suggestion - as mentioned in my previous comment - is for you to remove the plants, restart HA, and add them again.

And no, it's not a bug that reloading the integration does not "work". This is not a "normal" integration. Normally, reloading an integration will reconnect to external services, flush caches, refresh security tokens etc. This integration does not need any of that. All it does is to clone data from a set of existing sensors and present them as a device, and trigger some alerts if the sensor values exceed certain limits.

So a "reload" does not really mean anything to this integration. There are no external services to connect to, no services or processes that can hang or crash, no caches to empty, no usernames, passwords or tokens to refresh...

It generates unique IDs - but it does not generate NEW unique IDs for the already existing plants. That would make the whole concept on the unique IDs useless. The same plant gets the same unique ID every time. If it did not, all your customizations and stuff would break every time a plant is updated.

So the only "bug" here is that it should maybe check if the entity already exists before trying to create it again.
It would remove the warnings about unique IDs, but would still not do anything on a reload.

So the problem you are facing has nothing to do with the warnings about unique IDs.

jonnybergdahl commented 6 months ago

I would suggest you close this issue. :-)