[ { "id": "a55db3cf.a9df8", "type": "tab", "label": "Hausautomation", "disabled": false, "info": "" }, { "id": "615e410f.4920e", "type": "subflow", "name": "Create on/off payload", "info": "", "category": "", "in": [ { "x": 360, "y": 240, "wires": [ { "id": "533047f6.aef4b8" } ] } ], "out": [ { "x": 780, "y": 240, "wires": [ { "id": "533047f6.aef4b8", "port": 0 } ] } ], "env": [], "color": "#DDAA99" }, { "id": "5b193bb4.bc66c4", "type": "pilight-daemon", "z": "", "host": "localhost", "port": "5000" }, { "id": "7aea49fd.0996a", "type": "function", "z": "a55db3cf.a9df8", "name": "livingroom lamp", "func": "device=\"protocol=pollin&systemcode=31&unitcode=4\"\ntarget=\"http://192.168.0.12:5001\"\n\nurl=target+\"/send?\"+device+\"&\"+msg.payload\n\nmsg = {\n url: url,\n payload: url\n};\n\nreturn msg", "outputs": 1, "noerr": 0, "x": 880, "y": 200, "wires": [ [ "629964dd.bf340c" ] ] }, { "id": "8393117e.122f88", "type": "inject", "z": "a55db3cf.a9df8", "name": "On", "topic": "", "payload": "true", "payloadType": "bool", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 650, "y": 40, "wires": [ [ "1e5ec2c7.6d94e5" ] ] }, { "id": "cc908c6e.ee1a1", "type": "inject", "z": "a55db3cf.a9df8", "name": "Off", "topic": "", "payload": "false", "payloadType": "bool", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 650, "y": 80, "wires": [ [ "1e5ec2c7.6d94e5" ] ] }, { "id": "4825fe5f.f48af8", "type": "cronplus", "z": "a55db3cf.a9df8", "name": "Every 5 seconds", "outputField": "payload", "timeZone": "", "persistDynamic": false, "commandResponseMsgOutput": "output1", "outputs": 1, "options": [ { "name": "schedule1", "topic": "schedule1", "payloadType": "str", "payload": "1", "expressionType": "cron", "expression": "*/5 * * * * *", "location": "", "offset": "0", "solarType": "all", "solarEvents": "sunrise,sunset" } ], "x": 120, "y": 440, "wires": [ [ "5373a23f.3f7b2c" ] ] }, { "id": "5373a23f.3f7b2c", "type": "trigger", "z": "a55db3cf.a9df8", "op1": "true", "op2": "false", "op1type": "bool", "op2type": "bool", "duration": "1500", "extend": false, "units": "ms", "reset": "", "bytopic": "all", "name": "Trigger", "x": 140, "y": 500, "wires": [ [] ] }, { "id": "b305a38a.1277e8", "type": "cronplus", "z": "a55db3cf.a9df8", "name": "Sunset", "outputField": "payload", "timeZone": "", "persistDynamic": false, "commandResponseMsgOutput": "output1", "outputs": 1, "options": [ { "name": "schedule1", "topic": "schedule1", "payloadType": "bool", "payload": "true", "expressionType": "solar", "expression": "0 * * * * * *", "location": "48.77424643027838 8.934674263000488", "offset": "0", "solarType": "selected", "solarEvents": "eveningGoldenHourStart" } ], "x": 120, "y": 200, "wires": [ [ "5c6687e0.d6b888" ] ] }, { "id": "cc06fa0f.63dce", "type": "cronplus", "z": "a55db3cf.a9df8", "name": "Go to sleep", "outputField": "payload", "timeZone": "", "persistDynamic": false, "commandResponseMsgOutput": "output1", "outputs": 1, "options": [ { "name": "schedule1", "topic": "schedule1", "payloadType": "bool", "payload": "false", "expressionType": "cron", "expression": "0 0 22 * * 1,2,3,4,5", "location": "", "offset": "0", "solarType": "selected", "solarEvents": "sunrise,sunset" }, { "name": "schedule2", "topic": "schedule2", "payloadType": "bool", "payload": "false", "expressionType": "cron", "expression": "0 0 23 * * 5,6", "location": "", "offset": "0", "solarType": "all", "solarEvents": "sunrise,sunset" } ], "x": 110, "y": 320, "wires": [ [ "5c6687e0.d6b888" ] ] }, { "id": "ecdd962a.72e47", "type": "function", "z": "a55db3cf.a9df8", "name": "1st floor corridor lamp", "func": "device=\"protocol=pollin&systemcode=31&unitcode=2\"\ntarget=\"http://192.168.0.12:5001\"\n\nurl=target+\"/send?\"+device+\"&\"+msg.payload\n\nmsg = {\n url: url,\n payload: url\n};\n\nreturn msg", "outputs": 1, "noerr": 0, "x": 860, "y": 380, "wires": [ [ "629964dd.bf340c" ] ] }, { "id": "19d4f66a.92ef1a", "type": "inject", "z": "a55db3cf.a9df8", "name": "Off", "topic": "", "payload": "false", "payloadType": "bool", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 650, "y": 320, "wires": [ [ "7dacb801.ea1f98" ] ] }, { "id": "629964dd.bf340c", "type": "http request", "z": "a55db3cf.a9df8", "name": "pilight send", "method": "GET", "ret": "txt", "paytoqs": false, "url": "", "tls": "", "persist": false, "proxy": "", "authType": "", "x": 1150, "y": 380, "wires": [ [ "94607ff6.e8cb5" ] ] }, { "id": "7d47b4af.13b25c", "type": "function", "z": "a55db3cf.a9df8", "name": "2nd floor corridor lamp", "func": "device=\"protocol=kaku_switch&id=17610602&unit=0\"\ntarget=\"http://192.168.0.12:5001\"\n\nurl=target+\"/send?\"+device+\"&\"+msg.payload\n\nmsg = {\n url: url,\n payload: url\n};\n\nreturn msg", "outputs": 1, "noerr": 0, "x": 860, "y": 540, "wires": [ [ "629964dd.bf340c" ] ] }, { "id": "d7bc5471.0ee06", "type": "inject", "z": "a55db3cf.a9df8", "name": "On", "topic": "", "payload": "true", "payloadType": "bool", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 650, "y": 540, "wires": [ [ "d1b290d5.38a8e" ] ] }, { "id": "a603ab28.3497", "type": "inject", "z": "a55db3cf.a9df8", "name": "Off", "topic": "", "payload": "false", "payloadType": "bool", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 650, "y": 600, "wires": [ [ "d1b290d5.38a8e" ] ] }, { "id": "5c6687e0.d6b888", "type": "function", "z": "a55db3cf.a9df8", "name": "All Lamps", "func": "\nreturn msg;", "outputs": 1, "noerr": 0, "x": 380, "y": 380, "wires": [ [ "1e5ec2c7.6d94e5", "7dacb801.ea1f98", "d1b290d5.38a8e" ] ] }, { "id": "466a38bc.1aaf9", "type": "inject", "z": "a55db3cf.a9df8", "name": "On", "topic": "", "payload": "true", "payloadType": "bool", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 110, "y": 660, "wires": [ [ "5c6687e0.d6b888" ] ] }, { "id": "b9c10423.c56148", "type": "inject", "z": "a55db3cf.a9df8", "name": "Off", "topic": "", "payload": "false", "payloadType": "bool", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 110, "y": 700, "wires": [ [ "5c6687e0.d6b888" ] ] }, { "id": "a74d90de.631f", "type": "comment", "z": "a55db3cf.a9df8", "name": "Turn lamps on", "info": "", "x": 110, "y": 160, "wires": [] }, { "id": "773765dc.57244c", "type": "comment", "z": "a55db3cf.a9df8", "name": "Turn lamps off", "info": "", "x": 110, "y": 280, "wires": [] }, { "id": "b248ad09.98019", "type": "comment", "z": "a55db3cf.a9df8", "name": "Manual control of all lamps", "info": "", "x": 140, "y": 620, "wires": [] }, { "id": "d53ea6eb.a55ea", "type": "comment", "z": "a55db3cf.a9df8", "name": "Toggle lamps every 5 seconds", "info": "", "x": 120, "y": 400, "wires": [] }, { "id": "52b643df.7a01f4", "type": "comment", "z": "a55db3cf.a9df8", "name": "(c) Copyright 2020 - framp @ linux-tips-and-tricks.de", "info": "", "x": 650, "y": 700, "wires": [] }, { "id": "533047f6.aef4b8", "type": "change", "z": "615e410f.4920e", "name": "Create On/Off Payload", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "on=1", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "off=1", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 580, "y": 240, "wires": [ [] ] }, { "id": "1e5ec2c7.6d94e5", "type": "subflow:615e410f.4920e", "z": "a55db3cf.a9df8", "name": "", "env": [], "x": 860, "y": 140, "wires": [ [ "7aea49fd.0996a" ] ] }, { "id": "7dacb801.ea1f98", "type": "subflow:615e410f.4920e", "z": "a55db3cf.a9df8", "name": "", "env": [], "x": 860, "y": 340, "wires": [ [ "ecdd962a.72e47" ] ] }, { "id": "d1b290d5.38a8e", "type": "subflow:615e410f.4920e", "z": "a55db3cf.a9df8", "name": "", "env": [], "x": 860, "y": 500, "wires": [ [ "7d47b4af.13b25c" ] ] }, { "id": "a83727ae.cf604", "type": "pilight-receive", "z": "a55db3cf.a9df8", "name": "", "server": "5b193bb4.bc66c4", "x": 1140, "y": 540, "wires": [ [ "a78782ed.a43f98" ] ] }, { "id": "a78782ed.a43f98", "type": "debug", "z": "a55db3cf.a9df8", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "x": 1240, "y": 620, "wires": [] }, { "id": "94607ff6.e8cb5", "type": "debug", "z": "a55db3cf.a9df8", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "x": 1320, "y": 340, "wires": [] }, { "id": "4419d36f.ccfe3c", "type": "inject", "z": "a55db3cf.a9df8", "name": "On", "topic": "", "payload": "true", "payloadType": "bool", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 650, "y": 280, "wires": [ [ "7dacb801.ea1f98" ] ] } ]