Foddy / node-red-contrib-huemagic

Philips Hue node to control bridges, lights, groups, motion sensors, temperature sensors and Lux sensors using Node-RED.
https://flows.nodered.org/node/node-red-contrib-huemagic
Apache License 2.0
201 stars 67 forks source link

Critical - Problem with HueMagic and HUE Clip API v2 #314

Open andesse opened 2 years ago

andesse commented 2 years ago

Describe the bug I am participating with one of my Bridges at the HUE Beta Programm and got a Firmware update a couple of days ago. 1.50.1950049000

Since then I am not able to trigger Scenes in NodeRed (Error 500) and Groups aren't showing any usable data coming out.

Flow to Reproduce Not available

Expected behavior When I trigger a scene the scene should start in the room. Using a room node I used to take the true/false from the output to trigger flows. Both isn't available at the moment. Scenes reply with a 500Error, and on the room node outputs nothing appears (on the other non Beta Firmware Bridge it works still fine.

Screenshots HUE Developer API Documentation

image image

Please complete the following information: Everything most recent version

Additional context After the problems I did some more investigation and started to read into the V2 API instructions. I used the Rest App to discover data if my bridge by myself using Http Request.

Started to try on a lamp if I can turn it on / off etc. works fine. Then I discovered my rooms and after that I discovered the details of one room for testing.

On the Beta Bridge I could successfully trigger a scene via http, works fine. After that tried to turn off the light in the room (using Room ID) with sending a false to it, got the message in return "Method not allowed"

Additional to the Room ID a "grouped_light" ID was discovered for this room. Sending a false command to this ID turned off the lights. So actually it seems that the room ID shares the information of the Room, but the grouped_lights ID is controlling the room. I think this might be the issue.

(Choosing a room in HueMagic it always takes the Room ID, it should use the grouped_light ID, I guess, cause this gives a "service" and the group ID actually not)

image

For the scenes it seems similar, the scenes are created in a room in the App, but aren't directly connected to it anymore. On the shared screenshot you can see that a scene is now triggered by "action: active". I think that's the reason they stopped working for me in HueMagic, cause in the scenes list, they are clearly connected to a room.

After I discovered this, I added in NodeRed the grouped_lights ID in the Room node instead of the Room ID, to try if this might solve the problem. It didn't. NodeRed crashed after doing this and I needed to start it in safe mode to change it back.

There need probably some changes done in the contrib that it works for me again. If Signify release this Firmware public, almost everyone would face this problems.

I might be wrong or this is already known, I am not an expert in these things, but that's what I figured out today.

Hope this information is useful and helps.

I also contacted the HUE Beta Admins and asked if this the normal behavior. Waiting for feedback.

Greetings Andreasm

andesse commented 2 years ago

Ok, found another problem today with 2 new lamps I connected to the beta bridge. When searching for a lamp in the lamp node in node-red it'll find the lamp ID. (Yellow marker)

image

After deploy and sending a true to the lamp to turn it on following message appeared image

Using the Rest app to turn on a lamp, the ID of the Lamp isn't working either. To get the lamp turned on I need to use the ID (red marker) that appears under "services" (green marker) If this ID receives a true in Rest app the lamp turns on.

I tried to replace the IDs in the lamp node to the ID listed under Services, but nothing happened using it.