/
Examples of typical programs

Examples of typical programs

Below you have a database of typical programs ready to import during commissioning. Read instructions on how to import programs into your project here.

Remember that after importing the program from the list of programs below, you must configure it for your installation. 

List of programs

Sending information about the light intensity to the BMS 

[{"id":"b6999ee0.9f51f","type":"comment","z":"7400871b.0e1298","name":"Choose light sensor","info":"","x":210,"y":200,"wires":[]},{"id":"f3a7ef27.34ce3","type":"lightsensors","z":"7400871b.0e1298","name":"Light sensor","uid":"FC9E21087BFD7461","x":230,"y":260,"wires":[["ca77b833.89928"]]},{"id":"ca77b833.89928","type":"change","z":"7400871b.0e1298","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.LUX","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":260,"wires":[["743410e7.196f3"]]},{"id":"26dde044.501fe","type":"modbus-write","z":"7400871b.0e1298","name":"Register: 500","showStatusActivities":false,"showErrors":false,"unitid":"admin","dataType":"HoldingRegister","adr":"500","quantity":"1","server":"c5a231d8.689ae","x":780,"y":260,"wires":[[],[]]},{"id":"743410e7.196f3","type":"rbe","z":"7400871b.0e1298","name":"","func":"rbe","gap":"","start":"","inout":"out","x":620,"y":260,"wires":[["26dde044.501fe"]]},{"id":"2aa6eaf0.af4496","type":"comment","z":"7400871b.0e1298","name":"Select Vertex's IP register number","info":"","x":820,"y":200,"wires":[]},{"id":"276cff0a.8b3888","type":"comment","z":"7400871b.0e1298","name":"Sending information about the light intensity to the BMS","info":"","x":560,"y":140,"wires":[]},{"id":"c5a231d8.689ae","type":"modbus-client","z":"","name":"IP_Vertexa","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"10.0.12.254","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectTimeout":"2000"}]

The above flow shows how to send information from the light sensor (dali2devs node) to the BMS via NodeRED. Change Node sets payload to payload.LUX. This means that it only transmits information about the illuminance level. This information is filtered by rbe node which will only send payload further if its different from previous, so if illuminance has changed this will pass payload further. After that it goes to BMS to revelant vertex by IP address and port number.

Group control 0-100 with BMS - when there is only one Vertex

[{"id":"dff8e3cb.ca5bd8","type":"vertex action","z":"7400871b.0e1298","name":"Grupa1","typeButton":"directv","bPayload":{"action":"setbrightness","group":"6a96a1eef91dff3a1a5dc9f9b6b23af5","param":0,"priority":"254"},"bState":"","defaultpriority":true,"x":670,"y":480,"wires":[["a5fc677a.cf8c18"]]},{"id":"650fe153.51edd8","type":"vertexmodbus","z":"7400871b.0e1298","name":"","registers":[{"r":"111","i":0}],"outputs":1,"x":320,"y":480,"wires":[["5c20fd8e.791664"]]},{"id":"5c20fd8e.791664","type":"switch","z":"7400871b.0e1298","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":510,"y":480,"wires":[["dff8e3cb.ca5bd8"]]},{"id":"a5fc677a.cf8c18","type":"link out","z":"7400871b.0e1298","name":"Do Vertex Cluster","links":["3a9d1153.3c884e"],"x":855,"y":480,"wires":[]},{"id":"803960fe.cda748","type":"comment","z":"7400871b.0e1298","name":"Select a control group (GR1)","info":"","x":700,"y":420,"wires":[]},{"id":"1d79a1f1.e64dbe","type":"comment","z":"7400871b.0e1298","name":"Select register number (+1) for group control","info":"","x":290,"y":420,"wires":[]},{"id":"1df7c6d9.313de1","type":"comment","z":"7400871b.0e1298","name":"Group control 0-100 with BMS - when there is only one Vertex","info":"","x":520,"y":360,"wires":[]}]

This flow is for when we have only one node on site. First node (dali2devs) selects register number for group control and next switch node pushes forward payload for values less than or equal to 100. Next vertex action node sets brightness by direct value on selected group.

Feedback to BMS on the status of the group

[{"id":"fb5393a6.b3259","type":"vertex feedback","z":"f2072421.06b2e8","name":"Grupa 1","primarygroup":"6a96a1eef91dff3a1a5dc9f9b6b23af5","sendOnChange":true,"x":220,"y":500,"wires":[["f971de33.cc7b1"]]},{"id":"f971de33.cc7b1","type":"function","z":"f2072421.06b2e8","name":"","func":"var tmp;\nfor(var gr in msg.payload){\n\ttmp = msg.payload[gr].value\n}\nmsg.payload = tmp\n\nif(msg.payload!==null )\n{\nif(msg.payload==254)\n msg.payload=253;\n var valueDec = Math.pow(10,(((msg.payload-1)/84)-1));\n msg.payload =Math.round(valueDec);\n return msg;\n\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":500,"wires":[["89edd318.15518"]]},{"id":"89edd318.15518","type":"rbe","z":"f2072421.06b2e8","name":"","func":"rbe","gap":"","start":"","inout":"out","x":730,"y":500,"wires":[["b5474f8.852efb"]]},{"id":"b5474f8.852efb","type":"modbus-write","z":"f2072421.06b2e8","name":"Register: 820","showStatusActivities":false,"showErrors":false,"unitid":"admin","dataType":"HoldingRegister","adr":"820","quantity":"1","server":"1a9aaf8.230b951","emptyMsgOnFail":false,"keepMsgProperties":false,"x":950,"y":500,"wires":[[],[]]},{"id":"5ef959b9.2284a8","type":"comment","z":"f2072421.06b2e8","name":"Configure the Modbus server and select the register (0-1000)","info":"","x":1080,"y":460,"wires":[]},{"id":"903f318b.942cd","type":"comment","z":"f2072421.06b2e8","name":"Select a group for feedback (GR1)","info":"","x":280,"y":460,"wires":[]},{"id":"785e3d6d.b805f4","type":"comment","z":"f2072421.06b2e8","name":"Feedback to BMS on the status of the group","info":"","x":610,"y":460,"wires":[]},{"id":"1a9aaf8.230b951","type":"modbus-client","name":"IP_Vertexa","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"10.0.12.254","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectTimeout":"2000"}]

Besides, we can transfer information about light illuminance, and we can also send general statuses to the BMS. To do that, we will need the vertex feedback node to get information from the device on-site and the function node to convert the JSON code into BMS information. As in the previous case, we will need the rbe node to send only this payload which is different from the previous one.

Feedback to BMS on the status of the group - when you have multiple Vertexes on site

[{"id":"797c527c.5c317c","type":"vertex feedback","z":"f2072421.06b2e8","name":"Grupa 1","primarygroup":"6a96a1eef91dff3a1a5dc9f9b6b23af5","sendOnChange":true,"x":140,"y":840,"wires":[["1c3d4bc9.c318dc"]]},{"id":"6b47811.b6b17","type":"function","z":"f2072421.06b2e8","name":"","func":"var tmp;\nfor(var gr in msg.payload){\n\ttmp = msg.payload[gr].value\n}\nmsg.payload = tmp\n\nif(msg.payload!==null )\n{\nif(msg.payload==254)\n msg.payload=253;\n var valueDec = Math.pow(10,(((msg.payload-1)/84)-1));\n msg.payload =Math.round(valueDec);\n return msg;\n\n}\n","outputs":1,"noerr":0,"x":750,"y":840,"wires":[["4b2af1ad.09fac"]]},{"id":"4b2af1ad.09fac","type":"rbe","z":"f2072421.06b2e8","name":"","func":"rbe","gap":"","start":"","inout":"out","x":950,"y":840,"wires":[["4ae366c1.c61c78"]]},{"id":"4ae366c1.c61c78","type":"modbus-write","z":"f2072421.06b2e8","name":"Register 645","showStatusActivities":false,"showErrors":false,"unitid":"admin","dataType":"HoldingRegister","adr":"645","quantity":"1","server":"2f279e92.4cc012","emptyMsgOnFail":false,"keepMsgProperties":false,"x":1150,"y":840,"wires":[[],[]]},{"id":"b293800c.8266c8","type":"comment","z":"f2072421.06b2e8","name":"Configure the Modbus server and select the register (0-1000)","info":"","x":1180,"y":800,"wires":[]},{"id":"c707b74c.873cd8","type":"comment","z":"f2072421.06b2e8","name":"Select a group for feedback (GR1)","info":"","x":200,"y":800,"wires":[]},{"id":"1c3d4bc9.c318dc","type":"vertex filterByVertex","z":"f2072421.06b2e8","selectedVertex":"10.199.1.15","x":480,"y":840,"wires":[["6b47811.b6b17"]]},{"id":"69d8944b.8193cc","type":"comment","z":"f2072421.06b2e8","name":"Select the Vertex IP to control the group","info":"","x":510,"y":800,"wires":[]},{"id":"613931fb.bb4a48","type":"comment","z":"f2072421.06b2e8","name":"Feedback to BMS on the status of the group","info":"","x":790,"y":780,"wires":[]},{"id":"2f279e92.4cc012","type":"modbus-client","name":"IP_Vertexa","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"10.0.12.254","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectTimeout":"2000"}]

This example shows exactly the same as sending feedback on the status of the group but in this case we have multiple vertexes and we need to filter them somehow. To do that we can use vertex feedback node and select vertex IP address to which the device is connected.

Group control in the range 0-100 with BMS - when there are several Vertexes

[{"id":"75021f8c.7e7328","type":"comment","z":"7400871b.0e1298","name":"Group control in the range 0-100 with BMS - when there are several Vertexes ","info":"","x":650,"y":780,"wires":[]},{"id":"99fbbae.cd2f248","type":"vertex action","z":"7400871b.0e1298","name":"Grupa1","typeButton":"directv","bPayload":{"action":"setbrightness","group":"6a96a1eef91dff3a1a5dc9f9b6b23af5","param":0,"priority":"254"},"bState":"","defaultpriority":true,"x":930,"y":900,"wires":[["e9a93cd0.4cd178"]]},{"id":"d6a2accf.97166","type":"vertexmodbus","z":"7400871b.0e1298","name":"","registers":[{"r":"111","i":0}],"outputs":1,"x":260,"y":900,"wires":[["93beef5c.47b5b"]]},{"id":"37b1ac1a.9dd05c","type":"switch","z":"7400871b.0e1298","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":900,"wires":[["99fbbae.cd2f248"]]},{"id":"e9a93cd0.4cd178","type":"link out","z":"7400871b.0e1298","name":"Do Vertex Cluster","links":["3a9d1153.3c884e"],"x":1115,"y":900,"wires":[]},{"id":"bff1863a.c7c4d","type":"comment","z":"7400871b.0e1298","name":"Select the group to control (GR1)","info":"","x":970,"y":840,"wires":[]},{"id":"6e22e126.9d83d8","type":"comment","z":"7400871b.0e1298","name":"Select register number (+1) for group control","info":"","x":230,"y":840,"wires":[]},{"id":"93beef5c.47b5b","type":"vertex filterByVertex","z":"7400871b.0e1298","selectedVertex":"10.0.12.254","x":520,"y":900,"wires":[["37b1ac1a.9dd05c"]]},{"id":"49608d16.7d9054","type":"comment","z":"7400871b.0e1298","name":"Select the Vertex's IP to control the group","info":"","x":580,"y":840,"wires":[]}]

When we have several vertexes on site and we want to have group control in range 0-100 with BMS. We should use Filter by Vertex node to insert IP address for vertexes devices groups we want to control.

Group control through BMS scenes - when there are several Vertexes

[{"id":"b27e3596.ef8348","type":"vertex action","z":"7400871b.0e1298","name":"GR1","typeButton":"single","bPayload":{"action":"recallscene","group":"6a96a1eef91dff3a1a5dc9f9b6b23af5","param":"2","priority":"254"},"bState":"","defaultpriority":true,"x":860,"y":1340,"wires":[["5981856a.a113b4"]]},{"id":"fd6e5973.180cf8","type":"vertexmodbus","z":"7400871b.0e1298","name":"","registers":[{"r":"111","i":0}],"outputs":1,"x":200,"y":1360,"wires":[["a1d46afe.7b74"]]},{"id":"54309834.bf8158","type":"switch","z":"7400871b.0e1298","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":1360,"wires":[["b27e3596.ef8348"],["7cd2ac3d.f3c544"]]},{"id":"a1d46afe.7b74","type":"vertex filterByVertex","z":"7400871b.0e1298","selectedVertex":"10.0.12.254","x":440,"y":1360,"wires":[["54309834.bf8158"]]},{"id":"7cd2ac3d.f3c544","type":"vertex action","z":"7400871b.0e1298","name":"GR1","typeButton":"single","bPayload":{"action":"recallscene","group":null,"param":"12","priority":"254"},"bState":"","defaultpriority":true,"x":860,"y":1380,"wires":[["5981856a.a113b4"]]},{"id":"5981856a.a113b4","type":"link out","z":"7400871b.0e1298","name":"","links":["2f406ad4.313f76"],"x":1015,"y":1360,"wires":[]},{"id":"bdc69b38.dfb668","type":"comment","z":"7400871b.0e1298","name":"Group control through BMS scenes - when there are several Vertexes ","info":"","x":630,"y":1220,"wires":[]},{"id":"2e09f184.876ede","type":"comment","z":"7400871b.0e1298","name":"Select the group to control (GR1) and the scene","info":"","x":1020,"y":1280,"wires":[]},{"id":"4fb338f4.d14cc","type":"comment","z":"7400871b.0e1298","name":"Select register number (+1) for group control","info":"","x":230,"y":1280,"wires":[]},{"id":"de3c5342.9900f","type":"comment","z":"7400871b.0e1298","name":"Select the Vertex's IP to control the group","info":"","x":580,"y":1280,"wires":[]}]

We can control groups by scenes. To do that we need switch node to select one of the scene we want to activate. We have several vertexes in this case so we need to add Filter by Vertex node.

Feedback to the BMS about the status of the group's luminaires (scene controlled)

[{"id":"1e78aeb.f3ae451","type":"function","z":"f2072421.06b2e8","name":"","func":"var tmp;\nfor(var gr in msg.payload){\n\n\tif (msg.payload[gr].valueType ==\"scene\")\n\t{\n tmp = msg.payload[gr].value\n msg.payload = tmp\n return msg;\n\t}\n\t\n}\n\n","outputs":1,"noerr":0,"x":540,"y":1080,"wires":[["6a0f4a6b.03c93c"]]},{"id":"a8e3241.e50d758","type":"modbus-write","z":"f2072421.06b2e8","name":"Register 610","showStatusActivities":false,"showErrors":false,"unitid":"admin","dataType":"HoldingRegister","adr":"610","quantity":"1","server":"abc04e9a.d0ba8","x":1000,"y":1080,"wires":[[],[]]},{"id":"84661523.8119f8","type":"vertex filterByVertex","z":"f2072421.06b2e8","selectedVertex":"10.0.12.254","x":370,"y":1080,"wires":[["1e78aeb.f3ae451"]]},{"id":"5cbeb5ea.a075a4","type":"change","z":"f2072421.06b2e8","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"2","fromt":"num","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"12","fromt":"num","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":1080,"wires":[["a8e3241.e50d758"]]},{"id":"6a0f4a6b.03c93c","type":"switch","z":"f2072421.06b2e8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"12","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":660,"y":1080,"wires":[["5cbeb5ea.a075a4"],["5cbeb5ea.a075a4"]]},{"id":"e6d8cef6.f6e4f8","type":"vertex feedback","z":"f2072421.06b2e8","name":"318","primarygroup":"bf68fe84c780a52411ba59c48e619134","sendOnChange":true,"x":190,"y":1080,"wires":[["84661523.8119f8"]]},{"id":"98639d96.ef733","type":"comment","z":"f2072421.06b2e8","name":"Select a group for feedback (GR1)","info":"","x":230,"y":1020,"wires":[]},{"id":"a4d52d22.f4b348","type":"comment","z":"f2072421.06b2e8","name":"Select the Vertex's IP to control the group","info":"","x":650,"y":1020,"wires":[]},{"id":"550d8e35.6344d","type":"comment","z":"f2072421.06b2e8","name":"Feedback to the BMS about the status of the group's luminaires (scene controlled)","info":"","x":650,"y":960,"wires":[]},{"id":"82b64eda.76a09","type":"comment","z":"f2072421.06b2e8","name":"Select the Vertex's IP register number","info":"","x":1120,"y":1020,"wires":[]},{"id":"abc04e9a.d0ba8","type":"modbus-client","name":"IP_Vertexa","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"10.0.12.254","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectTimeout":"2000"}]

This example shows how our flow can give feedback to BMS about scene status with many vertexes on site. To select group from we want to get an information we should use vertex feedback node and then we can select vertex at Filter by Vertex node. Function node convert payload to select scene information from it and by switch node we can select scene we want to get feedback from. Next the change node changes name to keep our code clear.

Triggering a relay in case of an emergency lighting error (or any other error in Vertex)

[{"id":"9ae218da.bbccb8","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"e2bee68.0ae2e18","type":"modbus-read","z":"9ae218da.bbccb8","name":"","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"","dataType":"InputRegister","adr":"14","quantity":"1","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"f03d0f71.4697","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":170,"y":440,"wires":[["783e490c.d96fd8","28b15f9b.e8bfd"],[]]},{"id":"783e490c.d96fd8","type":"debug","z":"9ae218da.bbccb8","name":"Modbus","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":420,"y":320,"wires":[]},{"id":"28b15f9b.e8bfd","type":"function","z":"9ae218da.bbccb8","name":"emergency_lighting_error_info","func":"msg.payload=msg.payload[0]\nvar count = msg.payload.toString(2);\nvar leng = count.length;\nvar zeros =[];\n\nfor(var i = 0; i <(16-leng); i++)\n{\nzeros = zeros+ \"0\"\n}\ncount=zeros+count;\n\nmsg.payload =count.slice(7, 8)\n//msg.payload =count\nmsg.payload=parseInt(msg.payload)\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":440,"wires":[["28a2b91.bb01a46","769b5cb9.c9dff4"]]},{"id":"28a2b91.bb01a46","type":"switch","z":"9ae218da.bbccb8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":890,"y":460,"wires":[["9d8c11d3.9d2dc"],["e5ce2a1d.cc5788"]]},{"id":"769b5cb9.c9dff4","type":"debug","z":"9ae218da.bbccb8","name":"Funksjon","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":280,"wires":[]},{"id":"9d8c11d3.9d2dc","type":"vertex action","z":"9ae218da.bbccb8","name":"","typeButton":"single","bPayload":{"action":"maxlevel","group":null,"param":null,"priority":"254"},"bState":"","defaultpriority":true,"x":1150,"y":440,"wires":[[]]},{"id":"e5ce2a1d.cc5788","type":"vertex action","z":"9ae218da.bbccb8","name":"","typeButton":"single","bPayload":{"action":"off","group":null,"param":null,"priority":"254"},"bState":"","defaultpriority":true,"x":1150,"y":480,"wires":[[]]},{"id":"1ba1b336.b3ed7d","type":"comment","z":"9ae218da.bbccb8","name":"Configure the modbus server","info":"","x":160,"y":360,"wires":[]},{"id":"c68f378c.62ad08","type":"comment","z":"9ae218da.bbccb8","name":"View the message sent by Modbus read node","info":"","x":490,"y":280,"wires":[]},{"id":"6f701154.b575f","type":"comment","z":"9ae218da.bbccb8","name":"View the message sent by the function node","info":"","x":970,"y":240,"wires":[]},{"id":"92964a63.82cb38","type":"comment","z":"9ae218da.bbccb8","name":"Select the group that contains a DALI-2 relay","info":"","x":1250,"y":400,"wires":[]},{"id":"74d212e.14f5eec","type":"comment","z":"9ae218da.bbccb8","name":"Check the modbus register responsible for emergency lighting","info":"","x":540,"y":400,"wires":[]},{"id":"38310201.1e26ce","type":"comment","z":"9ae218da.bbccb8","name":"1 - error detected, 0 - no error","info":"","x":900,"y":420,"wires":[]},{"id":"113950d6.8cc43f","type":"comment","z":"9ae218da.bbccb8","name":"Don't use the 2nd output","info":"","x":150,"y":400,"wires":[]},{"id":"f03d0f71.4697","type":"modbus-client","name":"IP_Vertexa","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"10.0.6.55","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":false,"reconnectTimeout":2000,"parallelUnitIdsAllowed":false}]

Sometimes when an error occurs, it's good to have something to trigger a relay. To do that, we need to use the Modbus Read node, and then we can configure our Modbus server. It's important to remember that we should use only the first output of this node. From Modbus Read, the payload goes to a function node where it's converted into a message that will be understandable for the switch node, which decides if the error has been detected or not. Debug nodes are only for debugging.

Change the sensor time from the BMS level

[{"id":"f2824476.edf178","type":"function","z":"ced2cf4c.14073","name":"Time from BMS ","func":"msg.payload = {\"t1\":{\"0\":msg.payload}} // 0 - this is the instance number,\n//if there are more PIR sensors, add another instance.\n//Example: { \"payload\" : {\"t1\":{\"0\":msg.payload, \"5\":msg.payload}} \n//We change the time of the sensor to the one sent from the BMS to 0 and 5 instances.\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":380,"wires":[["e4c366ff.f75bb8"]]},{"id":"e4c366ff.f75bb8","type":"DALI2 Devs Common","z":"ced2cf4c.14073","name":"Osram_sesor","outputs":2,"uid":"007DB9D807DD3F90C2","devStatus":2,"devSettings":[{"InstanceType":3,"isDisabled":false,"dali2t1":"10","dali2t2":"40","evenFilters":3,"instanceType":3},{"InstanceType":4,"isDisabled":false,"evenFilters":0,"instanceType":4}],"savedSettings":[{"instanceType":3,"isDisabled":false,"dali2t1":"10","dali2t2":"40","evenFilters":3,"InstanceType":3},{"instanceType":4,"isDisabled":false,"evenFilters":0,"InstanceType":4}],"x":960,"y":380,"wires":[["e070bd85.392f9"],["188284fc.67660b"]]},{"id":"4c591a86.cb56c4","type":"vertexmodbus","z":"ced2cf4c.14073","name":"","registers":[{"r":"12","i":0}],"outputs":1,"x":600,"y":380,"wires":[["f2824476.edf178","6ca5cb6d.d943b4","e90d6091.20dfc"]]},{"id":"e1f88ee9.95e6f","type":"comment","z":"ced2cf4c.14073","name":"Change of presence time in sensor from the BMS level","info":"","x":900,"y":260,"wires":[]},{"id":"e070bd85.392f9","type":"vertex action","z":"ced2cf4c.14073","name":"","typeButton":"motionsensor","bPayload":{"PRESENCE":{"action":"setbrightness","group":"0025c4a4bdbe5876f53e1ab5e61f32ea","param":"100","priority":"255"},"TRANSITION":{"action":"setbrightness","group":"0025c4a4bdbe5876f53e1ab5e61f32ea","param":"50","priority":"0"},"NOPRESENCE":{"action":"setbrightness","group":"0025c4a4bdbe5876f53e1ab5e61f32ea","param":"0","priority":"254"}},"bState":"","defaultpriority":true,"x":1190,"y":380,"wires":[[]]},{"id":"2c2f04e1.b95f9c","type":"comment","z":"ced2cf4c.14073","name":" Choose the register number to which the BMS sends the time for the sensor","info":"","x":710,"y":340,"wires":[]},{"id":"160801b2.d92b4e","type":"inject","z":"ced2cf4c.14073","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":510,"y":440,"wires":[["cc0f532a.3acc5"]]},{"id":"6ca5cb6d.d943b4","type":"change","z":"ced2cf4c.14073","name":"","rules":[{"t":"set","p":"time_sensor_room1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":440,"wires":[["b8c7ea31.217c88"]]},{"id":"b8c7ea31.217c88","type":"modbus-write","z":"ced2cf4c.14073","name":"","showStatusActivities":false,"showErrors":false,"unitid":"","dataType":"HoldingRegister","adr":"511","quantity":"1","server":"25b24d23.a1da82","emptyMsgOnFail":false,"keepMsgProperties":false,"x":1600,"y":440,"wires":[[],[]]},{"id":"b8a49e1e.6a6b6","type":"comment","z":"ced2cf4c.14073","name":"Change the name of the condition to a different one for each room","info":"Change the name of the condition to a different one for each room","x":850,"y":480,"wires":[]},{"id":"827e7a07.679c68","type":"comment","z":"ced2cf4c.14073","name":"feedback for the BMS about the current time","info":"set correct register","x":1590,"y":400,"wires":[]},{"id":"e90d6091.20dfc","type":"ui_numeric","z":"ced2cf4c.14073","name":"","label":" Hold time in second","tooltip":"","group":"754ee25b.5d0e7c","order":0,"width":0,"height":0,"wrap":false,"passthru":false,"topic":"topic","topicType":"msg","format":"{{value}}","min":"60","max":"2540","step":"30","x":510,"y":480,"wires":[["6ca5cb6d.d943b4"]]},{"id":"188284fc.67660b","type":"debug","z":"ced2cf4c.14073","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1210,"y":520,"wires":[]},{"id":"cc0f532a.3acc5","type":"change","z":"ced2cf4c.14073","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"time_sensor_room1","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":440,"wires":[["6ca5cb6d.d943b4","f2824476.edf178","e90d6091.20dfc"]]},{"id":"25b24d23.a1da82","type":"modbus-client","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"10.0.6.51","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true},{"id":"754ee25b.5d0e7c","type":"ui_group","name":"Sensor hold time","tab":"3f4554e9.27d8fc","order":1,"disp":true,"width":"6","collapse":false},{"id":"3f4554e9.27d8fc","type":"ui_tab","name":"hold tim","icon":"dashboard","disabled":false,"hidden":false}]

There is a feature which we can use to change the sensor time from the BMS level. It’s useful when we have access to our system only through BMS.

Related content