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

"The group is not yet available" error since June 6, 2022 #373

Open Eggn1n3 opened 2 years ago

Eggn1n3 commented 2 years ago

Describe the bug Groups don't work anymore when sending command to turn light on/off in a group. Error message: "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."

Expected behavior Lights in a group switched on/off

Please complete the following information: Hue node info: id: "ECB5FAFFFE0B049F" name: "Philips hue" factoryNew: false replacesBridgeId: "001788FFFE1003D0" dataStoreVersion: "125" starterKitId: false softwareVersion: "1951146040" apiVersion: "1.50.0" zigbeeChannel: 11 macAddress: "ec:b5:fa:0b:04:9f" ipAddress: "192.168.5.24" dhcpEnabled: false netmask: "255.255.255.0" gateway: "192.168.5.1" proxyAddress: false proxyPort: 0 utcTime: "2022-06-06T20:38:19" timeZone: "Europe/Amsterdam" localTime: "2022-06-06T22:38:19" portalServicesEnabled: true portalConnected: "connected" linkButtonEnabled: false touchlinkEnabled: false autoUpdatesEnabled: true

Node red version: 2.2.2 Hue Magic version 4.2.2

Additional context All individual lights and sensors work fine as always; just the groups that stopped working.

Note that auto-update for the bridge is active and I noticed that since June 6th the Hue bridge software 1951146040 has been installed. The problems started as well on June 6th (before this date it worked perfect for months). https://www.philips-hue.com/en-us/support/release-notes/bridge

Node JS and Node Red were not updated. Tested the setup on an older node js /node red version and noticed same behaviour.

MrMiracles commented 2 years ago

Same problem, some extra info from the logs:

7 Jun 23:09:08 - [info] [hue-bridge:hue] Initializing the bridge (192.168.xxx.xxx)… 7 Jun 23:09:08 - [info] Started flows 7 Jun 23:09:08 - [info] [hue-bridge:hue] Connected to bridge 7 Jun 23:09:09 - [info] [hue-bridge:hue] Processing bridge resources… 7 Jun 23:09:09 - [info] [hue-bridge:hue] Initial emit of resource states… 7 Jun 23:09:10 - [info] [hue-bridge:hue] Keeping nodes up-to-date… 7 Jun 23:09:10 - [info] [hue-bridge:hue] Subscribing to bridge events…

-- on trying a switch to turn off the lights: 7 Jun 23:10:16 - [error] [hue-group:hall] 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.

Also on the new firmware, problems started today. Already tried: Restarting Node-red and the bridge. Also tried to make a new connection to the bridge (made a new user). Nothing changed.

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...

Do not forget to restart Node-RED after applying the change! A full reset is required to pick-up changes to modules.

MrMiracles commented 2 years ago

Thanks @Kedarebwyn, I can confirm that this workaround works!

corny359 commented 2 years ago

@Kedarebwyn! Thank you so much! It works fine. Does anyone know about the reason? Was there an update to the Hue bridge?

Swiftnesses commented 2 years ago

+1 same issue here. Trying the workaround now.

Thanks @Kedarebwyn

peda commented 2 years ago

I'm now having the same issue with all lights, not only groups - the fixed proposed for groups doesn't work unfortunately.

Stieger81 commented 2 years ago

Same problem here an the woraround dos not work

Caputhziner commented 2 years ago

Same here, workaround doesn't work

Kedarebwyn commented 2 years ago

@Stieger81 @Caputhziner just to be sure... did you restart Node-RED after applying the fix? A full reset of Node-RED is required to pick-up the changes.

Caputhziner commented 2 years ago

Yes, rebooted


Von: Kedarebwyn @.> Gesendet: Montag, 13. Juni 2022 22:09 An: Foddy/node-red-contrib-huemagic @.> Cc: Caputhziner @.>; Mention @.> Betreff: Re: [Foddy/node-red-contrib-huemagic] "The group is not yet available" error since June 6, 2022 (Issue #373)

@Stieger81https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FStieger81&data=05%7C01%7C%7C964ba2e50879420aacb908da4d78aea3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637907477973445027%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=vqSsKx9qI50JhR%2BlVldlf5yoJGqOpptOfKEpK9q0vas%3D&reserved=0 @Caputhzinerhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FCaputhziner&data=05%7C01%7C%7C964ba2e50879420aacb908da4d78aea3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637907477973445027%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ZYZz2AK0frJKygvaQ%2FaFhSqqQiWaqk4ris4BaKq8GP0%3D&reserved=0 just to be sure... did you restart Node-RED after applying the fix? A full reset of Node-RED is required to pick-up the changes.

— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FFoddy%2Fnode-red-contrib-huemagic%2Fissues%2F373%23issuecomment-1154380507&data=05%7C01%7C%7C964ba2e50879420aacb908da4d78aea3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637907477973445027%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=RKTTpaJ40g3jhhNy%2BcF4PNblJPfWkYd%2F8oB7NV213pI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAXZEA6VWCDHG7UEYETZPJVLVO6IQ7ANCNFSM5YB5IGCA&data=05%7C01%7C%7C964ba2e50879420aacb908da4d78aea3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637907477973445027%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=RaqPn1stnc%2FNXia7TvNNLdz04a8geMcjW28HM7iQslw%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

jfreak80 commented 2 years ago

Same here. Groups and Lights are not reachable. Also after the workaround and a reboot!

Phalynx commented 2 years ago

Same here :( Reboot didn't resolved this issue

Edit: But the workaround in messages.js works!

Luke050 commented 2 years ago

I have same issue aplied this fix and rebooted my server but I have still same messages when I try to turn on/off hue group

Luke050 commented 2 years ago

sorry it works guys you need to edit correct file for example I have it in two places: /home/pi/.node-red/node_modules/node-red-contrib-huemagic/huemagic/utils

/home/pi/node_modules/node-red-contrib-huemagic/huemagic/utils

so the. first one is correct in my case

marc-gist commented 2 years ago

thanks. I hope the author is still active as this is the second big issues to go un-fixed for a time :(

na-am commented 2 years ago

that doesn't works for me either my hue bridge is about 5 years old, so i go back to ver 2.8.6

npm uninstall node-red-contrib-huemagic npm install node-red-contrib-huemagic@2.8.6

bland328 commented 2 years ago

Thanks to Kedarebwyn and Luke050--this hack worked for me.

For anyone else trying this, be careful to edit the correct file per https://github.com/Foddy/node-red-contrib-huemagic/issues/373#issuecomment-1155475771.

jfreak80 commented 2 years ago

any suggestions where i can find the correct file, when i have the installation on a ccu3 from homematic?

NStiens commented 2 years ago

any suggestions where i can find the correct file, when i have the installation on a ccu3 from homematic?

It is: /usr/local/addons/redmatic/var/node_modules/node-red-contrib-huemagic/huemagic/utils Make a Backup file before editing...

jfreak80 commented 2 years ago

any suggestions where i can find the correct file, when i have the installation on a ccu3 from homematic?

It is: /usr/local/addons/redmatic/var/node_modules/node-red-contrib-huemagic/huemagic/utils Make a Backup file before editing...

thank you. But this i edited already and reboot and take no effects for me. I thought there should be a second, maxbe hidden, version

prometheus247 commented 2 years ago

Same problem here.

Rollem1 commented 2 years ago

Thanks @Kedarebwyn, Your workaround also works for me! Cheers

bvol commented 2 years ago

Thanks @Kedarebwyn you made. my day. @Foddy kannst Du den Patch bitte einbauen?

jfreak80 commented 2 years ago

Anybody with a ccu3 solved the problem?

mathias-ewald commented 2 years ago

Same problem. Why is nothing happening here?

eibalinchen commented 2 years ago

same problem for me. The Workaround > https://github.com/Foddy/node-red-contrib-huemagic/issues/373#issuecomment-1150817250 doesn´t help in my configuration. (version 4.2.2)

Restarts, reboots, reinstall, install to a lower version (4.2.1), nothing helps to get huegroups work. HUE Bridge-Version: 1.52.1952086020 NodeRed Version: 1.2.2 Running Raspberry Pi 3 Model B Rev 1.2

marc-gist commented 2 years ago

@eibalinchen unfortunatly Hue keeps changing the new v2 API, and until the author or someone makes some changes to this library, it isn't going to work reliably :( I have sadly moved on to a partially custom solution. but it works well and is now reliable again.

eibalinchen commented 2 years ago

@eibalinchen unfortunatly Hue keeps changing the new v2 API, and until the author or someone makes some changes to this library, it isn't going to work reliably :( I have sadly moved on to a partially custom solution. but it works well and is now reliable again.

hi @marc-gist, thanx for your update, but what else can I acutally do to make it functionally?

peda commented 2 years ago

hi @marc-gist, thanx for your update, but what else can I acutally do to make it functionally?

As the original author isn't active anymore, you can only fork it and fix it yourself - everything else will only be a temporary solution and break again once Hue makes the next step towards a full v2 API migration

eibalinchen commented 2 years ago

As the original author isn't active anymore, you can only fork it and fix it yourself - everything else will only be a temporary solution and break again once Hue makes the next step towards a full v2 API migration

I understood that, but what can I do even currently to make it work for me?

marc-gist commented 2 years ago

As the original author isn't active anymore, you can only fork it and fix it yourself - everything else will only be a temporary solution and break again once Hue makes the next step towards a full v2 API migration

I understood that, but what can I do even currently to make it work for me?

If you don't know how to code. You will need to move to another solution.

eibalinchen commented 2 years ago

OK, thank you

eibalinchen commented 2 years ago

As the original author isn't active anymore, you can only fork it and fix it yourself - everything else will only be a temporary solution and break again once Hue makes the next step towards a full v2 API migration

I understood that, but what can I do even currently to make it work for me?

If you don't know how to code. You will need to move to another solution.

ok, my current solution is to operate all hue groups via this contrib [https://flows.nodered.org/node/node-red-contrib-node-hue]. and delete the old existing hue groups of the other contrib. So it works fine for me, because all other nodes, like "szenes", "hue magic" etc are without failures...

spede commented 2 years ago

For anyone running Home Assistant, the workaround needs to be applied to:

/root/config/node-red/node_modules/node-red-contrib-huemagic/huemagic/utils/messages.js

mcdeck commented 2 years ago

For Home Assistant users, the path is actually

/config/node-red/node_modules/node-red-contrib-huemagic/huemagic/utils

(so without the leading /root)

Schmetterfliege commented 2 years ago

Hey guys,

so... due to moving 2 times in the last months, my whole setup was offline since end of May. Reading this thread and the latest issue, I figured Huemagic is dead, right?

What are your alternatives?

mcdeck commented 2 years ago

Since I'm using Home Assistant anyway I've switched to sing that integration with NodeRed, then simply using a service call. I have a scene cycler implemented using this now and that just works.

Schmetterfliege commented 2 years ago

is that an Home Assistant only thing? Or are service calls NR sided?

mcdeck commented 2 years ago

That's indeed a Home Assistant thing. It goes NR -> HA -> Hue

GeorgeCastanza commented 1 year ago

There is a different way, there is a new integration using v2 of the Hue API.

It’s excellent. I’ve been using it this week, and it bypasses all but one of the dependancies that we rely upon with the old Hue node. It’s so much faster, no errors (once I removed the old instance)

Details here: GitHub - andesse/hue-clip-api.node-red-flows: Node-Red Flow to communicate with HUE CLIP API

My Hue lights are just brilliant now. Working on changing over my motion sensors today.

Schmetterfliege commented 1 year ago

Sounds absolutely awesome! Will give it a try. Thank you very much!!

adams-family commented 1 year ago

Confirming that @Kedarebwyn's workaround works. Would be nice to push this fix to the main repo.

bvol commented 1 year ago

There is a different way, there is a new integration using v2 of the Hue API.

It’s excellent. I’ve been using it this week, and it bypasses all but one of the dependancies that we rely upon with the old Hue node. It’s so much faster, no errors (once I removed the old instance)

Details here: GitHub - andesse/hue-clip-api.node-red-flows: Node-Red Flow to communicate with HUE CLIP API

My Hue lights are just brilliant now. Working on changing over my motion sensors today.

Ich hab‘ mal noch einen Subflow entwickelt, den man statt den huemagic bulbs und goups mit obiger Lösung einsetzen kann (inkl. Unrechnung HEX nach xy). Obige Lösung funktioniert wegen der alten nodered Version von Redmatic nicht. Habe einen zusätzlichen Tinkerboard mit NodeRed mit Mosquitto aufgesetzt, den ich via MQTT an Redmatic angebunden habe. Hat jemand Interesse?

uli-rpi commented 1 year ago

Ja :-)

bvol commented 1 year ago

@uli-rpi

Hue_Light_Switch_Nodes.zip

vor den Header_V2 Node von Andesse hängen. Füttern wie in den Nodes beschrieben.....

stevegroom commented 1 year ago

This workaround did the trick for lights, but same error still occurs for motion / temp sensors. There must be a similar line to change...

OpCodeWolf commented 1 year ago

@na-am

that doesn't works for me either my hue bridge is about 5 years old, so i go back to ver 2.8.6

npm uninstall node-red-contrib-huemagic npm install node-red-contrib-huemagic@2.8.6

I'm a little late to the party, but this worked perfectly for me. I figured it would be fixed eventually and went the last several months without it, but I'm finding that now that I need more automation in my house, I decided to investigate.

I'm currently running node-red inside of a docker container and setup the internal node-red data directory to point to a hosts data directory using a docker volume, mostly so I can backup and restore quickly. Once I used nvm to install the correct node version I was able to change directory on my host into the data directory and revert to the older version using your suggestion. Restarted the docker container and refreshed the UI. Everything just worked without fail. Thank you for solving this headache for me.

docker-compose.yml example volume implementation:

     entrypoint: ["npm", "--no-update-notifier", "--no-fund", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]
     volumes:
      - ./data:/data

Kudos!

bond2k commented 1 year ago

Does anyone know if this is fixed in the fork? https://github.com/mauricedominic/node-red-contrib-huemagic

Edit: I see, it's fixed: https://github.com/mauricedominic/node-red-contrib-huemagic/commit/b483502fc5960ad729fc9f8ae8edba78c9dae2ff