Smart Home Automation Forum
Display Relay Status on NodeRed - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=1)
+--- Forum: Development (https://www.kincony.com/forum/forumdisplay.php?fid=4)
+--- Thread: Display Relay Status on NodeRed (/showthread.php?tid=25)

Pages: 1 2 3 4 5


RE: Display Relay Status on NodeRed - admin - 11-06-2020

https://flows.nodered.org/node/node-red-contrib-ui-led


RE: Display Relay Status on NodeRed - subas - 11-06-2020

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"


RE: Display Relay Status on NodeRed - admin - 11-06-2020

use "switch" and "function" node to convert.


RE: Display Relay Status on NodeRed - subas - 11-06-2020

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.


RE: Display Relay Status on NodeRed - admin - 11-06-2020

later give you a sample photo, now is busy.


RE: Display Relay Status on NodeRed - admin - 11-06-2020

your up "function" node:
msg.payload= "true";
return msg;

your down "function" node:
msg.payload= "false";
return msg;


RE: Display Relay Status on NodeRed - subas - 11-06-2020

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


RE: Display Relay Status on NodeRed - admin - 11-06-2020

(11-06-2020, 04:27 AM)subas Wrote: 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

use "inject" node output "true" and "false" can change LED color.
       


RE: Display Relay Status on NodeRed - subas - 11-06-2020

Dear Admin.

It works now Smile

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;


RE: Display Relay Status on NodeRed - admin - 11-06-2020

yes, if have "" is a string format, not boolean.