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

Repeat commands make "executing command" status getting stuck #315

Open BlaM opened 2 years ago

BlaM commented 2 years ago

Describe the bug When sending the command to set a bulb to the same state that it already has the "executing command" status gets stuck

Flow to Reproduce

[{"id":"5b4e2a7dc2c82fd5","type":"hue-light","z":"d6bf57b796e15a50","name":"Bulb 1","colornamer":true,"skipevents":false,"initevents":false,"x":800,"y":160,"wires":[[]]},{"id":"7fc82b42658a7e2d","type":"inject","z":"d6bf57b796e15a50","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"brightness\":50, \"color\":\"green\"}","payloadType":"json","x":550,"y":160,"wires":[["5b4e2a7dc2c82fd5","5b4e2a7dc2c82fd5"]]}]

(You'll have to set to your own Hue Hub + Bulb obviously ;) )

To reproduce click on "inject" multiple times.

Expected behavior Node should return to "turned on 50%" or "turned off" or something like that status message if no change has to happen.

Screenshots image

Please complete the following information:

Additional context Nope

cairon-ha commented 2 years ago

Same here!

Node-RED version: v2.2.0

Rintje commented 2 years ago

Me too. I am using Node-RED v.2.2.1

cairon-ha commented 2 years ago

OK, no solution from @BlaM so the node is gone for me. Lights are too important for that shitty programmed node.

ptweety commented 2 years ago

Hi @BlaM: I was observing the same but wasn't able to reproduce this situation. Can you give exact instructions how to reproduce this on your end?

BlaM commented 2 years ago

In my case this is caused by a function that sends the same command multiple times as shown in the "Flow to Reproduce" above. Just a Bulb + a inject node. If I send the same command (e.g. "payload": "{"brightness":50, "color":"green"}") twice then this will happen. There is nothing really special about this.

executing

In my environment this is caused by a custom "motion sensor powered light switch" that updates the light configuration based on various inputs every 5 minutes. That means if the light is on and all flags that would affect the light settings remain stable (outdoor brightness, time of day, ...) then after 5 minutes there is no change in the configuration of the light, so - for simplicity sake - it sends the same config again. I could filter that based on what I remember from the last update, but that comes with more complexity.

Oh, and BTW: This doesn't seem to have major side-effects, it will just stick with that status message. Following commands will still work. So this would count as a purely cosmetic issue as far as I can tell - unless this is just a side-effect of a bigger problem.

yostinso commented 2 years ago

This is just happening because if you send a noop, the hub doesn't generate an event so there's nothing to set the status "back" to what it was. This is my hacky fix (mostly hacky because I didn't use the same JS formatting and left out the "disconnected" state), but I think the approach is correct.

https://github.com/yostinso/node-red-contrib-huemagic/commit/6ee8d1663e7c4ba4e22d3a1279c488bfbae3254a

jackie-t commented 2 years ago

This is absolutely awful, and I cannot believe this bug isn't getting fixed.

Here it actually gets stuck - as in, the lights are not getting switched anymore. And that's with one single hue bulb. All it takes is turning on and off the light a few times, and then the room stays dark until nodered gets redeployed.

Obviously I have to toss out huemagic right then and there. The lights have to work, no ifs and buts. I replaced the huemagic node with an MQTT node sending the command to FHEM, which then executes it - and it works perfectly, so it's not like there's anything wrong with the flow.

Maddin2Code commented 2 years ago

I have the same problem, reproducible.

Node-RED v2.1.3 in combination with Home Assistant.

I am looking forward to the fix of this problem. Once this is done, I will return to hue-magic.

thampp commented 2 years ago

Same problem here: Node-RED v2.1.4 with Huemagic 4.2.2 This is a very serious issue and I am surprised it does not receive more attention.

Graefer commented 2 years ago

Same here. Annoying. Same bug is described there: https://github.com/Foddy/node-red-contrib-huemagic/issues/345

ghost commented 2 years ago

I have temporarily solved it by using FILTER (block unless value changed)

madmax5900 commented 2 years ago

Hi!

Unfortunately I have the same problem. Is there already a solution?

jankokert commented 2 years ago

Same problem here!

I solved it by moving two versions back via:

cd ~/.node-red npm uninstall node-red-contrib-huemagic@4.2.2 npm install node-red-contrib-huemagic@4.1.0

(tested with 4.2.2 and 4.2.1 = stuck!)

The issue seems to be related to #345

DominikusKrueger commented 2 years ago

Same problem here!

I solved it by moving two versions back via:

cd ~/.node-red npm uninstall node-red-contrib-huemagic@4.2.2 npm install node-red-contrib-huemagic@4.1.0

(tested with 4.2.2 and 4.2.1 = stuck!)

The issue seems to be related to #345

Unfortunately this does not help. 4.1.0 can get stuck as well. Hitting the inject node like a maniac to simulate one of my kids operating a physical light switch does get the hue-node into permanent "executing command" state. From here the light bulb does not respond any longer until re-deploying the flow. =(

HaViGit commented 2 years ago

Same problem here, this was a great node but is now worthless :-(

dhlavaty commented 1 year ago

I just upgraded from v3.0.0 to v4.2.2, but unfortunatelly I didn't check issues here on github.

Almost instantly had infinite executing command... problems. Nodes worked ok for a few minutes ( 1-3 minutes max ), and then I had to Redeploy Flows again to fix it.

The only solution was to downgrade back to v3.0.0. I was on it for more than a year, without a single problem. Too bad I didn't save this exercise, and didn't look at the quality of v4 earlier.

psshiner commented 1 year ago

I solved by rolling back to version 3 as I only updated recently.

cd ~/.node-red npm uninstall node-red-contrib-huemagic@4.2.2 npm install node-red-contrib-huemagic@3.0.0

Issues with the following nodes blocking light/group & Scene

bond2k commented 1 year ago

I was lucky enough to have a full backup of home assistant including node red and all nodes. Nothing was working anymore after upgrade from 3.0.0 to 4.2.2 - even after re-registering all hubs and creating new hue bulb and group nodes.

4.x should be removed from npm as it seems it's also not maintained anymore. :(

dbeckerAC commented 7 months ago

Seems to work with 3.0.0 and 4.x keeps being unstable!