GladysAssistant / Gladys

A privacy-first, open-source home assistant
https://gladysassistant.com
Apache License 2.0
2.58k stars 278 forks source link

[philips-hue] Newly bridge paired lamp cannot be used in Gladys #1006

Closed VonOx closed 2 years ago

VonOx commented 3 years ago

This is a first analyse.

On existing hue / Gladys installation, if I add new lamp in hue bridge and in Gladys, I can't use them before restart.

https://community.gladysassistant.com/t/probleme-avec-hue-et-lumiere-bloom

Pierre-Gilles commented 3 years ago

@VonOx So the fix is upgrading the philips hue node library?

VonOx commented 3 years ago

Nope, just restarting container

Pierre-Gilles commented 3 years ago

I don't understand, what was the bug then? Restarting a container is not a solution ^^

It should work all the time, no restart needed

VonOx commented 3 years ago

I agree, that's why I opened issue

VonOx commented 3 years ago

Opened an issue on lib repo

https://github.com/peter-murray/node-hue-api/issues/197

VonOx commented 2 years ago

https://github.com/peter-murray/node-hue-api/blob/4.x/lib/api/Api.js#L154

@Pierre-Gilles in that case we can call resynch function.

As lib maintainer says to me, it's an heavy call so what's the plan here ?

Pierre-Gilles commented 2 years ago

If the error easy to identify ? If yes, on error why not, but the problem is that we really don't want to trigger this multiple time in a row as it's an heavy call!

Or maybe, when adding a new lamp, could we know if the problem is here?

VonOx commented 2 years ago

Yep error is pretty clear in this issue

ApiError: Light with id:12 was not found on this bridge

But i did'nt know how to catch them.

Error is triggered when contrlling the device not when adding them to Gladys

Pierre-Gilles commented 2 years ago

ApiError: Light with id:12 was not found on this bridge

Yes, but this error could also be "normal", for example if the user added a lamp in Gladys, then remove the lamp from Philips Hue. In that case, we will be retrying many time and it won't solve the issue.

Maybe the best would be to do a combo:

What do you think of that ?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

VonOx commented 2 years ago

Not stale

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Pierre-Gilles commented 2 years ago

Not stale

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.