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

Hue Magic crash Node-RED - Cannot read properties of undefined (reading 'status') #388

Open CyrielRct opened 2 years ago

CyrielRct commented 2 years ago

Describe the bug Hue Magic crash Node-RED

27 Jul 21:37:42 - [red] Uncaught Exception:
27 Jul 21:37:42 - [error] TypeError: Cannot read properties of undefined (reading 'status')
    at /config/node-red/node_modules/node-red-contrib-huemagic/huemagic/utils/api.js:102:37
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[21:37:42] WARNING: Node-RED crashed, halting add-on

Please complete the following information:

CyrielRct commented 2 years ago

Problem fixed by adding this fix : https://github.com/Foddy/node-red-contrib-huemagic/commit/1af6c29676c0cabd02f2cd1b105b95acff24d77f

czech12 commented 2 years ago

Hi all,

I was receiving an error very similar to this. It turned out to be a network connectivity issue (I was over my PoE budget and switches were randomly rebooting) between my Home Assistant server (which runs the NodeRed Add-On, which uses HueMagic) and my hue bridge. The problem though is that when HueMagic couldn't reach my hue bridge, it crashed NodeRed.

This seems like a serious dependency to me. I don't like my hue bridge being a single point of failure for all of my NodeRed automations.

Does anyone else experience the same issue? Is it possibly something with my installation? I tried removing all unused packages in NodeRed, but the issue didn't resolve itself until my hue bridge was able to have consistent reliable network connectivity.

Thanks.

windkh commented 1 year ago

same problem here. Will there be a new version containing this fix soon?

czech12 commented 1 year ago

Hi all,

I was receiving an error very similar to this. It turned out to be a network connectivity issue (I was over my PoE budget and switches were randomly rebooting) between my Home Assistant server (which runs the NodeRed Add-On, which uses HueMagic) and my hue bridge. The problem though is that when HueMagic couldn't reach my hue bridge, it crashed NodeRed.

This seems like a serious dependency to me. I don't like my hue bridge being a single point of failure for all of my NodeRed automations.

Does anyone else experience the same issue? Is it possibly something with my installation? I tried removing all unused packages in NodeRed, but the issue didn't resolve itself until my hue bridge was able to have consistent reliable network connectivity.

Thanks.

I decided HueMagic was overkill for my specific needs and the Home Assistant integration already had all the information I needed about Hue. For the Hue switches and buttons, I use the Events All node and look for all hue_event messages. It works flawlessly and doesn't break anything is hue goes offline. For Hue scenes, I use the Call Service node to have HA turn the scene on.

Cool project, but HueMagic crashing NodeRed entirely because my bridge was offline is too much of a limitation for me.

astromediaonly commented 1 year ago

Having this too - makes this library completely unusable because after few hours I get this and whole automation stops working :/

Node-RED version: 3.0.2 Running with Docker Latest version of Hue Magic

mauricedominic commented 1 year ago

If you are still interested in using huemagic, you could switch to node-red-contrib-huemagic-fork that includes several bugfixes and community contributions. Instructions on how to switch are included in the README.

astromediaonly commented 1 year ago

I did in last hope, is it fixed there? I did not expected it because the other issue Im also having of constant spam of "Error requesting info from the bridge. Reconnect in some secs. undefined" was not yet it seems. (I did managed to write sheduled script that will restart it hopefully if it crashed as last option but it was pain :) )

mauricedominic commented 1 year ago

The above mentioned fix (https://github.com/Foddy/node-red-contrib-huemagic/commit/1af6c29676c0cabd02f2cd1b105b95acff24d77f) is included in the fork.

In what version of Huemagic are you facing the error msg spam: "Error requesting info from the bridge. Reconnect in some secs. undefined"?

astromediaonly commented 1 year ago

Nice thx. I would say the latest (installed like two days ago), yesterday I changed it to -fork version and as Im checking I have no logs for today yet so I guess its possible it stopped - weird. Its deffinitelly happening in normal hue-magic but I guess it could be fixed in -fork too ... i will keep an eye on that.