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
200 stars 67 forks source link

Huemagic group connection problems #374

Open MarkRoks opened 2 years ago

MarkRoks commented 2 years ago

Hello,

I'm using Huemagic with Node-Red. The firmware I use voor Huemagic is V4.2.2 and Node-Red V2.2.2.

Since the last automatic Hue (Bridge) update, I've got the following errors, when I call a Hue-(group-)scene with Node-Red;

"The group in not yet available. Please wait until HueMagic has established a connection with the bridge or check whether the resource ID in the configuration is valid."

The Hue lamps won't react and stay on the value they are previous set (with the Hue app.).

Is there a solution for this?

Greetings,

Mark

MarkRoks commented 2 years ago

Hello,

After some further research, within Node-Red, I found out that it is in "Hue Group control" within Huemagic.

If the same command is sent to several luminaires in a group at the same time, the above error message will appear.

Previously, this worked, but apparently something has been adjusted through an update on the Hue side.

If I now control the luminaires in the relevant group independently, it works.

In short, working (again) for the time being, but now with a detour.

Perhaps the problem can be solved within Huemagic?

Regards,

Mark

Kedarebwyn commented 2 years ago

A temporary workaround, until @Foddy can fix the issue permanently is to locally change the file 'messages.js' located in the 'utils' folder. Specifically the line:

https://github.com/Foddy/node-red-contrib-huemagic/blob/1af6c29676c0cabd02f2cd1b105b95acff24d77f/huemagic/utils/messages.js#L122

simply comment this line and the nodes should work again.

// service = options.resources[service.id];

After making this change nothing else broke and my group nodes work again, so I'm assuming the change is safe. But no gaurantee this won't break something else related to groups...

Originally posted by @Kedarebwyn in https://github.com/Foddy/node-red-contrib-huemagic/issues/373#issuecomment-1150817250

MarkRoks commented 2 years ago

Hello,

I edited the above and then tested some. Unfortunately, I kept getting the mentioned error when I directed the group, as before.

In short, I will have to wait for a workaround.

Greetings,

Kedarebwyn commented 2 years ago

Hello @MarkRoks, did you restart node-RED after the change? A full reset is required to pick-up changes to modules.

MarkRoks commented 2 years ago

Hello,

You're right! I forgot to restart Node-Red. I've changed line 122 once a time and give it a restart. After that the group command works again!

Thanks a lot!

Greetings,

TurboKanne commented 2 years ago

@Kedarebwyn thank you!

Patrick-UK commented 2 years ago

I am having a mixed result when commenting the line out. Turning groups on and off works for groups with small number of lights but the All Group fails to turn off regular, odd occasion it works. Not seeing anything in the logs that implies there is an error.

Will keep an eye on it and if anything does pop into the logs I post back here.

MarkRoks commented 2 years ago

Hello,

The problem, which until now still occurred with the Hue groups (no reaction), now also occurs with the individual control of Hue lamps. They also now do not respond to the "off" command from Node-Red towards individual lamps within Hue-Magic. The suggested solution (modification of line 122 in messages.js) does not work (anymore).

Does anyone have a solution for this?

TurboKanne commented 2 years ago

Hello,

The problem, which until now still occurred with the Hue groups (no reaction), now also occurs with the individual control of Hue lamps. They also now do not respond to the "off" command from Node-Red towards individual lamps within Hue-Magic. The suggested solution (modification of line 122 in messages.js) does not work (anymore).

Does anyone have a solution for this?

Same here :-( Seems that the connection to Hue Bridge fails. When checking for the group / lamp name of a Hue-flow i get the error message "something went wrong". (Node-Red 4.2.2)

Patrick-UK commented 2 years ago

I am using Ned Red version 3 with Hue Magic 4.2.2 and not seeing this issue since modifying line 122. My bridge is running 1.52.1952086020 if that helps.