11-06-2020, 02:22 AM
Display Relay Status on NodeRed
|
11-06-2020, 03:00 AM
Dear Admin
I have installed the ui-led. i have followed the example but my led won't change color when i OFF the relay. There is a Java Script in the Function Node which i copied from your example. The output of the relay is: RELAY-SET-255,1,1,OK which i have output on the debug screen. Can the Java Script change the RELAY-SET-255,1,1,OK into LED status? Maybe need to modify the Java Script as this is more for "True" or "False" but debug shows "1" for "ON" and "0" for "OFF"
Thank You
Regards Subas
11-06-2020, 03:23 AM
use "switch" and "function" node to convert.
11-06-2020, 03:27 AM
Dear Admin.
I have used the switch as per screen shot but still not working. Please see all the screen shot. Can you correct the switch logic as i may be wrong.
Thank You
Regards Subas
11-06-2020, 03:44 AM
later give you a sample photo, now is busy.
your up "function" node:
msg.payload= "true"; return msg; your down "function" node: msg.payload= "false"; return msg;
Dear Admin.
i have followed your instruction to change the Function Node. It is till not working. May be TCP output got no "True" or "False". TCP has output RELAY-SET-255,1,0,OK TCP has output RELAY-SET-255,1,1,OK How to change the 1 for "ON" to "True" and "0" for "OFF" to "False"? Dear Admin. I managed to get the debug at node debug 5 to show "True" but i noticed that the LED on the web page don't change color. The logic on the LED Node is correct as when its "True" is "Green" and when its "False" it "Red" as per my screen shot. Please help
Thank You
Regards Subas
11-06-2020, 06:19 AM
(11-06-2020, 04:27 AM)subas Wrote: Dear Admin. use "inject" node output "true" and "false" can change LED color.
11-06-2020, 06:55 AM
Dear Admin.
It works now . My problem as i have declared the Function Boolean to be a text with a "" instead of Boolean without the "". msg.payload= "true"; return msg; It should be below without the "" on the true msg.payload= true; return msg;
Thank You
Regards Subas
11-06-2020, 07:36 AM
yes, if have "" is a string format, not boolean.
|
« Next Oldest | Next Newest »
|
Users browsing this thread: |
1 Guest(s) |