[
   {
       "id": "63c4ad536edd32b7",
       "type": "group",
       "z": "a3ff42d9e3f31af7",
       "style": {
           "stroke": "#999999",
           "stroke-opacity": "1",
           "fill": "none",
           "fill-opacity": "1",
           "label": true,
           "label-position": "nw",
           "color": "#a4a4a4"
       },
       "nodes": [
           "f994a4e33531a8c5",
           "8673242f12284d52",
           "27eecf831db301d2",
           "bd2d29a18401d1c5",
           "f5b7161642107f77",
           "0a64877c69c15599",
           "b4cd49fa76bc511c",
           "860c69c409434a60",
           "3345c9a98a678993",
           "1d495447e96a3a24",
           "d208c8c4552eed40",
           "b4802b321ce23e92",
           "cfef92ce1099aabc",
           "68dcc9282e6f1562",
           "4352e22b6fb056a1",
           "1f6db3ae891ae6f9",
           "4ade18cbedf1f800",
           "e19cacdcf99fdc0f",
           "08ed4a797b81c710",
           "0fce39dffa24add3",
           "1066884b98e7ebf3",
           "ad8d7bae4667baf5"
       ],
       "x": 14,
       "y": 919,
       "w": 1952,
       "h": 262
   },
   {
       "id": "f994a4e33531a8c5",
       "type": "inject",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Shelly Input",
       "props": [
           {
               "p": "status",
               "v": "{\"wifi_sta\":{\"connected\":true,\"ssid\":\"Kellerfritz\",\"ip\":\"192.168.2.196\",\"rssi\":-46},\"cloud\":{\"enabled\":false,\"connected\":false},\"mqtt\":{\"connected\":false},\"time\":\"15:16\",\"serial\":1,\"has_update\":true,\"mac\":\"10521C06EE47\",\"relays\":[{\"ison\":false,\"has_timer\":false,\"overpower\":false,\"overtemperature\":false,\"is_valid\":true},{\"ison\":false,\"has_timer\":false,\"overpower\":false,\"overtemperature\":false,\"is_valid\":true}],\"rollers\":[{\"state\":\"stop\",\"power\":0,\"is_valid\":true,\"safety_switch\":false,\"overtemperature\":false,\"stop_reason\":\"normal\",\"last_direction\":\"stop\",\"current_pos\":101,\"calibrating\":false,\"positioning\":true}],\"meters\":[{\"power\":0,\"is_valid\":true,\"timestamp\":1689347786,\"counters\":[0,0,0],\"total\":0},{\"power\":0,\"is_valid\":true,\"timestamp\":1689347786,\"counters\":[0,0,0],\"total\":0}],\"inputs\":[{\"input\":0},{\"input\":0}],\"temperature\":56.18,\"overtemperature\":false,\"tmp\":{\"tC\":56.18,\"tF\":133.12,\"is_valid\":\"true\"},\"update\":{\"status\":\"pending\",\"has_update\":true,\"new_version\":\"20230503-095750/v1.13.0-g9aed950\",\"old_version\":\"20191217-074901/1047-long-id-for-shelly-devices@ab2bdce7\"},\"ram_total\":49480,\"ram_free\":37016,\"fs_size\":233681,\"fs_free\":157628,\"voltage\":235.06,\"uptime\":6684}",
               "vt": "json"
           },
           {
               "p": "payload"
           }
       ],
       "repeat": "",
       "crontab": "",
       "once": false,
       "onceDelay": 0.1,
       "topic": "",
       "payload": "{\"relays\":[{\"ison\":false,\"has_timer\":false,\"overpower\":false,\"overtemperature\":false,\"is_valid\":true},{\"ison\":false,\"has_timer\":false,\"overpower\":false,\"overtemperature\":false,\"is_valid\":true}],\"rollers\":[{\"state\":\"stop\",\"power\":0,\"is_valid\":true,\"safety_switch\":false,\"overtemperature\":false,\"stop_reason\":\"normal\",\"last_direction\":\"stop\",\"current_pos\":101,\"calibrating\":false,\"positioning\":true}],\"meters\":[{\"power\":0,\"is_valid\":true,\"timestamp\":1689347786,\"counters\":[0,0,0],\"total\":0},{\"power\":0,\"is_valid\":true,\"timestamp\":1689347786,\"counters\":[0,0,0],\"total\":0}],\"inputs\":[{\"input\":0},{\"input\":0}],\"tmp\":{\"tC\":56.18,\"tF\":133.12,\"is_valid\":\"true\"}}",
       "payloadType": "json",
       "x": 130,
       "y": 1020,
       "wires": [
           [
               "8673242f12284d52",
               "4ade18cbedf1f800",
               "1f6db3ae891ae6f9",
               "e19cacdcf99fdc0f"
           ]
       ]
   },
   {
       "id": "8673242f12284d52",
       "type": "change",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "",
       "rules": [
           {
               "t": "set",
               "p": "EnergieManagement",
               "pt": "msg",
               "to": "EnergieManagement",
               "tot": "flow"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 370,
       "y": 1020,
       "wires": [
           [
               "b4cd49fa76bc511c"
           ]
       ]
   },
   {
       "id": "27eecf831db301d2",
       "type": "switch",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Status Relais 1",
       "property": "payload.relays[0].ison",
       "propertyType": "msg",
       "rules": [
           {
               "t": "true"
           },
           {
               "t": "false"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 2,
       "x": 940,
       "y": 1000,
       "wires": [
           [
               "860c69c409434a60"
           ],
           [
               "bd2d29a18401d1c5"
           ]
       ]
   },
   {
       "id": "bd2d29a18401d1c5",
       "type": "switch",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Summe > Einschwelle ?",
       "property": "EnergieManagement.Summe > EnergieManagement.Einschwelle ",
       "propertyType": "jsonata",
       "rules": [
           {
               "t": "true"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 1,
       "x": 1190,
       "y": 1020,
       "wires": [
           [
               "f5b7161642107f77"
           ]
       ]
   },
   {
       "id": "f5b7161642107f77",
       "type": "change",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Relais 1 einschalten",
       "rules": [
           {
               "t": "set",
               "p": "payload",
               "pt": "msg",
               "to": "{\"relay\":0,\"on\":true}",
               "tot": "json"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 1440,
       "y": 1020,
       "wires": [
           [
               "ad8d7bae4667baf5"
           ]
       ]
   },
   {
       "id": "0a64877c69c15599",
       "type": "debug",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Shelly command Relais1",
       "active": true,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "payload",
       "targetType": "msg",
       "statusVal": "",
       "statusType": "auto",
       "x": 1810,
       "y": 980,
       "wires": []
   },
   {
       "id": "b4cd49fa76bc511c",
       "type": "switch",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Check valide Ein und Ausschwelle",
       "property": " EnergieManagement.Einschwelle > EnergieManagement.Ausschwelle",
       "propertyType": "jsonata",
       "rules": [
           {
               "t": "true"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 1,
       "x": 680,
       "y": 1020,
       "wires": [
           [
               "27eecf831db301d2",
               "cfef92ce1099aabc"
           ]
       ]
   },
   {
       "id": "860c69c409434a60",
       "type": "switch",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Summe > Einschwelle ?",
       "property": "EnergieManagement.Summe > EnergieManagement.Einschwelle ",
       "propertyType": "jsonata",
       "rules": [
           {
               "t": "true"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 1,
       "x": 1190,
       "y": 980,
       "wires": [
           [
               "3345c9a98a678993"
           ]
       ]
   },
   {
       "id": "3345c9a98a678993",
       "type": "change",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Relais 2 einschalten",
       "rules": [
           {
               "t": "set",
               "p": "payload",
               "pt": "msg",
               "to": "{\"relay\":1,\"on\":true}",
               "tot": "json"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 1440,
       "y": 980,
       "wires": [
           [
               "1066884b98e7ebf3"
           ]
       ]
   },
   {
       "id": "1d495447e96a3a24",
       "type": "debug",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Shelly command Relais2",
       "active": true,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "payload",
       "targetType": "msg",
       "statusVal": "",
       "statusType": "auto",
       "x": 1810,
       "y": 1100,
       "wires": []
   },
   {
       "id": "d208c8c4552eed40",
       "type": "switch",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Summe < Ausschwelle ?",
       "property": "EnergieManagement.Summe < EnergieManagement.Ausschwelle ",
       "propertyType": "jsonata",
       "rules": [
           {
               "t": "true"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 1,
       "x": 1190,
       "y": 1060,
       "wires": [
           [
               "b4802b321ce23e92"
           ]
       ]
   },
   {
       "id": "b4802b321ce23e92",
       "type": "change",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Relais 1 ausschalten",
       "rules": [
           {
               "t": "set",
               "p": "payload",
               "pt": "msg",
               "to": "{\"relay\":0,\"on\":false}",
               "tot": "json"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 1440,
       "y": 1060,
       "wires": [
           [
               "ad8d7bae4667baf5"
           ]
       ]
   },
   {
       "id": "cfef92ce1099aabc",
       "type": "switch",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Status Relais 2",
       "property": "payload.relays[1].ison",
       "propertyType": "msg",
       "rules": [
           {
               "t": "false"
           },
           {
               "t": "true"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 2,
       "x": 940,
       "y": 1080,
       "wires": [
           [
               "d208c8c4552eed40"
           ],
           [
               "68dcc9282e6f1562"
           ]
       ]
   },
   {
       "id": "68dcc9282e6f1562",
       "type": "switch",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Summe < Ausschwelle ?",
       "property": "EnergieManagement.Summe < EnergieManagement.Ausschwelle ",
       "propertyType": "jsonata",
       "rules": [
           {
               "t": "true"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 1,
       "x": 1190,
       "y": 1100,
       "wires": [
           [
               "4352e22b6fb056a1"
           ]
       ]
   },
   {
       "id": "4352e22b6fb056a1",
       "type": "change",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "Relais 2 ausschalten",
       "rules": [
           {
               "t": "set",
               "p": "payload",
               "pt": "msg",
               "to": "{\"relay\":1,\"on\":false}",
               "tot": "json"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 1440,
       "y": 1100,
       "wires": [
           [
               "1066884b98e7ebf3"
           ]
       ]
   },
   {
       "id": "1f6db3ae891ae6f9",
       "type": "change",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "setze LED1",
       "rules": [
           {
               "t": "set",
               "p": "payload",
               "pt": "msg",
               "to": "payload.relays[0].ison",
               "tot": "msg"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 330,
       "y": 1100,
       "wires": [
           [
               "08ed4a797b81c710"
           ]
       ]
   },
   {
       "id": "4ade18cbedf1f800",
       "type": "debug",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "ShellyInput",
       "active": true,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "true",
       "targetType": "full",
       "statusVal": "",
       "statusType": "auto",
       "x": 350,
       "y": 960,
       "wires": []
   },
   {
       "id": "e19cacdcf99fdc0f",
       "type": "change",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "setze LED2",
       "rules": [
           {
               "t": "set",
               "p": "payload",
               "pt": "msg",
               "to": "payload.relays[0].ison",
               "tot": "msg"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 330,
       "y": 1140,
       "wires": [
           [
               "0fce39dffa24add3"
           ]
       ]
   },
   {
       "id": "08ed4a797b81c710",
       "type": "debug",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "LED1",
       "active": true,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "payload",
       "targetType": "msg",
       "statusVal": "",
       "statusType": "auto",
       "x": 490,
       "y": 1100,
       "wires": []
   },
   {
       "id": "0fce39dffa24add3",
       "type": "debug",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "name": "LED2",
       "active": true,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "payload",
       "targetType": "msg",
       "statusVal": "",
       "statusType": "auto",
       "x": 490,
       "y": 1140,
       "wires": []
   },
   {
       "id": "1066884b98e7ebf3",
       "type": "junction",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "x": 1660,
       "y": 1040,
       "wires": [
           [
               "1d495447e96a3a24"
           ]
       ]
   },
   {
       "id": "ad8d7bae4667baf5",
       "type": "junction",
       "z": "a3ff42d9e3f31af7",
       "g": "63c4ad536edd32b7",
       "x": 1600,
       "y": 1040,
       "wires": [
           [
               "0a64877c69c15599"
           ]
       ]
   }
]