Closed Navybrandon closed 5 years ago
@biancode I think the issue is with Bacstack not transmitting Segmented data for the Write node. What do you think?
I have fixed this issue.
@Navybrandon would you share here, how you fixed your issue?
@biancode I would love too. But way too many steps to list here. In short made sure the bacstack folder was in 3 locations on my pi. then added bacnet:require('backstack') to my settings.js file under FunctionGlobalContext. for each of the three locations. FYI this breaks the modules you made. Then I had to create a function module for each read and Write I wanted. Please feel free to direct message me for more details i would to help in any way I can.
@Navybrandon @biancode Hi I think this is related to closed issue #8 and was previously identified as an issue with the Bacstack library
@Navybrandon @mtoko Was a solution to this problem ever found. I can write a fixed value, but cant write a variable payload. Also, it only seems to read from AV's and BV's?
I was struggling to write to my BACnet ANALOG OUTPUT - it would work with a fixed value in the BACnet Write Node's 'Value' field but using msg.payload wouldn't get through. I worked out that the write node needs to be sent an array which includes the 'type' So my required numeric value has to go through a Function Node like this:
msg.payload = { values: [ { type: 4, // BACnet 'REAL' type value: msg.payload // Use the payload value directly } ] }; return msg;
NOTE: In order for this to work the 'App-Tag' field has to be set at NULL or 0 and the 'Value' field has to be empty.
I was struggling to write to my BACnet ANALOG OUTPUT - it would work with a fixed value in the BACnet Write Node's 'Value' field but using msg.payload wouldn't get through. I worked out that the write node needs to be sent an array which includes the 'type' So my required numeric value has to go through a Function Node like this:
msg.payload = { values: [ { type: 4, // BACnet 'REAL' type value: msg.payload // Use the payload value directly } ] }; return msg;
NOTE: In order for this to work the 'App-Tag' field has to be set at NULL or 0 and the 'Value' field has to be empty.
Hi Friend, Can you share your flow or Images of write node please ?
Well I hope this makes sense - I'm just using a slider in NodeRed to override the Analog Output on my BACnet device — which is usually controlled by the building management system. Here's the JSON export for the relevent (and some irrelevant!) nodes: [ { "id": "5aa627c22574151e", "type": "BACnet-Write", "z": "67995ff913ed1e62", "name": "EXHAUST AO-5", "objectType": "1", "instance": "be3b468b.f01078", "valueTag": "0", "valueValue": "", "propertyId": "85", "priority": "9", "device": "fc59ddc.809d92", "server": "e6879e9.486886", "multipleWrite": false, "x": 1018, "y": 342, "wires": [ [] ] }, { "id": "ddc6462cff35e26d", "type": "ui_slider", "z": "67995ff913ed1e62", "name": "MVHR Speed", "label": "MVHR FANS %", "tooltip": "", "group": "7ba5b5c6.c89f5c", "order": 18, "width": 0, "height": 0, "passthru": true, "outs": "end", "topic": "topic", "topicType": "msg", "min": 0, "max": "100", "step": "5", "className": "", "x": 244, "y": 306, "wires": [ [ "351db48d47778070" ] ] }, { "id": "351db48d47778070", "type": "range", "z": "67995ff913ed1e62", "minin": "0", "maxin": "100", "minout": "0", "maxout": "9999.9", "action": "scale", "round": true, "property": "payload", "name": "", "x": 484, "y": 306, "wires": [ [ "92ffd444a8359ac3", "16c4be02830d430e" ] ] }, { "id": "16c4be02830d430e", "type": "function", "z": "67995ff913ed1e62", "name": "Format Payload", "func": "msg.payload = {\n values: [\n {\n type: 4, // BACnet 'REAL' type\n value: msg.payload // Use the payload value directly\n }\n ]\n};\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 748, "y": 342, "wires": [ [ "4cdb7d241f8bd06a", "5aa627c22574151e" ] ] }, { "id": "92ffd444a8359ac3", "type": "function", "z": "67995ff913ed1e62", "name": "Format Payload", "func": "msg.payload = {\n values: [\n {\n type: 4, // BACnet 'REAL' type\n value: msg.payload // Use the payload value directly\n }\n ]\n};\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 750, "y": 450, "wires": [ [ "fda2b367c56e8804", "6d9f54dd2216033f" ] ] }, { "id": "6d9f54dd2216033f", "type": "BACnet-Write", "z": "67995ff913ed1e62", "name": "SUPPLY AO-4", "objectType": "1", "instance": "deba93c3.e6e0b8", "valueTag": "0", "valueValue": "", "propertyId": "85", "priority": "9", "device": "fc59ddc.809d92", "server": "e6879e9.486886", "multipleWrite": false, "x": 968, "y": 468, "wires": [ [] ] }, { "id": "be3b468b.f01078", "type": "BACnet-Instance", "name": "AO-5", "instanceAddress": "4" }, { "id": "fc59ddc.809d92", "type": "BACnet-Device", "name": "iSMA 123", "deviceAddress": "172.17.17.123" }, { "id": "e6879e9.486886", "type": "BACnet-Client", "name": "iSMA", "adpuTimeout": "15000", "port": "47808", "interface": "172.17.17.123", "broadcastAddress": "172.17.17.255" }, { "id": "7ba5b5c6.c89f5c", "type": "ui_group", "name": "Sonoff Control Panel", "tab": "7a08c1ba.e16cf", "order": 1, "disp": true, "width": "8", "collapse": true }, { "id": "deba93c3.e6e0b8", "type": "BACnet-Instance", "name": "AO-4", "instanceAddress": "3" }, { "id": "7a08c1ba.e16cf", "type": "ui_tab", "name": "MVHR Display", "icon": "dashboard", "order": 2 } ]
My slider is manually overriding the building control BACnet device, so when I want to relinquish control back to it I have to send a NULL. This uses the following Flow: [ { "id": "18584379608b3b62", "type": "ui_button", "z": "67995ff913ed1e62", "name": "", "group": "7ba5b5c6.c89f5c", "order": 18, "width": 0, "height": 0, "passthru": false, "label": "REQ Auto", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "0", "payloadType": "num", "topic": "topic", "topicType": "msg", "x": 372, "y": 252, "wires": [ [ "9b1c35080dfcd49e" ] ] }, { "id": "9b1c35080dfcd49e", "type": "function", "z": "67995ff913ed1e62", "name": "Format Payload", "func": "msg.payload = {\n values: [\n {\n type: 4, // BACnet 'REAL' type\n value: null // Use the payload value directly\n }\n ]\n};\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 656, "y": 252, "wires": [ [ "5aa627c22574151e", "6d9f54dd2216033f" ] ] }, { "id": "5aa627c22574151e", "type": "BACnet-Write", "z": "67995ff913ed1e62", "name": "EXHAUST AO-5", "objectType": "1", "instance": "be3b468b.f01078", "valueTag": "0", "valueValue": "", "propertyId": "85", "priority": "9", "device": "fc59ddc.809d92", "server": "e6879e9.486886", "multipleWrite": false, "x": 1018, "y": 342, "wires": [ [] ] }, { "id": "6d9f54dd2216033f", "type": "BACnet-Write", "z": "67995ff913ed1e62", "name": "SUPPLY AO-4", "objectType": "1", "instance": "deba93c3.e6e0b8", "valueTag": "0", "valueValue": "", "propertyId": "85", "priority": "9", "device": "fc59ddc.809d92", "server": "e6879e9.486886", "multipleWrite": false, "x": 968, "y": 468, "wires": [ [] ] }, { "id": "7ba5b5c6.c89f5c", "type": "ui_group", "name": "Sonoff Control Panel", "tab": "7a08c1ba.e16cf", "order": 1, "disp": true, "width": "8", "collapse": true }, { "id": "be3b468b.f01078", "type": "BACnet-Instance", "name": "AO-5", "instanceAddress": "4" }, { "id": "fc59ddc.809d92", "type": "BACnet-Device", "name": "iSMA 123", "deviceAddress": "172.17.17.123" }, { "id": "e6879e9.486886", "type": "BACnet-Client", "name": "iSMA", "adpuTimeout": "15000", "port": "47808", "interface": "172.17.17.123", "broadcastAddress": "172.17.17.255" }, { "id": "deba93c3.e6e0b8", "type": "BACnet-Instance", "name": "AO-4", "instanceAddress": "3" }, { "id": "7a08c1ba.e16cf", "type": "ui_tab", "name": "MVHR Display", "icon": "dashboard", "order": 2 } ]
Well I hope this makes sense - I'm just using a slider in NodeRed to override the Analog Output on my BACnet device — which is usually controlled by the building management system. Here's the JSON export for the relevent (and some irrelevant!) nodes: [ { "id": "5aa627c22574151e", "type": "BACnet-Write", "z": "67995ff913ed1e62", "name": "EXHAUST AO-5", "objectType": "1", "instance": "be3b468b.f01078", "valueTag": "0", "valueValue": "", "propertyId": "85", "priority": "9", "device": "fc59ddc.809d92", "server": "e6879e9.486886", "multipleWrite": false, "x": 1018, "y": 342, "wires": [ [] ] }, { "id": "ddc6462cff35e26d", "type": "ui_slider", "z": "67995ff913ed1e62", "name": "MVHR Speed", "label": "MVHR FANS %", "tooltip": "", "group": "7ba5b5c6.c89f5c", "order": 18, "width": 0, "height": 0, "passthru": true, "outs": "end", "topic": "topic", "topicType": "msg", "min": 0, "max": "100", "step": "5", "className": "", "x": 244, "y": 306, "wires": [ [ "351db48d47778070" ] ] }, { "id": "351db48d47778070", "type": "range", "z": "67995ff913ed1e62", "minin": "0", "maxin": "100", "minout": "0", "maxout": "9999.9", "action": "scale", "round": true, "property": "payload", "name": "", "x": 484, "y": 306, "wires": [ [ "92ffd444a8359ac3", "16c4be02830d430e" ] ] }, { "id": "16c4be02830d430e", "type": "function", "z": "67995ff913ed1e62", "name": "Format Payload", "func": "msg.payload = {\n values: [\n {\n type: 4, // BACnet 'REAL' type\n value: msg.payload // Use the payload value directly\n }\n ]\n};\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 748, "y": 342, "wires": [ [ "4cdb7d241f8bd06a", "5aa627c22574151e" ] ] }, { "id": "92ffd444a8359ac3", "type": "function", "z": "67995ff913ed1e62", "name": "Format Payload", "func": "msg.payload = {\n values: [\n {\n type: 4, // BACnet 'REAL' type\n value: msg.payload // Use the payload value directly\n }\n ]\n};\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 750, "y": 450, "wires": [ [ "fda2b367c56e8804", "6d9f54dd2216033f" ] ] }, { "id": "6d9f54dd2216033f", "type": "BACnet-Write", "z": "67995ff913ed1e62", "name": "SUPPLY AO-4", "objectType": "1", "instance": "deba93c3.e6e0b8", "valueTag": "0", "valueValue": "", "propertyId": "85", "priority": "9", "device": "fc59ddc.809d92", "server": "e6879e9.486886", "multipleWrite": false, "x": 968, "y": 468, "wires": [ [] ] }, { "id": "be3b468b.f01078", "type": "BACnet-Instance", "name": "AO-5", "instanceAddress": "4" }, { "id": "fc59ddc.809d92", "type": "BACnet-Device", "name": "iSMA 123", "deviceAddress": "172.17.17.123" }, { "id": "e6879e9.486886", "type": "BACnet-Client", "name": "iSMA", "adpuTimeout": "15000", "port": "47808", "interface": "172.17.17.123", "broadcastAddress": "172.17.17.255" }, { "id": "7ba5b5c6.c89f5c", "type": "ui_group", "name": "Sonoff Control Panel", "tab": "7a08c1ba.e16cf", "order": 1, "disp": true, "width": "8", "collapse": true }, { "id": "deba93c3.e6e0b8", "type": "BACnet-Instance", "name": "AO-4", "instanceAddress": "3" }, { "id": "7a08c1ba.e16cf", "type": "ui_tab", "name": "MVHR Display", "icon": "dashboard", "order": 2 } ]
My slider is manually overriding the building control BACnet device, so when I want to relinquish control back to it I have to send a NULL. This uses the following Flow: [ { "id": "18584379608b3b62", "type": "ui_button", "z": "67995ff913ed1e62", "name": "", "group": "7ba5b5c6.c89f5c", "order": 18, "width": 0, "height": 0, "passthru": false, "label": "REQ Auto", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "0", "payloadType": "num", "topic": "topic", "topicType": "msg", "x": 372, "y": 252, "wires": [ [ "9b1c35080dfcd49e" ] ] }, { "id": "9b1c35080dfcd49e", "type": "function", "z": "67995ff913ed1e62", "name": "Format Payload", "func": "msg.payload = {\n values: [\n {\n type: 4, // BACnet 'REAL' type\n value: null // Use the payload value directly\n }\n ]\n};\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 656, "y": 252, "wires": [ [ "5aa627c22574151e", "6d9f54dd2216033f" ] ] }, { "id": "5aa627c22574151e", "type": "BACnet-Write", "z": "67995ff913ed1e62", "name": "EXHAUST AO-5", "objectType": "1", "instance": "be3b468b.f01078", "valueTag": "0", "valueValue": "", "propertyId": "85", "priority": "9", "device": "fc59ddc.809d92", "server": "e6879e9.486886", "multipleWrite": false, "x": 1018, "y": 342, "wires": [ [] ] }, { "id": "6d9f54dd2216033f", "type": "BACnet-Write", "z": "67995ff913ed1e62", "name": "SUPPLY AO-4", "objectType": "1", "instance": "deba93c3.e6e0b8", "valueTag": "0", "valueValue": "", "propertyId": "85", "priority": "9", "device": "fc59ddc.809d92", "server": "e6879e9.486886", "multipleWrite": false, "x": 968, "y": 468, "wires": [ [] ] }, { "id": "7ba5b5c6.c89f5c", "type": "ui_group", "name": "Sonoff Control Panel", "tab": "7a08c1ba.e16cf", "order": 1, "disp": true, "width": "8", "collapse": true }, { "id": "be3b468b.f01078", "type": "BACnet-Instance", "name": "AO-5", "instanceAddress": "4" }, { "id": "fc59ddc.809d92", "type": "BACnet-Device", "name": "iSMA 123", "deviceAddress": "172.17.17.123" }, { "id": "e6879e9.486886", "type": "BACnet-Client", "name": "iSMA", "adpuTimeout": "15000", "port": "47808", "interface": "172.17.17.123", "broadcastAddress": "172.17.17.255" }, { "id": "deba93c3.e6e0b8", "type": "BACnet-Instance", "name": "AO-4", "instanceAddress": "3" }, { "id": "7a08c1ba.e16cf", "type": "ui_tab", "name": "MVHR Display", "icon": "dashboard", "order": 2 } ]
You are the Kind Friend, Working Like Charm, Thank You So Much.
I'm submitting a ... (check one with "x")
Problem
( ) unexpected behavior => please visit the Wiki before
Current behavior When sending information from BACnet Write node the following error occurs "Error: BacnetAbort - Reason:4"
Expected behavior I was passing a msg.payload to change the value of a Analog Value, app tag real, Present Value
Minimal reproduction of the problem with instructions
Your Environment
Please tell us about your environment: [{"id":"40c8fca2.b42554","type":"BACnet-Write","z":"e0a176f5.b2ea48","name":"","objectType":"2","instance":"dc885d8e.5caaa","valueTag":"4","valueValue":"{{payload}}","propertyId":"85","device":"bdded6be.320678","server":"b5033340.81aaa","multipleWrite":false,"x":620,"y":120,"wires":[["a9e65eb9.4bffd"]]},{"id":"dc885d8e.5caaa","type":"BACnet-Instance","z":"","name":"Test SADPR-OUTPUT%","instanceAddress":"3001617"},{"id":"bdded6be.320678","type":"BACnet-Device","z":"","name":"NCE","deviceAddress":"192.168.1.41"},{"id":"b5033340.81aaa","type":"BACnet-Client","z":"","name":"NCE","adpuTimeout":"6000","port":"47808","interface":"192.168.1.41","broadcastAddress":"192.168.1.255"}]
(x ) I am using just the Node-RED package and got node-bacstack installed with it
( ) I have installed node-bacstack global from source (using git clone)
( ) I have installed node-bacstack as a global package (using npm i -g)
Device :
node-red-contrib-bacnet version: ``
Node: (min. 6.10.x)
node --version
=0.1.0 via Palette