Please be aware that this is a legacy version of the support site. If you have software version 3.1.30 or higher go to MODERN Home

(Classic) Integration with AV system over TCP/IP protocol

The integration with the AV system using TCP/IP enables you to control the lighting, blinds and pull-down screens within your office space. It allows for advanced lighting scene control used in spaces like conference rooms, lecture halls and schools.
 

Flow

[{"id":"df9465cd.815ae8","type":"tab","label":"Audio/Video System over TCP/IP","disabled":false,"info":""},{"id":"2d6d1e9b.53e212","type":"tcp in","z":"df9465cd.815ae8","name":"Listening on port 3100","server":"server","host":"10.0.6.50","port":"3100","datamode":"stream","datatype":"utf8","newline":"","topic":"","base64":false,"x":160,"y":280,"wires":[["99760983.b23ec8"]]},{"id":"1eeed119.55e54f","type":"switch","z":"df9465cd.815ae8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"4","vt":"str"},{"t":"eq","v":"5","vt":"str"},{"t":"eq","v":"6","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":670,"y":280,"wires":[["c331af0d.e480a"],["526790c4.76257"],["bfb59be6.ba4338"],["bb19ccad.dc48c"],["a6372d45.90b9b"],["354e9651.8ba36a"],["9792c80a.3ee288"]]},{"id":"526790c4.76257","type":"vertex action","z":"df9465cd.815ae8","name":"ON 80%","typeButton":"single","bPayload":{"action":"setbrightness","group":null,"param":"80","priority":"254"},"bState":"","defaultpriority":true,"x":930,"y":200,"wires":[["539e493b.95d5b8"]]},{"id":"bfb59be6.ba4338","type":"vertex action","z":"df9465cd.815ae8","name":"Preset 1 0%","typeButton":"single","bPayload":{"action":"setbrightness","group":null,"param":"0","priority":"254"},"bState":"","defaultpriority":true,"x":940,"y":240,"wires":[["539e493b.95d5b8"]]},{"id":"bb19ccad.dc48c","type":"vertex action","z":"df9465cd.815ae8","name":"Preset 2 25%","typeButton":"single","bPayload":{"action":"setbrightness","group":null,"param":"25","priority":"254"},"bState":"","defaultpriority":true,"x":950,"y":280,"wires":[["539e493b.95d5b8"]]},{"id":"a6372d45.90b9b","type":"vertex action","z":"df9465cd.815ae8","name":"Preset 3 50%","typeButton":"single","bPayload":{"action":"setbrightness","group":null,"param":"50","priority":"254"},"bState":"","defaultpriority":true,"x":950,"y":320,"wires":[["539e493b.95d5b8"]]},{"id":"354e9651.8ba36a","type":"vertex action","z":"df9465cd.815ae8","name":"Preset 4 75%","typeButton":"single","bPayload":{"action":"setbrightness","group":null,"param":"75","priority":"254"},"bState":"","defaultpriority":true,"x":950,"y":360,"wires":[["539e493b.95d5b8"]]},{"id":"9792c80a.3ee288","type":"vertex action","z":"df9465cd.815ae8","name":"Preset 5 100%","typeButton":"single","bPayload":{"action":"setbrightness","group":null,"param":"100","priority":"254"},"bState":"","defaultpriority":true,"x":950,"y":400,"wires":[["539e493b.95d5b8"]]},{"id":"2004d106.91b74e","type":"inject","z":"df9465cd.815ae8","name":"OFF","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":350,"y":600,"wires":[["b58ab5b9.855108"]]},{"id":"75fa8f85.63a","type":"inject","z":"df9465cd.815ae8","name":"ON","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":350,"y":640,"wires":[["b58ab5b9.855108"]]},{"id":"57de2e04.e8d69","type":"inject","z":"df9465cd.815ae8","name":"Preset 1 0%","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2","payloadType":"num","x":370,"y":680,"wires":[["b58ab5b9.855108"]]},{"id":"f15e03a7.04084","type":"inject","z":"df9465cd.815ae8","name":"Preset 2 25%","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"num","x":370,"y":720,"wires":[["b58ab5b9.855108"]]},{"id":"8b71e05c.57cb2","type":"inject","z":"df9465cd.815ae8","name":"Preset 3 50%","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"4","payloadType":"num","x":370,"y":760,"wires":[["b58ab5b9.855108"]]},{"id":"cd557d6f.27f1c","type":"inject","z":"df9465cd.815ae8","name":"Preset 4 75%","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"5","payloadType":"num","x":370,"y":800,"wires":[["b58ab5b9.855108"]]},{"id":"88b7299d.9e77e8","type":"inject","z":"df9465cd.815ae8","name":"Preset 5 100%","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"6","payloadType":"num","x":380,"y":840,"wires":[["b58ab5b9.855108"]]},{"id":"c331af0d.e480a","type":"vertex action","z":"df9465cd.815ae8","name":"OFF","typeButton":"single","bPayload":{"action":"setbrightness","group":null,"param":"0","priority":"254"},"bState":"","defaultpriority":true,"x":920,"y":160,"wires":[["539e493b.95d5b8"]]},{"id":"3b5680e2.64f08","type":"vertex action","z":"df9465cd.815ae8","name":"Dimm","typeButton":"dimm","bPayload":{"DON":{"action":"noreact","group":null,"param":null,"priority":"254"},"HOLDUP":{"action":"upaction","group":null,"param":null,"priority":"254"},"HOLDDOWN":{"action":"downaction","group":null,"param":null,"priority":"254"},"DOFF":{"action":"noreact","group":null,"param":null,"priority":"254"}},"bState":false,"defaultpriority":true,"x":920,"y":460,"wires":[["539e493b.95d5b8"]]},{"id":"66580d3d.1865c4","type":"function","z":"df9465cd.815ae8","name":"Dimm Up/Down","func":"\nif(msg.payload==14)\n{\n msg.payload= { \"HOLDUP\" : 1 };\n return msg;\n}\nelse if(msg.payload==15)\n{\n msg.payload= { \"HOLDUP\" : 2 };\n return msg;\n}\nelse if(msg.payload==16)\n{\n msg.payload= { \"HOLDDOWN\" : 1 };\n return msg;\n}\nelse if(msg.payload==17)\n{\n msg.payload= { \"HOLDDOWN\" : 2 };\n return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":460,"wires":[["3b5680e2.64f08"]]},{"id":"fbb2cf4d.7d254","type":"inject","z":"df9465cd.815ae8","name":"Stop Dimm up","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"15","payloadType":"num","x":370,"y":980,"wires":[["b58ab5b9.855108"]]},{"id":"b34690b5.60988","type":"inject","z":"df9465cd.815ae8","name":"Stop Dimm down","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"17","payloadType":"num","x":380,"y":1020,"wires":[["b58ab5b9.855108"]]},{"id":"b58ab5b9.855108","type":"tcp out","z":"df9465cd.815ae8","host":"10.0.6.69","port":"3100","beserver":"client","base64":false,"end":false,"name":"Broadcast on port 3100 10.0.6.69","x":840,"y":780,"wires":[]},{"id":"110bf57a.cfb9ab","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 0","info":"","x":160,"y":600,"wires":[]},{"id":"34e4987c.075608","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 1","info":"","x":160,"y":640,"wires":[]},{"id":"955dad61.d0478","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 2","info":"","x":160,"y":680,"wires":[]},{"id":"172aa76e.105a69","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 3","info":"","x":160,"y":720,"wires":[]},{"id":"23c38344.45cd5c","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 4","info":"","x":160,"y":760,"wires":[]},{"id":"121b504e.d2c0e","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 5","info":"","x":160,"y":800,"wires":[]},{"id":"3cbc3e1b.8d2fb2","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 6","info":"","x":160,"y":840,"wires":[]},{"id":"ccb267c4.5d8b28","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 15","info":"","x":170,"y":980,"wires":[]},{"id":"bb4dbc96.cbed3","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 17","info":"","x":170,"y":1020,"wires":[]},{"id":"5773b441.c135cc","type":"comment","z":"df9465cd.815ae8","name":"Configure the transmitting node","info":"","x":830,"y":740,"wires":[]},{"id":"b674f6b4.de9bd8","type":"comment","z":"df9465cd.815ae8","name":"Configure the receiving node","info":"","x":160,"y":240,"wires":[]},{"id":"cdf9ab14.a4eb68","type":"comment","z":"df9465cd.815ae8","name":"Set brightness level","info":"","x":930,"y":120,"wires":[]},{"id":"7aa28278.12128c","type":"comment","z":"df9465cd.815ae8","name":"Direct logic to only one Vertex","info":"","x":440,"y":240,"wires":[]},{"id":"8d9032f3.4c17e","type":"inject","z":"df9465cd.815ae8","name":"Dimm down","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"16","payloadType":"num","x":370,"y":940,"wires":[["b58ab5b9.855108"]]},{"id":"f6a56cbb.e4a29","type":"inject","z":"df9465cd.815ae8","name":"Dimm up","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"14","payloadType":"num","x":360,"y":900,"wires":[["b58ab5b9.855108"]]},{"id":"137aaea4.9c01e1","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 14","info":"","x":170,"y":900,"wires":[]},{"id":"15011a01.e20b76","type":"comment","z":"df9465cd.815ae8","name":"msg.payload = 16","info":"","x":170,"y":940,"wires":[]},{"id":"539e493b.95d5b8","type":"vertex cluster","z":"df9465cd.815ae8","rate":5,"x":1200,"y":280,"wires":[]},{"id":"99760983.b23ec8","type":"vertex filterByVertex","z":"df9465cd.815ae8","selectedVertex":"10.0.6.51","x":400,"y":280,"wires":[["1eeed119.55e54f","66580d3d.1865c4"]]}]

Instructions

  1. Find the following nodes:

  • tcp in

  • Filter by Vertex

  • switch

  • vertex action x8

  • function

  • vertex Cluster

 

2. In the tcp in node properties, select Type: Listen on and specify the port number for communication. Determine the Output as stream of String.

3. Go to the Filter by Vertex node and choose the correct Vertex controller as a message source.

 

4. Configure the switch node’s conditions as an example shown below:

Each payload value corresponds to different brightness level preset. Specify different payloads and switching logic that matches your demands (e.g. setting brightness level using direct input value or triggering scenes).

5. Go to the function node properties tab and configure it accordingly. Paste the code in On Message tab. The code will be executed every time there is an input message (trigger).

if(msg.payload==14) { msg.payload= { "HOLDUP" : 1 }; return msg; } else if(msg.payload==15) { msg.payload= { "HOLDUP" : 2 }; return msg; } else if(msg.payload==16) { msg.payload= { "HOLDDOWN" : 1 }; return msg; } else if(msg.payload==17) { msg.payload= { "HOLDDOWN" : 2 }; return msg; }

 

6. Find the Vertex action nodes:

7. Go to the Vertex action node and set the Mode field as Single button. Next, in the Action field, choose Set brightness as an action. Using the slider in Brightness field set the value of your choice (e.g. 0 - off, 100 - max luminaire brightness).

Example configuration:

 

The vertex action node responsible for the dimming process has a different configuration:

8. Find the Inject and tcp out nodes

 

9. Use the inject nodes as test triggers for your flow. For now, use 11 of them, 7 for brightness and 4 for dimming control.

10. Configure the nodes as shown. Note that, each Inject node has a different payload value.

 

11. Find the tcp out node

12. In the properties tab, select Type: Connect to and specify the port number you wish to use for communication. Enter the host controller ip address.

 

13. Connect all nodes as shown in the picture at the beginning of the article and click Deploy. You can test your flow using debug node.