node-red-contrib-huemagic icon indicating copy to clipboard operation
node-red-contrib-huemagic copied to clipboard

Repeat commands make "executing command" status getting stuck

Open BlaM opened this issue 3 years ago • 19 comments

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:

  • Node-RED version: v2.2.0
  • NodeJS version: v14.18.2
  • Device running Node-RED: Unraid on Intel® Core™ i5-10600 CPU via Docker

Additional context Nope

BlaM avatar Feb 09 '22 17:02 BlaM

Same here!

Node-RED version: v2.2.0

cairon-ha avatar Feb 10 '22 18:02 cairon-ha

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

Rintje avatar Feb 20 '22 12:02 Rintje

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

cairon-ha avatar Feb 23 '22 18:02 cairon-ha

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?

ptweety avatar Mar 02 '22 17:03 ptweety

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.

BlaM avatar Mar 02 '22 17:03 BlaM

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

yostinso avatar Mar 04 '22 03:03 yostinso

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.

jackie-t avatar Apr 26 '22 18:04 jackie-t

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.

Maddin2Code avatar May 12 '22 11:05 Maddin2Code

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.

thampp avatar May 17 '22 18:05 thampp

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

Graefer avatar May 24 '22 06:05 Graefer

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

ghost avatar May 24 '22 18:05 ghost

Hi!

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

madmax5900 avatar Jun 27 '22 14:06 madmax5900

Same problem here!

I solved it by moving two versions back via:

cd ~/.node-red npm uninstall [email protected] npm install [email protected]

(tested with 4.2.2 and 4.2.1 = stuck!)

The issue seems to be related to #345

jankokert avatar Jul 18 '22 22:07 jankokert

Same problem here!

I solved it by moving two versions back via:

cd ~/.node-red npm uninstall [email protected] npm install [email protected]

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

DominikusKrueger avatar Aug 14 '22 08:08 DominikusKrueger

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

HaViGit avatar Aug 26 '22 12:08 HaViGit

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.

dhlavaty avatar Nov 21 '22 17:11 dhlavaty

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

cd ~/.node-red npm uninstall [email protected] npm install [email protected]

Issues with the following nodes blocking light/group & Scene

psshiner avatar Jan 12 '23 22:01 psshiner

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

bond2k avatar Apr 06 '23 19:04 bond2k

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

dbeckerAC avatar Jan 30 '24 11:01 dbeckerAC