Although separate Vertex clusters are two different lighting systems, we still have some ways to send information between their Node-REDs. In this way, we can e.g. trigger the lighting on groups that are in a different cluster than the wall panel is. We do that by using the TCP/IP protocol and dedicated Node-RED nodes (TCP).
Prerequisites
Vertex clusters have to be physically connected within the same LAN network to allow for sending data between Node-REDs.
Vertex controllers still must be in the same network e.g. Vertex IP’s should be 10.0.6.XX.
Example: We are sending a command from Vertex 2 which is in cluster 1 to Vertex 3 which is in Cluster 2. You should set IPs e.g. 10.0.6.50 for Vertex 2 and 10.0.6.85 for Vertex 3.
Flow
Sending messages via TCP
[{"id":"a4cf968d.6ffd3","type":"tcp out","z":"7f5faf37.f5792","host":"10.0.6.50","port":"4700","beserver":"client","base64":false,"end":false,"name":"","x":670,"y":260,"wires":[]},{"id":"e4a930e4.fc40b","type":"inject","z":"7f5faf37.f5792","name":"","topic":"","payload":"100","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":260,"wires":[["a4cf968d.6ffd3"]]},{"id":"a05052d2.74551","type":"inject","z":"7f5faf37.f5792","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":300,"wires":[["a4cf968d.6ffd3"]]}]
Receiving messages via TCP
[{"id":"1100c93d.3afbc7","type":"tcp in","z":"fd4e3895.5784f8","name":"","server":"server","host":"","port":"4700","datamode":"stream","datatype":"utf8","newline":"","topic":"","base64":false,"x":180,"y":480,"wires":[["58b48c45.9aae4c","fbb070f0.34c948"]]},{"id":"58b48c45.9aae4c","type":"debug","z":"fd4e3895.5784f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":380,"y":540,"wires":[]},{"id":"fbb070f0.34c948","type":"vertex action","z":"fd4e3895.5784f8","name":"","typeButton":"directv","bPayload":{"action":"setbrightness","group":"99b17e88a1df372900ab36b205b10059","param":0,"priority":"254"},"bState":"","defaultpriority":true,"x":550,"y":480,"wires":[["76a1a1a4.fcbf88"]]},{"id":"76a1a1a4.fcbf88","type":"vertex cluster","z":"fd4e3895.5784f8","userouting":false,"rate":5,"x":810,"y":480,"wires":[]}]
Instructions
Configure the TCP connection - Vertex that is sending messages
Open the Node-RED for the Vertex that will be sending data to another cluster.
In the Node Palette, find the TCP node from the Output section.
Enter the node and select Type as Connect to and select port e.g. 4700. As a host, enter the Vertex IP to which you are sending messages.
Ports 1024-49151 are called user or registered ports and you can check the list of them to make sure that the TCP port is vacant and ready to use. We used 4700 because no other application uses that port.
4. Use two inject nodes for sending two different messages to the other cluster.
You can send any messages via TCP eg. from the dali2devs common node, dashboard nodes like slider, light scheduler etc.
0 Comments