bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
896 stars 250 forks source link

All Devices off, Powercalc not loading at starting HA, also not with the newest Update #2317

Closed Frankymuc closed 4 days ago

Frankymuc commented 1 week ago

System Health details

All Devices off, Powercalc not loading at starting HA, also not withe the newest Update. Any weeks only its works withour problems. since 3 days, i think, no connecting. have wait of update its was coming 30minutes before my message i written here. but the same, all dead, no conecting during HA starts. (lok picture) my system is absolutly of the newes level..HA OS 12.4 Core 2024.6, supervisor also, Linux MX newest updates, Kernel to with 6.9.5 ahs liq. Virtualbox Oracle, 1 TB free for root/home/swap etc 3TB reserve. powerdeskalldead

Checklist

Describe the issue

its offline

Reproduction steps

1.start HA 2. 3. ...

Debug logs

https://homeassistant-powercalc.readthedocs.io/en/latest/troubleshooting/debug-logging.html

Diagnostics dump or YAML config

No response

MrBlaschke commented 1 week ago

I have the same issue - everything is the latest. Tried many restores from older backups yesterday - no change. That is somewhat strange because it worked before. Can not say explicitly which build caused this - its annoying atm.

Every system boot it takes around 3 minutes trying to start Powercalc until HomeAssistant decides to no longer wait for the component. It never comes back.

bramstroker commented 1 week ago

Oh that's strange. Thanks for reporting. Anything in the logs?

scoma24 commented 1 week ago

I have the same problem. Made all updates. I have also reloaded the repsoitory, including other versions. I have debugging mode on. Via settings system logs there is only the note that setup takes longer than 300 seconds. also the following: Waiting on integrations to complete setup: {('powercalc', None): 63130.183114957} I can see the start in the log: 2024-06-24 11:03:31.425 DEBUG (MainThread) [custom_components.powercalc.power_profile.loader.remote] Downloading profile: nous/A1Z from github 2024-06-24 11:03:31.770 ERROR (MainThread) [homeassistant.setup] Setup of 'powercalc' is taking longer than 300 seconds. Startup will proceed without waiting any longer 2024-06-24 11:03:31.839 WARNING (MainThread) [homeassistant.components.group.sensor] Unable to use state. Only numerical states are supported, entity sensor.silberstab_energy with value unavailable excluded from calculation in sensor.sensorgruppe_govee_stabe 2024-06-24 11:03:31.841 WARNING (MainThread) [homeassistant.components.group.sensor] Unable to use state. Only numerical states are supported, entity sensor.stablampe_energy with value unavailable excluded from calculation in sensor.sensorgruppe_govee_stabe 2024-06-24 11:03:32.258 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 630: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues Runs Auto discovery for all entities 2024-06-24 10:58:31.867 DEBUG (MainThread) [custom_components.powercalc.discovery] Start auto discovering entities 2024-06-24 10:58:31.867 DEBUG (MainThread) [custom_components.powercalc.discovery] update.home_assistant_supervisor_update: Auto discovered model (manufacturer=Home Assistant, model=Home Assistant Supervisor) 2024-06-24 10:58:31.880 DEBUG (MainThread) [custom_components.powercalc.power_profile.loader.remote] Loading library.json from github

MrBlaschke commented 1 week ago

Nothing special in Logs on my end also. Basically the same as @scoma24 mentioned.

Logger: homeassistant.bootstrap
Quelle: bootstrap.py:726
Erstmals aufgetreten: 23. Juni 2024 um 15:16:48 (5 Vorkommnisse)
Zuletzt protokolliert: 23. Juni 2024 um 15:20:48

Waiting on integrations to complete setup: {('powercalc', None): 74.282469395}

---- and this one ---

Logger: homeassistant.setup
Quelle: setup.py:404
Erstmals aufgetreten: 23. Juni 2024 um 15:20:57 (1 Vorkommnisse)
Zuletzt protokolliert: 23. Juni 2024 um 15:20:57

Setup of 'powercalc' is taking longer than 300 seconds. Startup will proceed without waiting any longer

For the moment i disabled autodiscovery in the configuration - makes no change.

bramstroker commented 1 week ago

Could any of you please downgrade to v1.12.11 and see if that resolves the issue? I'm suspecting this change might be the cause of issue: https://github.com/bramstroker/homeassistant-powercalc/pull/2313

scoma24 commented 1 week ago

I had already tried this, and now I have just tried it again. Problem remains.

bramstroker commented 1 week ago

@scoma24 Could you double check you are actually downgraded correctly by inspecting contents of file config/custom_components/powercalc/power_profile/loader/remote.py?

You shouldn't find _download_remote_library_json there. When it is still there you are still in v1.12.12 code.

scoma24 commented 1 week ago

I searched for "_download_remote_library_json" in the file "config/custom_components/powercalc/power_profile/loader/remote.py" and did not find it.

scoma24 commented 1 week ago
Bildschirmfoto 2024-06-24 um 13 16 46
bramstroker commented 1 week ago

hmm ok, I see. You did restart after downgrading, right? I'll try to reproduce when I'm home from work tonight.

scoma24 commented 1 week ago

Yes, I have restarted. Shouldn't I have done that?

All right, thank you very much.

MrBlaschke commented 1 week ago

I went back, stepwise, to the latest available release via the dropdown in the component - i think it was 1.12.8 or 1.12.9. Never got it to work again, although it worked before. Always the same behavior with the 300 seconds timeout and non functioning entities for Powercalc. Every downgrade was followed by a system restart - cold boot.

bramstroker commented 1 week ago

I'm sorry to hear some of you guys have problems. When I came home I directly checked if it's reproducable for me in any way. For me on my test env it also takes longer to start Powercalc, and I see it's downloading the profiles on each restart again and again. It only should do that once and only redownload the profiles when they are newer. I will further investigate.

bramstroker commented 1 week ago

I have found the issue. Last update time of the library was not correctly saved to HA anymore, which powercalc uses to determine if it should redownload profiles. Also there was some improvement in code formatting, which caused all the powercalc profiles JSON to be reformatted. Because of this change every profile was updated, causing powercalc to redownload each and every profile. When you have a lot of them this process can take longer than the threshold of HA causing powercalc to not startup at all.

Should hopefully be fixed with #2320 which I will release asap.

bramstroker commented 1 week ago

v1.12.13 released with the fix. Could you please let me know if this also resolves for you?

scoma24 commented 1 week ago

Powercal now started without an error message. The sensors are all back. Thank you very much.

Frankymuc commented 6 days ago

works after the .13 update....thx

MrBlaschke commented 6 days ago

Can confirm - starts up after the 13 update. Thank you!

bramstroker commented 4 days ago

Glad everything is working correctly again. Closing this issue. Thanks for reporting and testing.