Hello everyone!
I was browsing through the GitHub issues, have all these issues been fixed? Can I close this issue → [philips-hue] Newly bridge paired lamp cannot be used in Gladys · Issue #1006 · GladysAssistant/Gladys · GitHub ?
VonOx
May 7, 2021, 6:34am
22
I will test and see if it’s fixed
VonOx
May 7, 2021, 8:18am
23
It’s not fixed.
Just to remind the flow
Bridge configured in Gladys
Pairing a new lamp on the bridge
Adding the lamp in Gladys
=› Impossible to control the lamp
2021-05-07T10:12:53+0200 <debug> scene.executeSingleAction.js:15 (SceneManager.executeSingleAction) Executing action of type device.set-value
2021-05-07T10:12:53+0200 <debug> light.setValue.js:17 (PhilipsHueLightHandler.setValue) Changing state of light philips-hue-light:001788286ece:10 with value = 0
2021-05-07T10:12:53+0200 <warn> scene.executeActions.js:37 (executeAction) ApiError: Light with id:10 was not found on this bridge
at /home/vonox/repos/Gladys/server/services/philips-hue/node_modules/node-hue-api/lib/api/Lights.js:121:17
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async PhilipsHueLightHandler.setValue (/home/vonox/repos/Gladys/server/services/philips-hue/lib/light/light.setValue.js:38:3)
A restart of the Gladys server and the lamp is usable.
It smells like a bug in the Philips Hue node library, right?
I don’t have any more ideas on this, I checked the GitHub issues of the library but nothing on this subject.
VonOx
May 7, 2021, 9:23am
25
I’m going to create an issue on the library to get feedback
Other users will also need to try to reproduce it.
VonOx
May 11, 2021, 1:16pm
26
I received initial feedback from the library maintainer
This might be due to the light state not being present in the bridge cache… I cannot remember if this is still used in that version (as I have been migrating the code base to TypeScript).
If a restart is clearing this out, that would be where I think the problem may be. I would need to set up a test scenario for that as I do not have an easy way to write an automation test for this.
Ok! Well, we need to see if it’s fixed in the new version, and as soon as it comes out of beta, we’ll need to update
VonOx
June 21, 2021, 9:29pm
28
@pierre-gilles I hadn’t seen it, but the library maintainer chained a 2nd response
ouvert 10:13AM - 07 May 21 UTC
Hi
I'm contributor to open-source project [GladysAssistant](https://gladysass… istant.com/)
We use this lib in our Philips Hue services ( in version 4.0.9 ). Thank you BTW !
We have some weird behavior, newly bridge paired light can't be controlled without a restart.
See gladys log
```
2021-05-07T10:12:53+0200 <debug> light.setValue.js:17 (PhilipsHueLightHandler.setValue) Changing state of light philips-hue-light:001788286ece:10 with value = 0
2021-05-07T10:12:53+0200 <warn> scene.executeActions.js:37 (executeAction) ApiError: Light with id:10 was not found on this bridge
at /home/vonox/repos/Gladys/server/services/philips-hue/node_modules/node-hue-api/lib/api/Lights.js:121:17
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async PhilipsHueLightHandler.setValue (/home/vonox/repos/Gladys/server/services/philips-hue/lib/light/light.setValue.js:38:3)
```
Like I said, restarting the app and the problem is gone.
For reference: https://github.com/GladysAssistant/Gladys/blob/master/server/services/philips-hue/lib/light/light.setValue.js
I've no clue about that, what do you think ?
Thank you
There’s a cache lingering
That’s great It’s good if we get answers from the library side! Keep us updated here
VonOx
July 13, 2021, 10:08am
30
Cache refresh is confirmed
ouvert 10:13AM - 07 May 21 UTC
Hi
I'm contributor to open-source project [GladysAssistant](https://gladysass… istant.com/)
We use this lib in our Philips Hue services ( in version 4.0.9 ). Thank you BTW !
We have some weird behavior, newly bridge paired light can't be controlled without a restart.
See gladys log
```
2021-05-07T10:12:53+0200 <debug> light.setValue.js:17 (PhilipsHueLightHandler.setValue) Changing state of light philips-hue-light:001788286ece:10 with value = 0
2021-05-07T10:12:53+0200 <warn> scene.executeActions.js:37 (executeAction) ApiError: Light with id:10 was not found on this bridge
at /home/vonox/repos/Gladys/server/services/philips-hue/node_modules/node-hue-api/lib/api/Lights.js:121:17
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async PhilipsHueLightHandler.setValue (/home/vonox/repos/Gladys/server/services/philips-hue/lib/light/light.setValue.js:38:3)
```
Like I said, restarting the app and the problem is gone.
For reference: https://github.com/GladysAssistant/Gladys/blob/master/server/services/philips-hue/lib/light/light.setValue.js
I've no clue about that, what do you think ?
Thank you
Great! So what’s the procedure on the Philips Hue Gladys side? Do you need to refresh the cache after adding a bulb?
Do you have time to make a PR for us?
I encountered this bug yesterday, and I made a PR to fix the issue
I added a button in the interface that allows re-synchronizing Gladys with the Philips Hue bridge:
master ← add-philips-hue-sync-with-bridge-button
ouvert 01:49PM - 29 Apr 24 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fa… st as possible, make sure to review and check all of these items:
- [x] If your changes affects code, did your write the tests?
- [x] Are tests passing? (`npm test` on both front/server)
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new features/services, did you run integration comparator? (`npm run compare-translations` on front)
- [x] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community ([french forum](https://community.gladysassistant.com/)/[english forum](https://en-community.gladysassistant.com/)) for testing before merging.
- [x] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
- [x] If you are adding a new features/services which needs explanation, did you modify the user documentation? See [the GitHub repo](https://github.com/GladysAssistant/v4-website) and the [website](https://gladysassistant.com).
- [x] Did you add fake requests data for the demo mode (`front/src/config/demo.js`) so that the demo website is working without a backend? (if needed) See [https://demo.gladysassistant.com](https://demo.gladysassistant.com).
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
### Description of change
Fix #2062


Better late than never