[ { "id": "fbd0cf6e86f963d3", "type": "tab", "label": "Senec APP API", "disabled": false, "info": "", "env": [] }, { "id": "98ccb7f9f8dcc28c", "type": "inject", "z": "fbd0cf6e86f963d3", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"username\":$flowContext(\"username\"),\"password\":$flowContext(\"password\")}", "payloadType": "jsonata", "x": 90, "y": 240, "wires": [ [ "eed9c58ad9141b8f" ] ] }, { "id": "eed9c58ad9141b8f", "type": "http request", "z": "fbd0cf6e86f963d3", "name": "login", "method": "POST", "ret": "obj", "paytoqs": "ignore", "url": "https://app-gateway.prod.senec.dev/v1/senec/login", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "x": 310, "y": 240, "wires": [ [ "2b75af4deb61d0ca" ] ] }, { "id": "aeede202545dee4d", "type": "debug", "z": "fbd0cf6e86f963d3", "name": "debug 43", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1000, "y": 240, "wires": [] }, { "id": "2b75af4deb61d0ca", "type": "change", "z": "fbd0cf6e86f963d3", "name": "", "rules": [ { "t": "set", "p": "SENEC_TOKEN", "pt": "flow", "to": "payload.token", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 760, "y": 240, "wires": [ [ "aeede202545dee4d" ] ] }, { "id": "3ae5ef98d9520e65", "type": "http request", "z": "fbd0cf6e86f963d3", "name": "systems", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "https://app-gateway.prod.senec.dev/v1/senec/systems", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "x": 320, "y": 320, "wires": [ [ "ceca6d24e3d55898", "ab947e495561b414" ] ] }, { "id": "ab947e495561b414", "type": "debug", "z": "fbd0cf6e86f963d3", "name": "debug 44", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1060, "y": 600, "wires": [] }, { "id": "a211f594f00f56bc", "type": "function", "z": "fbd0cf6e86f963d3", "name": "timestamp von ms in sec", "func": "msg.NOW = Math.floor(msg.NOW/1000);\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 370, "y": 720, "wires": [ [ "520ea25be03fcc2c" ] ] }, { "id": "ceca6d24e3d55898", "type": "change", "z": "fbd0cf6e86f963d3", "name": "", "rules": [ { "t": "set", "p": "SENEC_ANLAGE", "pt": "flow", "to": "payload[0].id", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 760, "y": 320, "wires": [ [] ] }, { "id": "5092de5fdcc4bbc1", "type": "inject", "z": "fbd0cf6e86f963d3", "name": "", "props": [ { "p": "SENEC_ANLAGE", "v": "SENEC_ANLAGE", "vt": "flow" }, { "p": "SENEC_TOKEN", "v": "SENEC_TOKEN", "vt": "flow" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 90, "y": 440, "wires": [ [ "534be77e0f2ea08d" ] ] }, { "id": "534be77e0f2ea08d", "type": "http request", "z": "fbd0cf6e86f963d3", "name": "systems/{{SENEC_ANLAGE}}/technical-data", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "https://app-gateway.prod.senec.dev/v1/senec/systems/{{SENEC_ANLAGE}}/technical-data", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "x": 430, "y": 440, "wires": [ [ "ab947e495561b414", "8981df1a97dda17a" ] ] }, { "id": "7b1a9c972ad0191c", "type": "inject", "z": "fbd0cf6e86f963d3", "name": "", "props": [ { "p": "SENEC_TOKEN", "v": "SENEC_TOKEN", "vt": "flow" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 90, "y": 320, "wires": [ [ "3ae5ef98d9520e65" ] ] }, { "id": "72c3240cedca531b", "type": "inject", "z": "fbd0cf6e86f963d3", "name": "", "props": [ { "p": "SENEC_ANLAGE", "v": "SENEC_ANLAGE", "vt": "flow" }, { "p": "SENEC_TOKEN", "v": "SENEC_TOKEN", "vt": "flow" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 90, "y": 520, "wires": [ [ "7b79b21875e1bc27" ] ] }, { "id": "7b79b21875e1bc27", "type": "http request", "z": "fbd0cf6e86f963d3", "name": "v1/systems/{{SENEC_ANLAGE}}/dashboard", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "https://app-gateway.prod.senec.dev/v2/senec/systems/{{SENEC_ANLAGE}}/dashboard", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "credentials": {}, "x": 430, "y": 520, "wires": [ [ "ab947e495561b414" ] ] }, { "id": "fc0a471cf2edf53b", "type": "inject", "z": "fbd0cf6e86f963d3", "name": "", "props": [ { "p": "SENEC_ANLAGE", "v": "SENEC_ANLAGE", "vt": "flow" }, { "p": "SENEC_TOKEN", "v": "SENEC_TOKEN", "vt": "flow" } ], "repeat": "60", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 90, "y": 600, "wires": [ [ "3aa553f9da1bb32d" ] ] }, { "id": "3aa553f9da1bb32d", "type": "http request", "z": "fbd0cf6e86f963d3", "name": "v2/systems/{{SENEC_ANLAGE}}/dashboard", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "https://app-gateway.prod.senec.dev/v2/senec/systems/{{SENEC_ANLAGE}}/dashboard", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "x": 430, "y": 600, "wires": [ [ "ab947e495561b414", "7e1943caa1970f4b", "3b68c402ebe6a077", "44b78169fbcd9b71", "7ddc20d69856c6d1", "ce9da8649d7545f9", "b2199673a4fde32f", "56799b113e79e19e" ] ] }, { "id": "428c3d4db14c4c20", "type": "inject", "z": "fbd0cf6e86f963d3", "name": "", "props": [ { "p": "SENEC_ANLAGE", "v": "SENEC_ANLAGE", "vt": "flow" }, { "p": "SENEC_TOKEN", "v": "SENEC_TOKEN", "vt": "flow" }, { "p": "DATE", "v": "2023-11-12", "vt": "str" }, { "p": "PERIOD", "v": "DAY", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 90, "y": 660, "wires": [ [ "d7c6a15e81b1a6a6" ] ] }, { "id": "d7c6a15e81b1a6a6", "type": "http request", "z": "fbd0cf6e86f963d3", "name": "v1/systems/{{SENEC_ANLAGE}}/Monitor", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "https://app-gateway.prod.senec.dev/v1/senec/monitor/{{SENEC_ANLAGE}}/data?period={{PERIOD}}&date={{DATE}}&locale=de_DE&timezone=Europe%2FBerlin", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "x": 420, "y": 660, "wires": [ [ "ab947e495561b414" ] ] }, { "id": "3032dcc91dbfb39b", "type": "inject", "z": "fbd0cf6e86f963d3", "name": "", "props": [ { "p": "SENEC_ANLAGE", "v": "SENEC_ANLAGE", "vt": "flow" }, { "p": "SENEC_TOKEN", "v": "SENEC_TOKEN", "vt": "flow" }, { "p": "NOW", "v": "", "vt": "date" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 90, "y": 720, "wires": [ [ "a211f594f00f56bc" ] ] }, { "id": "520ea25be03fcc2c", "type": "http request", "z": "fbd0cf6e86f963d3", "name": "v1/senec/systems/{{SENEC_ANLAGE}}/measurements", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "https://app-gateway.prod.senec.dev/v1/senec/systems/{{SENEC_ANLAGE}}/measurements?resolution=YEAR&from=1672531200&to={{NOW}}", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "x": 740, "y": 720, "wires": [ [ "ab947e495561b414" ] ] }, { "id": "8981df1a97dda17a", "type": "change", "z": "fbd0cf6e86f963d3", "name": "", "rules": [ { "t": "set", "p": "SENEC_CONTROLLER", "pt": "flow", "to": "payload.mcu.mainControllerSerial", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 780, "y": 440, "wires": [ [] ] }, { "id": "f35020853d68f4b7", "type": "comment", "z": "fbd0cf6e86f963d3", "name": "Initialisierung Flow Variable. Senec username und password eintragen", "info": "", "x": 270, "y": 80, "wires": [] }, { "id": "57092ded5197a7e8", "type": "comment", "z": "fbd0cf6e86f963d3", "name": "Login Service holt Token und setzt in flow Variable SENEC_TOKEN zur Nutzung in allen weiteren Services", "info": "", "x": 380, "y": 180, "wires": [] }, { "id": "a3e685afbc0384db", "type": "comment", "z": "fbd0cf6e86f963d3", "name": "Login Service holt Analgen Nummer und setzt in flow Variable SENEC_ANLAGE zur Nutzung in allen weiteren Services", "info": "", "x": 420, "y": 280, "wires": [] }, { "id": "89ac81f8703a9590", "type": "comment", "z": "fbd0cf6e86f963d3", "name": "Login Service holt Controller Nummer und setzt in flow Variable SENEC_CONTOLLER zur Nutzung in Service Online state", "info": "", "x": 430, "y": 380, "wires": [] }, { "id": "0d87858139708a3b", "type": "inject", "z": "fbd0cf6e86f963d3", "name": "", "props": [ { "p": "SENEC_CONTROLLER", "v": "SENEC_CONTROLLER", "vt": "flow" }, { "p": "SENEC_TOKEN", "v": "SENEC_TOKEN", "vt": "flow" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 90, "y": 780, "wires": [ [ "0c53bbb0dc3dd47a" ] ] }, { "id": "0c53bbb0dc3dd47a", "type": "http request", "z": "fbd0cf6e86f963d3", "name": "v2/systems/{{SENEC_CONTROLLER}}/online-state", "method": "GET", "ret": "obj", "paytoqs": "ignore", "url": "https://app-gateway.prod.senec.dev/v2/senec/systems/{{SENEC_CONTROLLER}}/online-state", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "x": 450, "y": 780, "wires": [ [ "ab947e495561b414" ] ] }, { "id": "8ea298d22026a934", "type": "config", "z": "fbd0cf6e86f963d3", "name": "", "properties": [ { "p": "SENEC_TOKEN", "pt": "flow", "to": "to be set with senec login service", "tot": "str" }, { "p": "SENEC_ANLAGE", "pt": "flow", "to": "", "tot": "num" }, { "p": "SENEC_CONTROLLER", "pt": "flow", "to": "set with technical data-service", "tot": "str" }, { "p": "username", "pt": "flow", "to": "", "tot": "str" }, { "p": "password", "pt": "flow", "to": "", "tot": "str" } ], "active": true, "x": 90, "y": 120, "wires": [] }, { "id": "7e1943caa1970f4b", "type": "change", "z": "fbd0cf6e86f963d3", "name": "PVErzeugung", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.today.powerGenerationInWh", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1080, "y": 660, "wires": [ [ "a9ed0a84f5ad0c58" ] ] }, { "id": "7ddc20d69856c6d1", "type": "change", "z": "fbd0cf6e86f963d3", "name": "Strombezug", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.today.gridDrawInWh", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1070, "y": 780, "wires": [ [ "771c459b0f23f850" ] ] }, { "id": "44b78169fbcd9b71", "type": "change", "z": "fbd0cf6e86f963d3", "name": "Einspeisung", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.today.gridFeedInInWh", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1070, "y": 740, "wires": [ [ "6756b2e83b7555d3" ] ] }, { "id": "3b68c402ebe6a077", "type": "change", "z": "fbd0cf6e86f963d3", "name": "Hausverbrauch", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.today.powerConsumptionInWh", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1080, "y": 700, "wires": [ [ "48214d65ab0d116e" ] ] }, { "id": "ce9da8649d7545f9", "type": "change", "z": "fbd0cf6e86f963d3", "name": "Autarkie", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.today.selfSufficiencyInPercent", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1060, "y": 820, "wires": [ [ "c03d63667cb1a866" ] ] }, { "id": "a9ed0a84f5ad0c58", "type": "ioBroker out", "z": "fbd0cf6e86f963d3", "name": "PVErzeugung", "topic": "0_userdata.0.vis.Senec.temp_Database.PVErzeugung", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1300, "y": 660, "wires": [] }, { "id": "c03d63667cb1a866", "type": "ioBroker out", "z": "fbd0cf6e86f963d3", "name": "Autarkie", "topic": "0_userdata.0.vis.Senec.temp_Database.Autarkie", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1280, "y": 820, "wires": [] }, { "id": "771c459b0f23f850", "type": "ioBroker out", "z": "fbd0cf6e86f963d3", "name": "Strombezug", "topic": "0_userdata.0.vis.Senec.temp_Database.Strombezug", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1290, "y": 780, "wires": [] }, { "id": "6756b2e83b7555d3", "type": "ioBroker out", "z": "fbd0cf6e86f963d3", "name": "Einspeisung", "topic": "0_userdata.0.vis.Senec.temp_Database.Einspeisung", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1290, "y": 740, "wires": [] }, { "id": "48214d65ab0d116e", "type": "ioBroker out", "z": "fbd0cf6e86f963d3", "name": "Hausverbrauch", "topic": "0_userdata.0.vis.Senec.temp_Database.Hausverbrauch", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1300, "y": 700, "wires": [] }, { "id": "f2c10bcf4226f0d3", "type": "ioBroker out", "z": "fbd0cf6e86f963d3", "name": "Speicherbeladung", "topic": "0_userdata.0.vis.Senec.temp_Database.Speicherbeladung", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1310, "y": 900, "wires": [] }, { "id": "4de684a4245b5925", "type": "ioBroker out", "z": "fbd0cf6e86f963d3", "name": "Speicherentladung", "topic": "0_userdata.0.vis.Senec.temp_Database.Speicherentladung", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1310, "y": 960, "wires": [] }, { "id": "b2199673a4fde32f", "type": "change", "z": "fbd0cf6e86f963d3", "name": "Speicherbeladung", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.today.batteryChargeInWh", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1110, "y": 900, "wires": [ [ "f2c10bcf4226f0d3" ] ] }, { "id": "56799b113e79e19e", "type": "change", "z": "fbd0cf6e86f963d3", "name": "Speicherentladung", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.today.batteryDischargeInWh", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1110, "y": 960, "wires": [ [ "4de684a4245b5925" ] ] } ]