home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.81k forks source link

OSRAM Plug : Entity Not available (HUE Integration) #62530

Closed jlpouffier closed 2 years ago

jlpouffier commented 2 years ago

The problem

Similar to #61596 ...

It was fixed on core-2021.12.1 with #61603 but now it's failing again with my OSRAM Plug.

ORSAM plugs are available on my Hue app, they appear not available on Home Assistant. Restarting HA (nor my Hue bridge) does not fix the issue

Nothing on the home assistant logs related to Hue.

From what I understand, the fix done in #61603 :

if self.device.product_data.manufacturer_name != "Signify Netherlands B.V.":
    # availability status for non-philips brand lights is unreliable
    return True

seems to be much more "permissive" than the new code that is currently present in core-2021.12.4 (The whole _check_availability_workaround() method)

What version of Home Assistant Core has the issue?

core-2021.12.4

What was the last working version of Home Assistant Core?

core-2021.11.*

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Philips Hue

Link to integration documentation on our website

https://www.home-assistant.io/integrations/hue/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

hue documentation hue source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @balloob, @marcelveldt, mind taking a look at this issue as it has been labeled with an integration (hue) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

marcelveldt commented 2 years ago

If you open the Official Hue app, does it show "unavailable" below on the light ? Osram lights/plugs on the Hue mesh are known to cause trouble, they do not route properly, causing all kinds of issues. So basically you can use them but they do not route correctly. This is why they're reported as unavailable.

If you turn on the light once (while its unavailable) it will be back online, the availability will be ignored from that point on and a big fat warning printed in your log that you actually have an issue you're ignoring ;-)

I think we should leave the availability logic as-is for a while and report some device types that are known to have the bug (that's why we print the device name/type in the log when it happens). At some point we can create a static list of "misbehaving" lights in the code.

For now, just setup an automation that toggles those funky lights/plugs on/off at startup and you're all set. Just as an FYI: In my opinion you should remove the flaky plug or try to update it with an official Osram bridge, maybe that helps.

jlpouffier commented 2 years ago

Thx @marcelveldt for your prompt answer!

I read the code before and understood that workaround

# the device state changed from on->off or off->on
# while it was reported as not connected!

However, it does not seem to work for me : Here is a video of me turning on and off the faulty lights on My Philips app and nothing happens on Home Assistant...

https://user-images.githubusercontent.com/5878296/147002543-ef8fb8ac-ebf6-4b8b-a0c6-0b1e59673459.mp4

Did I miss something ? (I feel stupid 😊)

jlpouffier commented 2 years ago

Got it working... After many many restart of home assistant.

2021-12-21 23:13:46 WARNING (MainThread) [homeassistant.components.hue.bridge.light] Light Chambre Guirlande changed state while reported as disconnected. This is an indicator that routing is not working properly for this device. Home Assistant will ignore availability for this light from now on. Device details: OSRAM - On/Off plug (Plug 01) fw: 0.0.0
2021-12-21 23:14:42 WARNING (MainThread) [homeassistant.components.hue.bridge.light] Light Guinguette changed state while reported as disconnected. This is an indicator that routing is not working properly for this device. Home Assistant will ignore availability for this light from now on. Device details: OSRAM - On/Off plug (Plug 01) fw: 0.0.0
2021-12-21 23:14:49 WARNING (MainThread) [homeassistant.components.hue.bridge.light] Light Google Home changed state while reported as disconnected. This is an indicator that routing is not working properly for this device. Home Assistant will ignore availability for this light from now on. Device details: OSRAM - On/Off plug (Plug 01) fw: 0.0.0

I still feel bad for this update... OSRAM will never fix this issue and these switches will have to be thrown away... I have them since 5 years, and they were all working fine :(

I'll buy some new ones I guess... But this does not feel right

marcelveldt commented 2 years ago

You don't have to throw them away but you must be aware that your mesh is not stable as it should be, that's it. If it doesn't matter to you, just setup an automation that toggles the lights at startup. At some point we're going to store the "blacklisted" devices so it will remember over restarts.

I had some Osram lights in my setup too and caused all kinds of issues with other lights due to the routing issue. Ditched them from the Hue setup and all rock stable now. I think the Osram stuff works best when connected to their own bridge/hub. I think the same applies the other way around: Connect Philips lights to an Osram bridge and you'll probably have related issues.

jlpouffier commented 2 years ago

I understand why it's moving that way. Honestly :D

I just can't stop thinking that I bought these plugs a long time ago, without even using Home Assistant. But now that Home Assistant became such a big part of my home, the migration from the Hue APIv1 to Heu APIv2 will force me to buy "something": Either new plugs, or a new hub.

But anyway: This is not the place to discuss that. Issue closed.

flfue commented 2 years ago

I'm facing the same issues with the new version in core-2021.12.4. Additionally I think the check in https://github.com/home-assistant/core/blob/5e25df91b232798cb43a08cc9baa27edfa0b286e/homeassistant/components/hue/v2/entity.py#L140 causes other devices like the OSRAM Plug not to work even when switched manually.

One problem is that HA doesn't allow me to change unavailable devices. The only workaround seem to be to switch the actual state in the Hue App (which I usually do no use at all, why should I, HA is way better 😀). But even if I could switch it from HA, I would have to do this after every restart and there are some devices connected to power plugs I don't want to switch. For the time being I downgraded the integration to version core-2021.12.3 which works perfectly fine for me.

@marcelveldt, what would be your opinion on having the option to define a static blacklist in the config?