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


Display Relay Status on NodeRed - subas - 10-30-2020

Dear Sir.

I managed to use the IFTTT on the KC868-COL logical controller. 
A very simple test where if the Temperature shows above 33degC Relay 1 turns on at the KC868-H32 relay board's. Both KC868-H32 relay board's and  KC868-COL logical controller are connected via a RS232 cable.

How do show the status of Relay 1 on the KC868-H32 relay board's using a LED on the NodeRed to indicate it's turned "ON"? i don't want to use a Digital in as its a waste of resource. Just a LED on NodeRED reading from the "Function" Node where when its "ON" Led lights up on the NodeRed Screen and when "OFF", LED turns off.

Regards
Subas


RE: Display Relay Status on NodeRed - subas - 10-30-2020

Dear Sir.

As per my above request, is there away to get the Relay Status back in real time and display that on NodeRed? 
What Nodes should i use to get the status displayed?


RE: Display Relay Status on NodeRed - admin - 10-30-2020

Do you means use wall switch for manual control, need update the relay state for Node-Red?


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

(10-30-2020, 08:19 AM)admin Wrote: Do you means use wall switch for manual control, need update the relay state for Node-Red?

Dear Sir.

let me give an example.

If my KC868-H32 relay board is 100meters away and I am in the office. On my NodeRed interface, I have a screen that is showing the Relay buttons. When I click the button 1 it then turn "ON" relay 1. But, how do I know that the relay is actually turned "ON"? 

Is there a way to find out the status of the KC868-H32 relay board to which relay is turned on? 
If I physically walk 100 meters to the relay board controller then I can see the "Red" light where then I know its turned "ON" but walking 100 meters there to verify if the relay 1 is "ON" is un-logic.


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

OK, i see. There are two way to read the relay state.

1: Send read relay state to KC868 relay controller by "TCP OUT" node. Then will return the state string, you can use "TCP IN" node analysis relay is ON/OFF, then make an LED ON/OFF in Node-Red.

2: Way-1 is use software query mode, if you want physically read relay state, that need put wire from relay output back to your office, that need 100 meter line, I think it's hard to do it.


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

Protocol: https://www.kincony.com/smart-controller-development-protocol.html

2.Read status of one relay:
Send: RELAY-READ-255,x (x is the channel of Relay)
Feedback: RELAY-READ-255,x (x is the channel of Relay), y ( status 0 / 1), OK/ERROR

5.Read all relays status by one command:
Send: RELAY-STATE-255
Feedback:RELAY-STATE-255,D3,D2,D1,D0,OK/ERROR


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

(11-01-2020, 01:09 AM)admin Wrote: Protocol:  https://www.kincony.com/smart-controller-development-protocol.html

2.Read status of one relay:
Send: RELAY-READ-255,x  (x is the channel of Relay)
Feedback: RELAY-READ-255,x (x is the channel of Relay), y ( status 0 / 1), OK/ERROR

5.Read all relays status by one command:
Send: RELAY-STATE-255
Feedback:RELAY-STATE-255,D3,D2,D1,D0,OK/ERROR

Dear Admin.

Thank you for your feedback. i will try this.


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

(11-04-2020, 02:31 PM)subas Wrote:
(11-01-2020, 01:09 AM)admin Wrote: Protocol:  https://www.kincony.com/smart-controller-development-protocol.html

2.Read status of one relay:
Send: RELAY-READ-255,x  (x is the channel of Relay)
Feedback: RELAY-READ-255,x (x is the channel of Relay), y ( status 0 / 1), OK/ERROR

5.Read all relays status by one command:
Send: RELAY-STATE-255
Feedback:RELAY-STATE-255,D3,D2,D1,D0,OK/ERROR

Dear Admin.

Thank you for your feedback. i will try this.
Dear Admin

i am having some issue.
How to i make the LED light turn "ON" or "OFF" to show the status of the relay?
i have tried using the "TCP IN" Node and i can get the status of the relay if its turn ON or OFF as per my screen shot attached.
But. how can i turn that LED ON to show the ON status of the relay and LED OFF to show the OFF status of the relay? i am not sure which node to use?


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

if you want to query the relay state, you need send query command by "TCP OUT":
A.Read status of one relay:Send: RELAY-READ-255,x (x is the channel of Relay)
B.Read all relays status by one command:Send: RELAY-STATE-255

Then controller will feedback the state and use "TCP IN" to read , let your LED on/off.

But i think only two way will change the relay state (1: by your software 2: by wall switch from switch terminal board)
if by way-1 , you already can deal with it. way-2, when manual control by switch terminal board, it not need you send query command, controller will auto send message to Node-Red, whick button is pressed, and now is ON or OFF.
it will feedback command like this:
RELAY-KEY-255,x,1,OK (x is the channel of Relay, 1 is ON, 0 is OFF)


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

   
[Image: examples.png]
you can install "node-red-contrib-ui-led" node. like this.