Apollon77/daikin-controller

View on GitHub
docs/node-red/Testflow-Daikin_node-red.json

Summary

Maintainability
Test Coverage
[{"id":"c793909b.479df","type":"tab","label":"Daikin-TEST","disabled":false,"info":"This is a **test flow** for a **Daikin air conditioning** unit."},{"id":"da261ba2.e5112","type":"function","z":"c793909b.479df","name":"Daikin AC-Sensor-Info","func":"var DaikinAC = global.get('DaikinAC');\n\nvar daikin = new DaikinAC.DaikinAC(global.get(\"DaikinDeviceIP\"), global.get(\"DaikinOptions\"), function(err) {\n\n    daikin.getACSensorInfo(function(err)\n    {\n        node.send(daikin.currentACSensorInfo);\n    });   \n\n}.bind({msg: msg}));","outputs":1,"noerr":0,"x":400,"y":224,"wires":[["2ddb88.d051d478"]]},{"id":"61bdd343.c4878c","type":"inject","z":"c793909b.479df","name":"another simple query...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":224,"wires":[["da261ba2.e5112"]]},{"id":"b40cf0d0.948ea8","type":"function","z":"c793909b.479df","name":"Daikin Common-Basic-Info","func":"var DaikinAC = global.get('DaikinAC');\n\nvar daikin = new DaikinAC.DaikinAC(global.get(\"DaikinDeviceIP\"), global.get(\"DaikinOptions\"), function(err) {\n\n    daikin.getCommonBasicInfo(function(err)\n    {\n        node.send(daikin.currentCommonBasicInfo);\n    });   \n\n}.bind({msg: msg}));","outputs":1,"noerr":0,"x":420,"y":184,"wires":[["2ddb88.d051d478"]]},{"id":"a6e57067.e14978","type":"inject","z":"c793909b.479df","name":"a simple query...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":184,"wires":[["b40cf0d0.948ea8"]]},{"id":"d22b2870.e06cb","type":"inject","z":"c793909b.479df","name":"a simple command...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":360,"wires":[["9ed96bd.c6b8798"]]},{"id":"9ed96bd.c6b8798","type":"function","z":"c793909b.479df","name":"Daikin Power ON","func":"var DaikinAC = global.get('DaikinAC');\n\nvar daikin = new DaikinAC.DaikinAC(global.get(\"DaikinDeviceIP\"), global.get(\"DaikinOptions\"), function(err) {\n    \n    var vals = \n    {    \n        'power': true,\n        'mode': 6,\n        'fanRate': \"A\",\n        'targetTemperature': 20.0,\n        'targetHumidity': 50,\n        'fanDirection': 3\n    };\n\n    daikin.setACControlInfo(vals, function(err, response) {\n\n        daikin.getACControlInfo(function(err)\n        {\n            if (daikin.currentACControlInfo.power === true)\n            node.log(\"success! :)\")\n            else\n            node.log(\"The device is not in operation. :(\")\n        });   \n\n    });\n\n}.bind({msg: msg}));","outputs":0,"noerr":0,"x":390,"y":360,"wires":[]},{"id":"455e0271.c667f4","type":"comment","z":"c793909b.479df","name":"before using, please SWITCH OFF the device ;)","info":"The device should switch on with the following settings:\n**Operating mode:** Auto\n**Fan level:** Auto\n**Target temperature:** 20 °C","x":680,"y":360,"wires":[]},{"id":"757469a4.4d2c58","type":"inject","z":"c793909b.479df","name":"a simple command...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":400,"wires":[["29cac235.136c3e"]]},{"id":"29cac235.136c3e","type":"function","z":"c793909b.479df","name":"Daikin Power OFF","func":"var DaikinAC = global.get('DaikinAC');\n\nvar daikin = new DaikinAC.DaikinAC(global.get(\"DaikinDeviceIP\"), global.get(\"DaikinOptions\"), function(err) {\n    \n    var vals = \n    {    \n        'power': false\n    };\n\n    daikin.setACControlInfo(vals, function(err, response) {\n\n        daikin.getACControlInfo(function(err)\n        {\n            if (daikin.currentACControlInfo.power === false)\n            node.log(\"success! :)\")\n            else\n            node.log(\"The device is still in operation. :(\")\n        });   \n\n    });\n\n}.bind({msg: msg}));","outputs":0,"noerr":0,"x":390,"y":400,"wires":[]},{"id":"232648b9.9b4028","type":"comment","z":"c793909b.479df","name":"before using, please SWITCH ON the device ;)","info":"","x":680,"y":400,"wires":[]},{"id":"e06db67a.23fd4","type":"comment","z":"c793909b.479df","name":"Information: The output is done in the \"Debugging\" window.","info":"","x":240,"y":144,"wires":[]},{"id":"6df569f7.fe26d8","type":"comment","z":"c793909b.479df","name":"Information: The output is done in the console.","info":"","x":200,"y":320,"wires":[]},{"id":"3d638de.177fef2","type":"inject","z":"c793909b.479df","name":"initialization","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":40,"wires":[["52e662dd.91e65c"]]},{"id":"52e662dd.91e65c","type":"function","z":"c793909b.479df","name":"Global set: DaikinDeviceIP","func":"// Set the IP-Adress\nglobal.set(\"DaikinDeviceIP\",'192.168.0.100');\n\n// Set options: NORMAL USE (only BRP069B**, BRP084A42-1)\nglobal.set(\"DaikinOptions\",{'useGetToPost':true}); \n\n// Set options: DEBUG MODUS (only BRP069B**, BRP084A42-1)\n//global.set(\"DaikinOptions\",{'logger': console.log,'useGetToPost':true});\n\n// Set options: NORMAL USE (only BRP069A**)\n//global.set(\"DaikinOptions\",{}); \n\n// Set options: DEBUG MODUS (only BRP069A**)\n//global.set(\"DaikinOptions\",{'logger': console.log,});","outputs":0,"noerr":0,"x":320,"y":40,"wires":[],"icon":"font-awesome/fa-globe"},{"id":"2ddb88.d051d478","type":"debug","z":"c793909b.479df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":670,"y":204,"wires":[]}]