BACnet write property

Hi All
New to Raspberry PI and Node Red.
I have been playing all day and trying to integrate a BMS controller and a Pi together for home automation via BACnet (node-red-contrib-bacnet)

I have managed to get the read property working well but can not get the write property to operate. I have had a read through a few other forums and someone posted a Flow with the BACnet incorporated in the function blocks. But even when I use that I get an error Bacnet1 is not a function. The Flow link with the BACnet in the function is here.
[{"id":"15d5e7ae.0b9148","type":"function","z":"d0970a11.9662b8","name":"Boiler 1","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 4, instance: 0}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 4, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":280,"y":60,"wires":[[]]},{"id":"27f92a04.56b936","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":40,"wires":[["15d5e7ae.0b9148"]]},{"id":"7f877b3.3445c84","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":100,"wires":[["15d5e7ae.0b9148"]]},{"id":"f40377fd.dd75f8","type":"function","z":"d0970a11.9662b8","name":"Boiler 2","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 4, instance: 1}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 4, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":280,"y":180,"wires":[[]]},{"id":"7aa2b124.d3db","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":160,"wires":[["f40377fd.dd75f8"]]},{"id":"be93d9b0.4de308","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":200,"wires":[["f40377fd.dd75f8"]]},{"id":"2b65c434.8ee3ec","type":"function","z":"d0970a11.9662b8","name":"Analogue 1","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 1, instance: 0}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 1, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":467,"y":61,"wires":[[]]},{"id":"75607c38.ac6404","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"10","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":292,"y":24,"wires":[["2b65c434.8ee3ec"]]},{"id":"dc7a52e9.efd78","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":287,"y":100,"wires":[["2b65c434.8ee3ec"]]},{"id":"11fb3606.4d6c7a","type":"function","z":"d0970a11.9662b8","name":"Boiler 3","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 4, instance: 2}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 4, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":284,"y":291,"wires":[[]]},{"id":"b1d62ce7.c4434","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":260,"wires":[["11fb3606.4d6c7a"]]},{"id":"212d8c97.fa9ee4","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":300,"wires":[["11fb3606.4d6c7a"]]},{"id":"cd813c35.41c17","type":"function","z":"d0970a11.9662b8","name":"Boiler 4","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 4, instance: 3}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 4, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":280,"y":360,"wires":[[]]},{"id":"c9f1d2bf.e935d","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":340,"wires":[["cd813c35.41c17"]]},{"id":"8f64972e.6ae098","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":380,"wires":[["cd813c35.41c17"]]},{"id":"4ef5aaf0.92a8e4","type":"function","z":"d0970a11.9662b8","name":"Boiler 5","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 4, instance: 4}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 4, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":280,"y":440,"wires":[[]]},{"id":"c3863c40.8f205","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":420,"wires":[["4ef5aaf0.92a8e4"]]},{"id":"ddee3441.835ef8","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":460,"wires":[["4ef5aaf0.92a8e4"]]},{"id":"bc8cf13e.f5194","type":"function","z":"d0970a11.9662b8","name":"Boiler 6","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 4, instance: 5}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 4, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":280,"y":520,"wires":[[]]},{"id":"9489f179.b2f2a","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":500,"wires":[["bc8cf13e.f5194"]]},{"id":"80b506a.08ddcf8","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":540,"wires":[["bc8cf13e.f5194"]]},{"id":"11758318.19362d","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"8.2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":286,"y":140,"wires":[["202850e7.21513"]]},{"id":"c79384bd.06bdd8","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":289,"y":219,"wires":[["202850e7.21513"]]},{"id":"202850e7.21513","type":"function","z":"d0970a11.9662b8","name":"Analogue 2","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 1, instance: 1}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 1, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":476,"y":177,"wires":[[]]},{"id":"3a9d3099.c845b","type":"function","z":"d0970a11.9662b8","name":"Analogue 3","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 1, instance: 2}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 1, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":484,"y":284,"wires":[[]]},{"id":"971ea5c7.8c0af8","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"8.2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":286,"y":254,"wires":[["3a9d3099.c845b"]]},{"id":"8a99a4ee.efb818","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":325,"wires":[["3a9d3099.c845b"]]},{"id":"80cc3e75.4dc4c","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"8.2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":289,"y":399,"wires":[["a576534f.8e20e"]]},{"id":"ef0eac12.cbebd","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":286,"y":477,"wires":[["a576534f.8e20e"]]},{"id":"a576534f.8e20e","type":"function","z":"d0970a11.9662b8","name":"Analogue 4","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 1, instance: 3}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 1, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":475,"y":368,"wires":[[]]},{"id":"ef566857.021028","type":"function","z":"d0970a11.9662b8","name":"Analogue 5","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 1, instance: 4}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 1, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":480,"y":447,"wires":[[]]},{"id":"fb3d2b91.ff6d88","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"8.2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":288,"y":559,"wires":[["ef566857.021028"]]},{"id":"93594f0d.1e291","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":288,"y":600,"wires":[["ef566857.021028"]]},{"id":"a1291bf2.db1af8","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"8.2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":291,"y":645,"wires":[["f681da4d.132e08"]]},{"id":"3fa05726.ff0778","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":687,"wires":[["f681da4d.132e08"]]},{"id":"f681da4d.132e08","type":"function","z":"d0970a11.9662b8","name":"Analogue 6","func":"//var msg = {};\nconst bacnet1 = global.get('bacnet');\n// Initialize BACStack\nvar client = bacnet1({adpuTimeout: 6000});\nvar state = msg.payload;\n\nconst values = [\n {objectId: {type: 1, instance: 5}, values: [\n {property: {id: 85, index: 4294967295}, value: [{type: bacnet1.enum.ApplicationTags.BACNET_APPLICATION_TAG_REAL, value: state}], priority: 15}\n ]}\n];\nclient.writePropertyMultiple('192.168.1.135', values, (err, value) => {\n msg.payload = {value: value} ;\n \n if(err) { msg.payload = {error: err} ; }\n node.send(msg);\n});\n\nclient.readProperty('192.168.1.135', {type: 1, instance: 0}, 85, (err, value) => {\n msg.payload = {value: value} ;\n node.send(msg);\n})\n\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":475,"y":539,"wires":[[]]},{"id":"2ed8233c.85b35c","type":"BACnet-Read","z":"d0970a11.9662b8","name":"Boiler1 Temp","objectType":"0","objectInstance":"9","propertyId":"85","arrayIndex":"4294967295","deviceIPAddress":"192.168.1.135","server":"89bad991.cc9dd8","multipleRead":false,"x":668,"y":114,"wires":[["e04f9eca.e7aef"]]},{"id":"5b501d8e.4b2514","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":477,"y":114,"wires":[["2ed8233c.85b35c"]]},{"id":"e04f9eca.e7aef","type":"change","z":"d0970a11.9662b8","name":"Boiler 1 Temp","rules":[{"t":"move","p":"payload.values.0.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":849,"y":112,"wires":[["3cc735e3.c42faa"]]},{"id":"3cc735e3.c42faa","type":"debug","z":"d0970a11.9662b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1030,"y":120,"wires":[]},{"id":"d9391972.996318","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":465,"y":225,"wires":[["dfec504f.be75d"]]},{"id":"dfec504f.be75d","type":"BACnet-Read","z":"d0970a11.9662b8","name":"Boiler2 Temp","objectType":"0","objectInstance":"10","propertyId":"85","arrayIndex":"","deviceIPAddress":"192.168.1.135","server":"89bad991.cc9dd8","multipleRead":false,"x":656,"y":225,"wires":[["7a329f9.6d5066"]]},{"id":"7a329f9.6d5066","type":"change","z":"d0970a11.9662b8","name":"Boiler 2 Temp","rules":[{"t":"move","p":"payload.values.0.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":837,"y":223,"wires":[["9a31370a.241c98"]]},{"id":"9a31370a.241c98","type":"debug","z":"d0970a11.9662b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1030,"y":220,"wires":[]},{"id":"9719a00b.25475","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":472,"y":327,"wires":[["70d47e63.4aa15"]]},{"id":"70d47e63.4aa15","type":"BACnet-Read","z":"d0970a11.9662b8","name":"Boiler3 Temp","objectType":"0","objectInstance":"12","propertyId":"85","arrayIndex":"","deviceIPAddress":"192.168.1.135","server":"89bad991.cc9dd8","multipleRead":false,"x":658,"y":327,"wires":[["ffa78c3d.2f0fb"]]},{"id":"ffa78c3d.2f0fb","type":"change","z":"d0970a11.9662b8","name":"Boiler 3 Temp","rules":[{"t":"move","p":"payload.values.0.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":853,"y":327,"wires":[["9ea1afd9.072a8"]]},{"id":"9ea1afd9.072a8","type":"debug","z":"d0970a11.9662b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1030,"y":320,"wires":[]},{"id":"a69662e8.ea82f","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":475,"y":409,"wires":[["30cd18d0.7303d8"]]},{"id":"30cd18d0.7303d8","type":"BACnet-Read","z":"d0970a11.9662b8","name":"Boiler4 Temp","objectType":"0","objectInstance":"13","propertyId":"85","arrayIndex":"","deviceIPAddress":"192.168.1.135","server":"89bad991.cc9dd8","multipleRead":false,"x":655,"y":410,"wires":[["7566d974.551538"]]},{"id":"7566d974.551538","type":"change","z":"d0970a11.9662b8","name":"Boiler 4 Temp","rules":[{"t":"move","p":"payload.values.0.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":411,"wires":[["40635e2b.32f04"]]},{"id":"40635e2b.32f04","type":"debug","z":"d0970a11.9662b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1030,"y":420,"wires":[]},{"id":"a2d0c1b.807d94","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":479,"y":480,"wires":[["23f22f90.cb2d7"]]},{"id":"23f22f90.cb2d7","type":"BACnet-Read","z":"d0970a11.9662b8","name":"Boiler5 Temp","objectType":"0","objectInstance":"18","propertyId":"85","arrayIndex":"","deviceIPAddress":"192.168.1.135","server":"89bad991.cc9dd8","multipleRead":false,"x":661,"y":479,"wires":[["178ee65e.cda61a"]]},{"id":"178ee65e.cda61a","type":"change","z":"d0970a11.9662b8","name":"Boiler 5 Temp","rules":[{"t":"move","p":"payload.values.0.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":856,"y":476,"wires":[["aef6d27e.dbc62"]]},{"id":"aef6d27e.dbc62","type":"debug","z":"d0970a11.9662b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1030,"y":480,"wires":[]},{"id":"37129ba6.016984","type":"inject","z":"d0970a11.9662b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":486,"y":588,"wires":[["3a4af08b.4740a"]]},{"id":"3a4af08b.4740a","type":"BACnet-Read","z":"d0970a11.9662b8","name":"Boiler6 Temp","objectType":"0","objectInstance":"19","propertyId":"85","arrayIndex":"","deviceIPAddress":"192.168.1.135","server":"89bad991.cc9dd8","multipleRead":false,"x":662,"y":586,"wires":[["f6e56922.5ec2b8"]]},{"id":"f6e56922.5ec2b8","type":"change","z":"d0970a11.9662b8","name":"Boiler 6 Temp","rules":[{"t":"move","p":"payload.values.0.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":580,"wires":[["c507ee20.bf069"]]},{"id":"c507ee20.bf069","type":"debug","z":"d0970a11.9662b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1030,"y":580,"wires":[]},{"id":"89bad991.cc9dd8","type":"BACnet-Client","z":"","name":"","adpuTimeout":"3000","port":"47808","interface":"192.168.1.132","broadcastAddress":"192.168.1.255"}]

If anyone has an idea why now BACnet1 is not a function and has worked in the past would be great

Hi. Firstly, your flow will not be importable. Please edit your post and add ``` back ticks above and below ( See here )

Some thoughts on the function version. It is likely they have npm added bacnet library to the .node-red folder manually and included a reference in settings.js. Then created a reference in global context.

Try going back to the original post, you may have missed something.

1 Like

Hi Sorry that flow is mine :blush: I did work on this for some time with a lot of help from the developer of node-red-contrib-bacnet. You can read some of the information on Github at this link


I did get a custom function to work by adding require bacstack to the settings file. but then a new connection is opened for each function so this is not really practical. There appears to be an issue with the underlying Bacstack library. I eventually had to give up and also there is not provision for Bacnet MS/TP. I have moved to using modbus BMS controllers and these work well

Thanks Mtoko
Sorry to sound dumb could you elaborate on the setting changes you made, how did you add the Bacstak to the settings file.

Also with the Modbus I was thinking of going down this route as well but the device I am using is a Master only I can not find a Node package that let the PI operate as a slave did you have this problem?

See the image below you add it in the settings.js under functionGlobalContext.

I would still consider using a modbus device, if you can send datasheet or information about the device you are planning to use I may be able to advise. I have used a few different ones and some are easier than others

image

Thanks Mtoko
I did enter the details in the settings.js as you pictured, but when I ran the function in the flow it would error stating bacnet1 was not recognised.

The device I am using is a native Bacnet device so Bacnet is preferred but it can also act as a Modbus master via TCP. It can read registers from other devices but does not provide registers to be read.

You could look at using the modbus Server node which will enable your device to read from Node Red. I have not used this but there this video does provide some explanation