jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
189 stars 46 forks source link

Many broken entities under HA Core 2024.3 #264

Closed mwhdc closed 4 months ago

mwhdc commented 4 months ago

First noticed this behavior with Core 2024.3.0b0 and waited until imminent 2024.3.0 release to make sure there wasn't a known regression in Core. Normal operation under 2024.2.5, including after reverting.

Issue: Lights and switches that are rendered in the UI as toggles through 2024.2.5 appear as off/on lightning bolts in 2024.3.0b0 and later. Sensors are not populated with values or attributes. Other domains may also be affected. (Entities not provided by the Hubitat integration continue to function normally.)

Environment: Hubitat is C7 hardware running 2.3.8.122. HA is managed OS in Proxmox on Intel NUC. Latest Hubitat integration from HACS.

Debug snippets:

2024-03-06 15:02:11.999 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Loading device 26
2024-03-06 15:02:12.118 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Loaded device 26
...
2024-03-06 15:02:14.442 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Connected to Hubitat hub at 10.0.0.204
2024-03-06 15:02:14.547 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Loaded modes
2024-03-06 15:02:14.577 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Loaded hsm status
2024-03-06 15:02:14.577 DEBUG (MainThread) [custom_components.hubitat.hub] Registered platforms
2024-03-06 15:02:14.578 INFO (MainThread) [custom_components.hubitat] Hubitat is ready
...
2024-03-06 15:02:14.670 DEBUG (MainThread) [custom_components.hubitat.entities] Added HubitatLight entities: [<entity light.foyer=off>, <entity light.dining_room=off>, <entity light.study=off> ... ]
2024-03-06 15:02:14.670 DEBUG (MainThread) [custom_components.hubitat.entities] Removing overridden light entities...
...
2024-03-06 15:02:14.690 DEBUG (MainThread) [custom_components.hubitat.entities] Added HubitatUpdateSensor entities: [<entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>, <entity unknown.unknown=unknown>]
2024-03-06 15:02:14.690 DEBUG (MainThread) [custom_components.hubitat.entities] Removing overridden sensor entities...
...
2024-03-06 15:02:14.746 DEBUG (MainThread) [custom_components.hubitat.sensor] Adding unknown entity for 14:current
2024-03-06 15:02:14.746 DEBUG (MainThread) [custom_components.hubitat.sensor] Adding unknown entity for 14:frequency
2024-03-06 15:02:14.746 DEBUG (MainThread) [custom_components.hubitat.sensor] Adding unknown entity for 14:switch
2024-03-06 15:02:14.746 DEBUG (MainThread) [custom_components.hubitat.sensor] Adding unknown entity for 15:current
2024-03-06 15:02:14.746 DEBUG (MainThread) [custom_components.hubitat.sensor] Adding unknown entity for 15:frequency
2024-03-06 15:02:14.746 DEBUG (MainThread) [custom_components.hubitat.sensor] Adding unknown entity for 15:switch
...
brpeterso commented 4 months ago

I just upgraded to 2024.3 and I'm seeing the same problem noted above.

chris4851 commented 4 months ago

same issue here when upgrading to 2024.3

monkmad commented 4 months ago

I've observed the same issue since upgrading to 2024.3 a couple hours ago. However, IMHO the logs shared above by @mwhdc might not be related to the root cause. This is because I saw these log messages on 2024.2.5 yesterday as well, as documented in this post, when these broken entity issues were not present. However, it is possible that something in the new HA release combined with an existing issue in the integration to cause this.

mwhdc commented 4 months ago

I've observed the same issue since upgrading to 2024.3 a couple hours ago. However, IMHO the logs shared above by @mwhdc might not be related to the root cause. This is because I saw these log messages on 2024.2.5 yesterday as well, as documented in this post, when these broken entity issues were not present. However, it is possible that something in the new HA release combined with an existing issue in the integration to cause this.

Interesting, I don't usually run loglevel debug on the Hubitat components so I wouldn't have seen those errors under 2024.2. I didn't see any other red flags in the 2024.3 log but I would be happy to send the whole thing to anyone working on a fix. I just posted an excerpt above for brevity and privacy.

jason0x43 commented 4 months ago

The messages in the original issue are normal (although they'll be improved in the next release). All the <entity unknown.unknown=unknown>s are happening because the log messages were being emitted before the entities were fully initialized. The "Adding unknown entity for x" messages are fine, but were just poor wording on my part. A better string would have been "Adding generic sensor for x" (which is what's actually happening there).

I'm seeing two issues at the moment:

  1. Most entities aren't loading their state at startup, so they have no state until some update is received from Hubitat. They still work, but they look broken after a restart.
  2. Cover and climate (thermostat) entities have errors during initialization and simply don't work.

Working on it 😄

jason0x43 commented 4 months ago

This should be fixed in v0.9.24.

chris4851 commented 4 months ago

This should be fixed in v0.9.24.

As always, thank you for the quick fix. Your amazing

monkmad commented 4 months ago

Yes, thank you! The fix works. I did have to create template switches to replace the light --> switch functionality, but that's not a big deal. Appreciate the quick turn-around.

mwhdc commented 4 months ago

Looking good! Thanks for the insights and quick fixes. Will close this issue in the morning if there's no further activity.