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

Hue Bridge doesn't connect anymore #407

Open McFozzy75 opened 1 year ago

McFozzy75 commented 1 year ago

Describe the bug After a succesfull setup of the brigde. Hue Magix doesn't connect. It hangs on connecting.

It started after I updated to 4.2.2.

I tryed to get an new api key. It is send back by the bridge correctly.

Also sometimes I get an timeout error if I open the bridge setup screen

If I open te Light list an error is displayed: "Something went wrong. Please retry."

If I try an configured light. The following texts is display in the debug screen: "The light 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."

Log: 22 Oct 22:49:31 - [info] [hue-bridge:Philips hue] Initializing the bridge (192.168.0.xxx)… 22 Oct 22:49:32 - [info] [hue-bridge:Philips hue] Connected to bridge 22 Oct 22:49:33 - [info] [hue-bridge:Philips hue] Processing bridge resources… 22 Oct 22:49:33 - [info] [hue-bridge:Philips hue] TypeError: Cannot read property 'owner' of undefined

Screenshots image

Please complete the following information:

mattheath commented 1 year ago

I also have the same problem:

26 Oct 19:38:24 - [info] [hue-bridge:Philips Hue Bridge] Initializing the bridge (192.168.x.x)…
26 Oct 19:38:24 - [info] [hue-bridge:Philips Hue Bridge] Connected to bridge
26 Oct 19:38:25 - [info] [hue-bridge:Philips Hue Bridge] Processing bridge resources…
26 Oct 19:38:25 - [info] [hue-bridge:Philips Hue Bridge] TypeError: Cannot read properties of undefined (reading 'owner')
mauricedominic commented 1 year ago

For the time being I've created a fork and applied some fixes that should solve these issues. I have published it as a new node-red node contrib. You can find it as node-red-contrib-huemagic-fork.

McFozzy75 commented 1 year ago

Found a fix and implemented it. See: Fork

FredBlo commented 1 year ago

Fyi, I published a pull request #409 which, in addition to fixing the problems mentioned here, also improves the way the bridge overload is handled (following +/- recent changes made to the HUE bridge at this level, aka Error 429)... So if you want to give a try, you can using this one too (installable form FredBlo fork npm install git+https://github.com/fredblo/node-red-contrib-huemagic.git :-) )

neildsb commented 1 year ago

the fork is working for me, thanks!!

node-red-contrib-huemagic-fork 4.2.3

update after an hour its stopped working :-( update then again, I make a change in nodered and deploy, it works again?

2 Nov 14:49:30 - [info] [hue-bridge:Philips Hue Hub] Initial emit of resource states… 2 Nov 14:49:31 - [info] [hue-bridge:Philips Hue Hub] Keeping nodes up-to-date… 2 Nov 14:49:31 - [info] [hue-bridge:Philips Hue Hub] Subscribing to bridge events… 2 Nov 14:50:00 - [info] [hue-bridge:Philips Hue Hub] Error requesting info from the bridge. Reconnect in some secs. undefined 2 Nov 14:50:00 - [info] [hue-bridge:Philips Hue Hub] Initializing the bridge (192.168.20.184)… 2 Nov 14:50:00 - [info] [hue-bridge:Philips Hue Hub] Error requesting info from the bridge. Reconnect in some secs. undefined 2 Nov 14:50:00 - [info] [hue-bridge:Philips Hue Hub] Initializing the bridge (192.168.20.184)… 2 Nov 14:50:00 - [info] [hue-bridge:Philips Hue Hub] Connected to bridge 2 Nov 14:50:00 - [info] [hue-bridge:Philips Hue Hub] Connected to bridge 2 Nov 14:50:01 - [info] [hue-bridge:Philips Hue Hub] Error requesting info from the bridge. Reconnect in some secs. undefined 2 Nov 14:50:01 - [info] [hue-bridge:Philips Hue Hub] Initializing the bridge (192.168.20.184)… 2 Nov 14:50:01 - [info] [hue-bridge:Philips Hue Hub] Error: Request failed with status code 429 2 Nov 14:50:01 - [info] [hue-bridge:Philips Hue Hub] Error requesting info from the bridge. Reconnect in some secs. undefined 2 Nov 14:50:01 - [info] [hue-bridge:Philips Hue Hub] Initializing the bridge (192.168.20.184)… 2 Nov 14:50:02 - [info] [hue-bridge:Philips Hue Hub] Error: Request failed with status code 429 2 Nov 14:50:02 - [info] [hue-bridge:Philips Hue Hub] Processing bridge resources… huemagic: ignore undefined resources huemagic: ignore undefined resources huemagic: ignore undefined resources 2 Nov 14:50:02 - [info] [hue-bridge:Philips Hue Hub] Initial emit of resource states… 2 Nov 14:50:03 - [info] [hue-bridge:Philips Hue Hub] Keeping nodes up-to-date… 2 Nov 14:50:03 - [info] [hue-bridge:Philips Hue Hub] Subscribing to bridge events… 2 Nov 14:50:03 - [info] [hue-bridge:Philips Hue Hub] Processing bridge resources… huemagic: ignore undefined resources huemagic: ignore undefined resources huemagic: ignore undefined resources 2 Nov 14:50:03 - [info] [hue-bridge:Philips Hue Hub] Initial emit of resource states… 2 Nov 14:50:04 - [info] [hue-bridge:Philips Hue Hub] Keeping nodes up-to-date… 2 Nov 14:50:04 - [info] [hue-bridge:Philips Hue Hub] Subscribing to bridge events… 2 Nov 14:50:09 - [info] Stopping flows 2 Nov 14:50:09 - [info] [server:Home Assistant] Closing connection to http://supervisor/core 2 Nov 14:50:09 - [info] [hue-bridge:Philips Hue Hub] Unsubscribing from bridge events… 2 Nov 14:50:09 - [info] Stopped flows 2 Nov 14:50:09 - [info] Updated flows 2 Nov 14:50:09 - [info] Starting flows 2 Nov 14:50:09 - [info] [hue-bridge:Philips Hue Hub] Initializing the bridge (192.168.20.184)… 2 Nov 14:50:09 - [info] Started flows 2 Nov 14:50:09 - [info] [hue-bridge:Philips Hue Hub] Connected to bridge 2 Nov 14:50:10 - [info] [hue-bridge:Philips Hue Hub] Processing bridge resources… huemagic: ignore undefined resources

FredBlo commented 1 year ago

@neildsb , the problems you encounter are related to what I solved in the PR #409, see my previous comment I think you should try to apply this install npm install git+https://github.com/fredblo/node-red-contrib-huemagic.git

neildsb commented 1 year ago

@neildsb , the problems you encounter are related to what I solved in the PR #409, see my previous comment I think you should try to apply this install npm install git+https://github.com/fredblo/node-red-contrib-huemagic.git

thanks, think I will have to wait for the merge, I cannot use 'npm install' :-(

update I have read the notes again, and have set the worker to 1, fingers crossed with node-red-contrib-huemagic-fork 4.2.3

update its stopped working after ~10 mins, not a problem, will wait for @Foddy to merge the updates

dongennl commented 1 year ago

thank you @FredBlo I've switched to your fork, can't wait for this anymore. Really appreciate your work.

neildsb commented 1 year ago

node-red-contrib-huemagic-fork 4.2.4

looks like its working so far....

image

AleksCee commented 1 year ago

thank you @FredBlo I've switched to your fork, can't wait for this anymore. Really appreciate your work.

What is the best way to switch to the fork without loose the used nodes?

mauricedominic commented 1 year ago

thank you @FredBlo I've switched to your fork, can't wait for this anymore. Really appreciate your work.

What is the best way to switch to the fork without loose the used nodes?

Here below the steps you could take in order to use the fork without having to re-create all of your flows:

  1. Create a backup of all flows that refer to the huemagic nodes
  2. Remove all the huemagic related flows
  3. Remove all the huemagic related configuration nodes
  4. Deploy all changes
  5. Remove the original huemagic nodes contrib
  6. Install the huemagic fork nodes contrib
  7. Import the backup created in step 1
  8. Deploy all changes

Cheers