This post describes the interface between a Dru Burner and Domoticz with use of Node Red.
As not all burners have the same functionality and possibilities all functions are implemented, but some of them are commented out.
If the functionality is required, it is sufficient to remove the 2 forward slashes (//), but we were not able to test all functios with a real burner.
In order to be able to use the flow extra nodes should be loaded into Node Red, beside the default nodes.
1. node-red-contrib-simple-gate
2. node-red-contrib-modbus
3. node-red-contrib-bit
4. node-red-contrib-filter
Create the following virtual devices (if needed) in Domoticz and note down the index numbers:
The flow consists of 3 parts, each under a different tab in Node Red.
Feel free to re-organize this.
It is assumed that the MQTT server (Mosquitto) runs on the same device as Node Red. If not you have to change this in the config of the MQTT nodes.
Also you have to configure the Modbus server, currently called "Simulator", and set the correct IP address. Leave the other items unchanged.
Tab 1: Main flow, including communication from Dru Burner (Modbus) to Domoticz and communication from Domoticz to Dru Burner.
Tab 3: Control of the command to the Dru Burner by means of Google Home (Assistant)
The first Node Red Modbus node polls the Modbus register 40203 and 40204 every 10 seconds. Faster is not recommended.
Register 40203 contains status information and in case of an error Register 40204 contains the error code.
This payload is send to 2 change nodes, the upper for the status information and the lower one for the error code. In case of the change node for the error code also the topic "modbus_fault" is added. The 16 bit register for the status information is split up in a 16 bit array and as this node is unable to pass a topic, we add the topic modbus_status after it. Both data is joined into 1 object. The function node creates the correct messages to Domoticz.
This node contains also the error text from the user manual and users should check there error codes and texts, if it still complies with the error texts in the node. The "loose" Function node is identical but with English texts for the error code. Users can change this to their local language
In the function node the following sensors and switches are controlled.
- Secondary burner On or Off (Currently commented out, as not every Dru type has a secondary burner)
- Boost fan On or Off (Currently commented out, as not every Dru type has a boost fan)
- Pilot flame On or Off (Currently commented out, as not every Dru type has a pilot flame, but DBI ignition)
If particular functions are not desired, you can simple put 2 forward slashes (//) in front or it and if you need currently functions, that has been commented out, you can remove the forward slashed.
The upper part reads Modbus register 40207 and puts the measured temperature in a Temperature sensor.
The lower part read Modbus register 40250 and puts the thermostat value in the Thermostat device in Domoticz.
As this was not is use the nodes were disabled. These can be simply enabled, if you want to use them.
This part controls the Dru Burner from Domoticz. After the MQTT input node, we have a filter node, that splits the commands from the various push buttons and switches to different outputs.
The first output, if in use, sets the temperature set point by writing the temperature value to register 40250.
As this was not is use the nodes were disabled. These can be simply enabled, if you want to use them.
The second output writes some action, like Burner Off and Wave active to Modbus register 40200.
If applicable, also the Boost fan and the Light are controlled there. To use them, remove //.
The third output controls the ignition of the Main Burner and, if applicable, the Secondary Burner and Pilot Flame.
However this is conditional if the status register indicate that ignition is allowed. In case this register indicate that ignition is not allowed the gate node is closed and commands will not have any effect.
The fourth output handles the possibility to reset the fireplace. If it is allowed, the gate is open, otherwise closed.
The fifth output is also conditional If temperature control is possible, the gate is open otherwise closed.
As this was not is use the nodes were disabled. These can be simply enabled, if you want to use them.
The sixth output is also conditional. If the flame height can be changed by the user at this moment the gate is open en a command can be send to register 40201.
Some of the "Link" node point to another tab and that will be published in the future.
Code: Select all
[{"id":"69f1448b.1e22f4","type":"tab","label":"Dru Fireplace","disabled":false,"info":""},{"id":"aa8ef443.806b3","type":"modbus-read","z":"69f1448b.1e22f4","d":true,"name":"Room Temperature","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"","dataType":"HoldingRegister","adr":"40207","quantity":"1","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"eaeccf99.767198","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":170,"y":380,"wires":[["ed2ba6ba.8b9018"],[]]},{"id":"74d940d.6c649c","type":"comment","z":"69f1448b.1e22f4","d":true,"name":"Modbus Read Room Temperature 40207","info":"","x":240,"y":337,"wires":[]},{"id":"ed2ba6ba.8b9018","type":"function","z":"69f1448b.1e22f4","d":true,"name":"","func":"msg.payload = {\"command\":\"udevice\",\"idx\":14,\"nvalue\":0,\"svalue\":(msg.payload[0]/10).toString()};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":440,"y":377,"wires":[["3b68b413.534c0c"]]},{"id":"3b68b413.534c0c","type":"mqtt out","z":"69f1448b.1e22f4","d":true,"name":"Domoticz In","topic":"domoticz/in","qos":"0","retain":"false","broker":"f9f13036.e28b58","x":670,"y":437,"wires":[]},{"id":"2d2f96b5.265b02","type":"modbus-read","z":"69f1448b.1e22f4","d":true,"name":"Temperature Control Setpoint","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"","dataType":"HoldingRegister","adr":"40250","quantity":"1","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"eaeccf99.767198","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":200,"y":500,"wires":[["79c417d.b57ee68"],[]]},{"id":"a7fdf480.63a8d","type":"comment","z":"69f1448b.1e22f4","d":true,"name":"Modbus Read Temperature Control Setpoint 40250","info":"","x":270,"y":460,"wires":[]},{"id":"79c417d.b57ee68","type":"function","z":"69f1448b.1e22f4","d":true,"name":"","func":"msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":0,\"svalue\":(msg.payload[0]/10).toString()};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":440,"y":500,"wires":[["3b68b413.534c0c"]]},{"id":"91cecba1.9d58b8","type":"mqtt in","z":"69f1448b.1e22f4","name":"Domoticz Out","topic":"domoticz/out","qos":"0","datatype":"json","broker":"f9f13036.e28b58","x":130,"y":640,"wires":[["e235a0ca.7aa218"]]},{"id":"e4a4ce34.f56a18","type":"function","z":"69f1448b.1e22f4","d":true,"name":"Set Temperature","func":"msg.payload = Number(msg.payload.svalue1 * 10);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":600,"wires":[["d2210ee3.bfb7d8"]]},{"id":"d2210ee3.bfb7d8","type":"modbus-write","z":"69f1448b.1e22f4","d":true,"name":"Temperature Control Setpoint","showStatusActivities":false,"showErrors":true,"unitid":"","dataType":"HoldingRegister","adr":"40250","quantity":"1","server":"eaeccf99.767198","emptyMsgOnFail":false,"keepMsgProperties":false,"x":890,"y":600,"wires":[[],[]]},{"id":"6802092c.83a5c","type":"comment","z":"69f1448b.1e22f4","d":true,"name":"Modbus Write Temperature Control Setpoint 40250","info":"","x":830,"y":560,"wires":[]},{"id":"e235a0ca.7aa218","type":"filter","z":"69f1448b.1e22f4","name":"Filter Buttons","property":"payload.idx","propertyType":"msg","asArray":false,"itemProperty":"","itemPropertyType":"item","rules":[{"t":"eq","v":"15","vt":"num","output":1},{"t":"eq","v":"17","vt":"num","output":3},{"t":"eq","v":"18","vt":"num","output":3},{"t":"eq","v":"21","vt":"num","output":2},{"t":"eq","v":"22","vt":"num","output":2},{"t":"eq","v":"23","vt":"num","output":2},{"t":"eq","v":"24","vt":"str","output":3},{"t":"eq","v":"25","vt":"str","output":5},{"t":"eq","v":"26","vt":"str","output":6},{"t":"eq","v":"27","vt":"str","output":2},{"t":"eq","v":"28","vt":"str","output":4}],"checkall":"true","outputs":6,"x":340,"y":640,"wires":[["e4a4ce34.f56a18"],["e1d4516b.cf5f88"],["9d0a3143.9bede8"],["ec100ed6.1f30b"],["84a9afa.b34b9d"],["f102acd8.9d50b"]]},{"id":"c20e293a.3cdea8","type":"mqtt out","z":"69f1448b.1e22f4","name":"Domoticz In","topic":"domoticz/in","qos":"0","retain":"false","broker":"f9f13036.e28b58","x":1292,"y":100,"wires":[]},{"id":"e1d4516b.cf5f88","type":"function","z":"69f1448b.1e22f4","name":"Set Fireplace action","func":"switch (msg.payload.idx) {\n \n// Boost Fan\n// Currently not used\n\n// case 21:\n// if (msg.payload.nvalue === 0) {\n// msg.payload = 6\n// } else if (msg.payload.nvalue === 1) {\n// msg.payload = 104\n// }\n// break;\n\n// Light\n// Currently not used\n\n// case 22:\n// if (msg.payload.nvalue === 0) {\n// msg.payload = 5\n// } else if (msg.payload.nvalue === 1) {\n// msg.payload = 103\n// }\n// break;\n\n// Wave active\n\n case 23:\n if (msg.payload.nvalue === 0) {\n msg.payload = 7\n } else if (msg.payload.nvalue === 1) {\n msg.payload = 105\n }\n break;\n\n\n// Fireplace Off\n\n case 27:\n if (msg.payload.nvalue === 0) {\n msg.payload = 1\n } else if (msg.payload.nvalue === 1) {\n msg.payload = 0\n }\n break;\n\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":700,"wires":[["8b03ae6d.1d482"]]},{"id":"8b03ae6d.1d482","type":"modbus-write","z":"69f1448b.1e22f4","name":"Fireplace action","showStatusActivities":false,"showErrors":true,"unitid":"","dataType":"HoldingRegister","adr":"40200","quantity":"1","server":"eaeccf99.767198","emptyMsgOnFail":false,"keepMsgProperties":false,"x":940,"y":780,"wires":[[],[]]},{"id":"50cdaf81.38ca58","type":"comment","z":"69f1448b.1e22f4","name":"Modbus Write Fireplace action 40200","info":"","x":870,"y":660,"wires":[]},{"id":"83130643.bd1ce","type":"function","z":"69f1448b.1e22f4","name":"Set Flame height","func":"if (msg.payload.nvalue !== 0)\n\n{\n msg.payload = Number(msg.payload.svalue1)\n}\n\nelse if (msg.payload.nvalue === 0)\n\n{\n msg.payload = 0\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":960,"wires":[["682f6248.ee68dc"]]},{"id":"682f6248.ee68dc","type":"modbus-write","z":"69f1448b.1e22f4","name":"Flame height","showStatusActivities":false,"showErrors":true,"unitid":"","dataType":"HoldingRegister","adr":"40201","quantity":"1","server":"eaeccf99.767198","emptyMsgOnFail":false,"keepMsgProperties":false,"x":950,"y":960,"wires":[[],[]]},{"id":"127fe532.772693","type":"comment","z":"69f1448b.1e22f4","name":"Modbus Write Flame height 40201","info":"","x":880,"y":920,"wires":[]},{"id":"7e9fb276.00b1ac","type":"link out","z":"69f1448b.1e22f4","name":"Link Out","links":["245e8aaa.4456e6","37546fe8.09d5e8","80e10346.5a8d3","3c551c28.15fb74"],"x":1057,"y":180,"wires":[]},{"id":"245e8aaa.4456e6","type":"link in","z":"69f1448b.1e22f4","name":"Link In","links":["7e9fb276.00b1ac","1dc0f9b2.b9a4be"],"x":219,"y":960,"wires":[["463baa3f.da1024"]]},{"id":"dba495f2.925088","type":"modbus-read","z":"69f1448b.1e22f4","name":"Status/Fault","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"","dataType":"HoldingRegister","adr":"40203","quantity":"2","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"f8bdbf46.ef61f8","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":150,"y":140,"wires":[["bff8202f.b2568","40b07d88.c988fc"],[]]},{"id":"bff8202f.b2568","type":"change","z":"69f1448b.1e22f4","name":"Change 1 rule","rules":[{"t":"move","p":"payload[0]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":100,"wires":[["ea315768.be7e3"]]},{"id":"ea315768.be7e3","type":"bit-simple-sixteen","z":"69f1448b.1e22f4","name":"","x":572,"y":100,"wires":[["96e9c51c.eaf2c"]]},{"id":"40b07d88.c988fc","type":"change","z":"69f1448b.1e22f4","name":"Change 2 rules","rules":[{"t":"move","p":"payload[1]","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"modbus_fault","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":180,"wires":[["57cdb61a.9ecc68"]]},{"id":"1cba4fc7.6924e8","type":"comment","z":"69f1448b.1e22f4","name":"Modbus Read Status 40203 and 40204","info":"","x":210,"y":40,"wires":[]},{"id":"96e9c51c.eaf2c","type":"change","z":"69f1448b.1e22f4","name":"Set Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"modbus_status","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":762,"y":100,"wires":[["57cdb61a.9ecc68"]]},{"id":"57cdb61a.9ecc68","type":"join","z":"69f1448b.1e22f4","name":"Join","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":932,"y":100,"wires":[["7e9fb276.00b1ac","165f619f.a64dc6"]]},{"id":"89fdbb33.7e4ad","type":"function","z":"69f1448b.1e22f4","name":"Set Ignition","func":"switch (msg.payload.idx) {\n \n// Main Burner \n\n case 17:\n if (msg.payload.nvalue === 0) {\n msg.payload = 3\n } else if (msg.payload.nvalue === 1) {\n msg.payload = 101\n }\n break;\n\n// Second Burner\n// Currently not used\n\n// case 18:\n// if (msg.payload.nvalue === 0) {\n// msg.payload = 4\n// } else if (msg.payload.nvalue === 1) {\n// msg.payload = 102\n// }\n// break;\n\n// Pilot\n// Currently not used\n\n// case 24:\n// if (msg.payload.nvalue === 0) {\n// msg.payload = 2\n// } else if (msg.payload.nvalue === 1) {\n// msg.payload = 100\n// }\n// break;\n\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":760,"wires":[["8b03ae6d.1d482"]]},{"id":"f563fca3.674ec","type":"function","z":"69f1448b.1e22f4","d":true,"name":"Set temperature Control","func":"// Temperature Control\n// Currently not used\n\nif (msg.payload.nvalue === 0) {\n msg.payload = 8\n} else if (msg.payload.nvalue === 1) {\n msg.payload = 106\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":730,"y":883,"wires":[["8b03ae6d.1d482"]]},{"id":"37546fe8.09d5e8","type":"link in","z":"69f1448b.1e22f4","d":true,"name":"Link In","links":["7e9fb276.00b1ac"],"x":219,"y":883,"wires":[["b4042f01.399948"]]},{"id":"80e10346.5a8d3","type":"link in","z":"69f1448b.1e22f4","name":"Link In","links":["7e9fb276.00b1ac","1dc0f9b2.b9a4be"],"x":219,"y":760,"wires":[["858fc90f.f9301"]]},{"id":"463baa3f.da1024","type":"function","z":"69f1448b.1e22f4","name":"","func":"if (msg.payload.modbus_status[10] === false) {\n msg.topic = \"control\";\n msg.payload = \"open\"\n }\n else {\n msg.topic = \"control\";\n msg.payload = \"close\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":341,"y":960,"wires":[["f102acd8.9d50b"]]},{"id":"f102acd8.9d50b","type":"gate","z":"69f1448b.1e22f4","name":"Gate","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":960,"wires":[["83130643.bd1ce"]]},{"id":"9d0a3143.9bede8","type":"gate","z":"69f1448b.1e22f4","name":"Gate","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":760,"wires":[["89fdbb33.7e4ad"]]},{"id":"84a9afa.b34b9d","type":"gate","z":"69f1448b.1e22f4","d":true,"name":"Gate","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":883,"wires":[["f563fca3.674ec"]]},{"id":"858fc90f.f9301","type":"function","z":"69f1448b.1e22f4","name":"","func":"if (msg.payload.modbus_status[15] === false) {\n msg.topic = \"control\";\n msg.payload = \"open\"\n }\n else {\n msg.topic = \"control\";\n msg.payload = \"close\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":341,"y":760,"wires":[["9d0a3143.9bede8"]]},{"id":"b4042f01.399948","type":"function","z":"69f1448b.1e22f4","d":true,"name":"","func":"if ((msg.payload.modbus_status[13] === false) && (msg.payload.modbus_status[14] === false)) {\n msg.topic = \"control\";\n msg.payload = \"close\"\n }\n else {\n msg.topic = \"control\";\n msg.payload = \"open\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":341,"y":883,"wires":[["84a9afa.b34b9d"]]},{"id":"5b79bff0.ca1de","type":"function","z":"69f1448b.1e22f4","name":"Reset Fireplace","func":"// Fireplace reset\n \nif (msg.payload.nvalue === 0) {\n msg.payload = 0\n} else if (msg.payload.nvalue === 1) {\n msg.payload = 1000\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":700,"y":820,"wires":[["8b03ae6d.1d482"]]},{"id":"3c551c28.15fb74","type":"link in","z":"69f1448b.1e22f4","name":"Link In","links":["7e9fb276.00b1ac","1dc0f9b2.b9a4be"],"x":219,"y":820,"wires":[["c1552b64.b7e658"]]},{"id":"ec100ed6.1f30b","type":"gate","z":"69f1448b.1e22f4","name":"Gate","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":510,"y":820,"wires":[["5b79bff0.ca1de"]]},{"id":"c1552b64.b7e658","type":"function","z":"69f1448b.1e22f4","name":"","func":"if (msg.payload.modbus_status[6] === true) {\n msg.topic = \"control\";\n msg.payload = \"open\"\n }\n else {\n msg.topic = \"control\";\n msg.payload = \"close\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":341,"y":820,"wires":[["ec100ed6.1f30b"]]},{"id":"165f619f.a64dc6","type":"function","z":"69f1448b.1e22f4","name":"","func":" /*jshint maxerr: 100000 */\nmsg1 = {};\nmsg2 = {};\n//msg3 = {};\nmsg4 = {};\nmsg5 = {};\n//msg6 = {};\n//msg7 = {};\nmsg8 = {};\n//msg9 = {};\nvar fault_text = {};\n\n// Register 40203\n// Fireplace Status Fault\n\nif (msg.payload.modbus_status[0] === true) {\n switch (msg.payload.modbus_fault) {\n\n case 0:\n fault_text = \"Onbekende foutcode\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 1: \n fault_text = \"Communicatieverlies tussen ontvanger en branderautomaat\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 2: \n fault_text = \"Ontvanger oververhit (60° boven kamertemperatuur)\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 3: \n fault_text = \"Interne (ontvanger) NTC-sensor werkt niet correct\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n \n case 4: \n fault_text = \"Externe NTC-sensor, werkt niet correct\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 5: \n fault_text = \"Interne veiligheidsfout\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 6: \n fault_text = \"Communicatieverlies tussen zender en ontvanger\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 7: \n fault_text = \"Raadpleeg installatiehandleiding\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 8: \n fault_text = \"Geen ionisatie\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 9: \n fault_text = \"Onbekende foutcode\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 10: \n fault_text = \"Onbekende foutcode\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 11: \n fault_text = \"Onbekende foutcode\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 12: \n fault_text = \"ESYS wordt niet vrijgegeven\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 13: \n fault_text = \"Vlamverlies wanneer alleen de hoofdbrander aan staat\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 14: \n fault_text = \"Vlamverlies wanneer beide branders aan staan\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 15: \n fault_text = \"Geen branderautomaat of High limit error\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 16:\n fault_text = \"Hardware Fout ESYS\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 17: \n fault_text = \"Disable contact is gesloten\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n \n default:\n fault_text = \"Onbekende foutcode\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Foutcode \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n } \n} else if (msg.payload.modbus_status[0] === false) {\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"Normaal\"}\n}\n\n// Fireplace Status Pilot flame ON\n\n//if (msg.payload.modbus_status[1] === true) {\n// msg9.payload = { \"command\" : \"switchlight\" , \"idx\" : 24 , \"switchcmd\" : \"On\" }\n//} else if (msg.payload.modbus_status[1] === false) {\n// msg9.payload = { \"command\" : \"switchlight\" , \"idx\" : 24 , \"switchcmd\" : \"Off\" }\n//}\n\n// Fireplace Status Main Burner ON\n\nif (msg.payload.modbus_status[2] === true) {\n msg2.payload = { \"command\" : \"switchlight\" , \"idx\" : 17 , \"switchcmd\" : \"On\" }\n} else if (msg.payload.modbus_status[2] === false) {\n msg2.payload = { \"command\" : \"switchlight\" , \"idx\" : 17 , \"switchcmd\" : \"Off\" }\n}\n\n// Fireplace Status Second Burner ON\n// Currently not used\n\n//if (msg.payload.modbus_status[3] === true) {\n// msg3.payload = { \"command\" : \"switchlight\" , \"idx\" : 18 , \"switchcmd\" : \"On\" }\n//} else if (msg.payload_status[3] === false) {\n// msg3.payload = { \"command\" : \"switchlight\" , \"idx\" : 18 , \"switchcmd\" : \"Off\" }\n//}\n\n// Fireplace Status Low battery DFRC\n\nif (msg.payload.modbus_status[4] === true) {\n msg4.payload = {\"command\":\"udevice\",\"idx\":19,\"nvalue\":2,\"svalue\":\"Fout\"}\n} else if (msg.payload.modbus_status[4] === false) {\n msg4.payload = {\"command\":\"udevice\",\"idx\":19,\"nvalue\":1,\"svalue\":\"Normaal\"}\n}\n\n// Fireplace Status 230V phase fault\n\nif (msg.payload.modbus_status[5] === true) {\n msg5.payload = {\"command\":\"udevice\",\"idx\":20,\"nvalue\":2,\"svalue\":\"Fout\"}\n} else if (msg.payload.modbus_status[5] === false) {\n msg5.payload = {\"command\":\"udevice\",\"idx\":20,\"nvalue\":1,\"svalue\":\"Normaal\"}\n}\n\n// Fireplace Status Boost Fan ON\n// Currently not used\n\n//if (msg.payload.modbus_status[7] === true) {\n// msg6.payload = { \"command\" : \"switchlight\" , \"idx\" : 21 , \"switchcmd\" : \"On\" }\n//} else if (msg.payload_status[7] === false) {\n// msg6.payload = { \"command\" : \"switchlight\" , \"idx\" : 21 , \"switchcmd\" : \"Off\" }\n//}\n\n// Fireplace Status Light ON\n// Currently not used\n\n//if (msg.payload.modbus_status[8] === true) {\n// msg7.payload = { \"command\" : \"switchlight\" , \"idx\" : 22 , \"switchcmd\" : \"On\" }\n//} else if (msg.payload_status[8] === false) {\n// msg7.payload = { \"command\" : \"switchlight\" , \"idx\" : 22 , \"switchcmd\" : \"Off\" }\n//}\n\n// Fireplace Status Wave active\n\nif (msg.payload.modbus_status[9] === true) {\n msg8.payload = { \"command\" : \"switchlight\" , \"idx\" : 23 , \"switchcmd\" : \"On\" }\n} else if (msg.payload.modbus_status[9] === false) {\n msg8.payload = { \"command\" : \"switchlight\" , \"idx\" : 23 , \"switchcmd\" : \"Off\" }\n}\n\n//return [[msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8,msg9]];\nreturn [[msg1,msg2,msg4,msg5,msg8]];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1100,"y":100,"wires":[["c20e293a.3cdea8"]]},{"id":"c2ad6f52.2dabd","type":"function","z":"69f1448b.1e22f4","name":"","func":" /*jshint maxerr: 100000 */\nmsg1 = {};\nmsg2 = {};\n//msg3 = {};\nmsg4 = {};\nmsg5 = {};\n//msg6 = {};\n//msg7 = {};\nmsg8 = {};\nmsg9 = {};\nvar fault_text = {};\n\n// Register 40203\n// Fireplace Status Fault\n\nif (msg.payload.modbus_status[0] === true) {\n switch (msg.payload.modbus_fault) {\n\n case 0:\n fault_text = \"Unknown Fault code\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 1: \n fault_text = \"Communication loss between receiver and burner device\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 2: \n fault_text = \"Receiver overheated (60° above room temperature)\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 3: \n fault_text = \"Internal (receiver) NTC sensor does not work correctly\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n \n case 4: \n fault_text = \"External NTC sensor does not work correctly\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 5: \n fault_text = \"Internal safety error\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 6: \n fault_text = \"Communication loss between transmitter and receiver\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 7: \n fault_text = \"Unknown Fault code\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 8: \n fault_text = \"No ionization\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 9: \n fault_text = \"Unknown Fault code\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 10: \n fault_text = \"Unknown Fault code\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 11: \n fault_text = \"Unknown Fault code\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 12: \n fault_text = \"ESYS is not released\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 13: \n fault_text = \"(ionisation <0.8 μA) Flame loss when only the main burner is on\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 14: \n fault_text = \"(ionisation <0.8 μA) Flame loss when both burners are on\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 15: \n fault_text = \"No burner device or High limit error\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 16:\n fault_text = \"Hardware Error ESYS\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n\n case 17: \n fault_text = \"Disable contact is closed\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n break;\n \n default:\n fault_text = \"Unknown Fault code\";\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":2,\"svalue\":\"Fault code \" + \"F\" + msg.payload.modbus_fault + \"\\n\" + fault_text};\n } \n} else if (msg.payload.modbus_status[0] === false) {\n msg1.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"Normal\"}\n}\n\n// Fireplace Status Pilot flame ON\n\n//if (msg.payload.modbus_status[1] === true) {\n// msg9.payload = { \"command\" : \"switchlight\" , \"idx\" : 24 , \"switchcmd\" : \"On\" }\n//} else if (msg.payload.modbus_status[1] === false) {\n// msg9.payload = { \"command\" : \"switchlight\" , \"idx\" : 24 , \"switchcmd\" : \"Off\" }\n//}\n\n// Fireplace Status Main Burner ON\n\nif (msg.payload.modbus_status[2] === true) {\n msg2.payload = { \"command\" : \"switchlight\" , \"idx\" : 17 , \"switchcmd\" : \"On\" }\n} else if (msg.payload.modbus_status[2] === false) {\n msg2.payload = { \"command\" : \"switchlight\" , \"idx\" : 17 , \"switchcmd\" : \"Off\" }\n}\n\n// Fireplace Status Second Burner ON\n// Currently not used\n\n//if (msg.payload.modbus_status[3] === true) {\n// msg3.payload = { \"command\" : \"switchlight\" , \"idx\" : 18 , \"switchcmd\" : \"On\" }\n//} else if (msg.payload_status[3] === false) {\n// msg3.payload = { \"command\" : \"switchlight\" , \"idx\" : 18 , \"switchcmd\" : \"Off\" }\n//}\n\n// Fireplace Status Low battery DFRC\n\nif (msg.payload.modbus_status[4] === true) {\n msg4.payload = {\"command\":\"udevice\",\"idx\":19,\"nvalue\":2,\"svalue\":\"Fault\"}\n} else if (msg.payload.modbus_status[4] === false) {\n msg4.payload = {\"command\":\"udevice\",\"idx\":19,\"nvalue\":1,\"svalue\":\"Normal\"}\n}\n\n// Fireplace Status 230V phase fault\n\nif (msg.payload.modbus_status[5] === true) {\n msg5.payload = {\"command\":\"udevice\",\"idx\":20,\"nvalue\":2,\"svalue\":\"Fault\"}\n} else if (msg.payload.modbus_status[5] === false) {\n msg5.payload = {\"command\":\"udevice\",\"idx\":20,\"nvalue\":1,\"svalue\":\"Normal\"}\n}\n\n// Fireplace Status Boost Fan ON\n// Currently not used\n\n//if (msg.payload.modbus_status[7] === true) {\n// msg6.payload = { \"command\" : \"switchlight\" , \"idx\" : 21 , \"switchcmd\" : \"On\" }\n//} else if (msg.payload_status[7] === false) {\n// msg6.payload = { \"command\" : \"switchlight\" , \"idx\" : 21 , \"switchcmd\" : \"Off\" }\n//}\n\n// Fireplace Status Light ON\n// Currently not used\n\n//if (msg.payload.modbus_status[8] === true) {\n// msg7.payload = { \"command\" : \"switchlight\" , \"idx\" : 22 , \"switchcmd\" : \"On\" }\n//} else if (msg.payload_status[8] === false) {\n// msg7.payload = { \"command\" : \"switchlight\" , \"idx\" : 22 , \"switchcmd\" : \"Off\" }\n//}\n\n// Fireplace Status Wave active\n\nif (msg.payload.modbus_status[9] === true) {\n msg8.payload = { \"command\" : \"switchlight\" , \"idx\" : 23 , \"switchcmd\" : \"On\" }\n} else if (msg.payload.modbus_status[9] === false) {\n msg8.payload = { \"command\" : \"switchlight\" , \"idx\" : 23 , \"switchcmd\" : \"Off\" }\n}\n\n//return [[msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8,msg9]];\nreturn [[msg1,msg2,msg4,msg5,msg8]];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1100,"y":260,"wires":[[]]},{"id":"82922db3.6a5b88","type":"comment","z":"69f1448b.1e22f4","name":"English","info":"","x":1090,"y":220,"wires":[]},{"id":"bdd14a.a06c56b8","type":"link in","z":"69f1448b.1e22f4","name":"From Google Home","links":["5b0023b8.5845fc"],"x":295,"y":720,"wires":[["9d0a3143.9bede8"]]},{"id":"12332a5e.1289ee","type":"link in","z":"69f1448b.1e22f4","name":"From Google Home Flame height","links":["4f77570a.2bd55"],"x":295,"y":920,"wires":[["f102acd8.9d50b"]]},{"id":"917605be.cc1c8","type":"comment","z":"69f1448b.1e22f4","name":"Dutch","info":"","x":1090,"y":60,"wires":[]},{"id":"eaeccf99.767198","type":"modbus-client","z":"69f1448b.1e22f4","name":"Simulator","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.10.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"2","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"f8bdbf46.ef61f8","type":"modbus-client","name":"Simulator","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.10.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":2,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true}]