you really should give Splitting up the configuration - Home Assistant some reading time. Your problem has nothing to so with this specific Sun component, but with your misunderstanding of the ways HA allows you to split up your configuration files
You cant just mix it like you do, and you need to follow the instructions in this link.
Well, that’s interesting. Must be a timing thing. Do you happen to have debug set for homeassistant.core? If not, could you? (I know that would probably create a LOT more messages on your system.) If you could, then could you capture these sun2 messages as well as the homeassistant_started event and any core_config_updated events? I’d be curious to know their order (and relative timing) on your system.
FWIW, there just may not be a good way to deal with this if the system is going to generate multiple core_config_updated events even when the config really isn’t changing.
NOTE: A failure scenario has been experienced with the sun_phase sensor. I’m sure it affects the deconz_daylight sensor as well. See Issue #68 for more details.
This sensor does a batch of calculations basically twice a day (at solar midnight & solar noon.) Those calculations determine when it should update (and what the new states should be) until it does the next batch of calculations. Depending on your location and time of year, it’s possible for those calculations to fail, resulting in error messages & no updates until the next batch of calculations.
I’ve released a fix as version 2.1.3b0. If anyone has experienced this issue, please try the beta version and let me know if that fixes the problem for you.
I tried to install the integration via HACS by adding the custom repository as described. It’s then listed as imported repo, but even after a HA restart there’s no new “sun2” integration available to add in HA.
Unfortunately, also the logs didn’t output any error related to this. Was anyone successful with a HACS installation and can maybe help?
So maybe I misunderstood your question in the issue you created. When you say you searched for the integration but couldn’t find it, did you mean you searched in HACS (after adding the repo) and couldn’t find it to install it in HA? Or did you mean you were able to successfully install it in HA via HACS, but then you couldn’t find it on HA’s Integrations page?
I assumed you meant the former.
If you meant the latter, then @finity is correct, it doesn’t support configuration via HA’s Integrations page, only via YAML. Please see the doc page for details.
I’ve had some requests to implement unique IDs so that the entities can be reconfigured via the Entities page. I started a PR with a quick, simple mod to test out the idea. It seems to work. If anyone wants to give it a try via the PR/branch, I’d love feedback.
Also, this integration is getting pretty old and is in need of some serious updating. I plan (hope) to spend some time doing just that, too, as part of this PR. And I’ll probably release an “official” (HACS compliant) beta at some point.
The last commit to the PR branch has updated the integration as of HA 2021.12 (which, don’t tell anyone, is the version I’m using in my “production” system. ) I plan, for now, to support HA versions 2021.12 or newer (with most, if not all, of my custom integrations.)
I suppose I should cut an “official” beta release.
Next, I’ll update per HA’s dev branch, to take advantage of newer HA features, while maintaining compatibility with 2021.12 or newer.
I just meant I updated the integration to take advantage of new features and code structure in the HA code base since the 2021.12 release. It’s mostly just implementation details, but the new features you might notice are:
“Period of time” sensors will have a device_class of duration for HA versions 2022.5 or newer.
Phase sensors (i.e., deconz_daylight & sun_phase) will have a device_class of enum, and a corresponding options attribute, for HA versions 2023.1 or newer.
EDIT:
I might also add, the state of “point in time” sensors used to be given in the configured time zone, but now the core code base makes all entities with a device_class of timestamp (which these are) show their value in UTC. However, the today attribute will still be in the configured time zone (and, as before, is a Python datetime as opposed to the state, which is always a string.)
That’s not an error, it is an informational message. That’s how the system works when an integration does not support “configuration flow”, which this one does not.