Open oxivanisher opened 2 years ago
I have the same issue with the universal node. With deviceId
it works better as with id
but fails more than 50%.
The problem seems to be related to this check:
bridge.validResourceID.test(msg.topic) === true
due to the following RegEx check:
https://github.com/Foddy/node-red-contrib-huemagic/blob/7a0d17d7d0f9924e1ef3b92b81393722c68edfec/huemagic/hue-bridge-config.js#L39
If I remove the check, it is working flawlessly if I pass the deviceId
in msg.topic
Just stopping in to say that I'm also running into this problem, and haven't yet gotten it work even once with either deviceId
or id
passed as msg.topic
.
Edit: I tried disabling line 39 as suggested by @andreas-knx above, and it did get rid of the error message, but didn't make things work any better. I also manually tested that regex statement against my deviceId
, and unsurprisingly, it did work properly.
I have the same problem. ;-)
No idea what the line is doing, but i guess removing the var breaks javascript when accessing like
bridge.validResourceID.test()
Thats why i replaced the line with the followoing common regex and its working for me:
this.validResourceID = /[a-zA-Z0-9]/gi;
But of course, no idea if this breaks something else (e.g. for non universal mode).
Btw. in recent version id
was accepted, which was much easier to handle than deviceid
.
Edit: I tried disabling line 39 as suggested by @andreas-knx above, and it did get rid of the error message, but didn't make things work any better. I also manually tested that regex statement against my
deviceId
, and unsurprisingly, it did work properly.
Hello @bland328 , by disabling the check I meant removing this comparison:
bridge.validResourceID.test(msg.topic) === true
I get the "No light Id defined. Please check the docs." error for my hue lights since the newest version. I use the node in "universal mode" and tried many different things as topic, but nothing works. I think there is a error in this line: https://github.com/Foddy/node-red-contrib-huemagic/blob/7a0d17d7d0f9924e1ef3b92b81393722c68edfec/huemagic/hue-light.js#L124 As far as I can see, the bridge tests for either id or deviceId (the documentation does not really specify which ID is required as topic). But it does not work with both for me.
This is one of my lights status output: