Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Display Relay Status on NodeRed
#11
https://flows.nodered.org/node/node-red-contrib-ui-led
Reply
#12
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"


Attached Files Image(s)
               
Thank You

Regards
Subas
Reply
#13
use "switch" and "function" node to convert.
Reply
#14
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.


Attached Files Image(s)
                   
Thank You

Regards
Subas
Reply
#15
later give you a sample photo, now is busy.
Reply
#16
your up "function" node:
msg.payload= "true";
return msg;

your down "function" node:
msg.payload= "false";
return msg;
Reply
#17
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


Attached Files Image(s)
                               
Thank You

Regards
Subas
Reply
#18
(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.
       
Reply
#19
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;
Thank You

Regards
Subas
Reply
#20
yes, if have "" is a string format, not boolean.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)