[
    {
        "id": "57f47df45469191a",
        "type": "tab",
        "label": "Wasertank Kaffe Neu",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "6b79e98a03c7d558",
        "type": "junction",
        "z": "57f47df45469191a",
        "x": 1030,
        "y": 740,
        "wires": [
            [
                "2abe9b4e2b8bd59f",
                "1c8289437f02d28d"
            ]
        ]
    },
    {
        "id": "60f2c9666867f1f5",
        "type": "junction",
        "z": "57f47df45469191a",
        "x": 1030,
        "y": 840,
        "wires": [
            [
                "34cdcca2b8430dbe",
                "513f1580376329e8"
            ]
        ]
    },
    {
        "id": "255ab1c8683bf5c0",
        "type": "junction",
        "z": "57f47df45469191a",
        "x": 1470,
        "y": 350,
        "wires": [
            [
                "cbbafc18c7a28016"
            ]
        ]
    },
    {
        "id": "13649107c9018426",
        "type": "ioBroker get",
        "z": "57f47df45469191a",
        "name": "jahr",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Jahr",
        "attrname": "jahr",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 830,
        "y": 200,
        "wires": [
            [
                "e9153c66d116c53b"
            ]
        ]
    },
    {
        "id": "e9153c66d116c53b",
        "type": "ioBroker get",
        "z": "57f47df45469191a",
        "name": "gesamt",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Gesamt",
        "attrname": "gesamt",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 960,
        "y": 200,
        "wires": [
            [
                "ca70e8a2d1e42876"
            ]
        ]
    },
    {
        "id": "cbbafc18c7a28016",
        "type": "debug",
        "z": "57f47df45469191a",
        "name": "Ausgabe Objekt",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1560,
        "y": 350,
        "wires": []
    },
    {
        "id": "44b5924ef3efb629",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "durchfluss",
                "pt": "msg",
                "to": "$round(durchfluss / 2.207,2)",
                "tot": "jsonata"
            },
            {
                "t": "set",
                "p": "jahr",
                "pt": "msg",
                "to": "$round(durchfluss  / 1000 + jahr,2)",
                "tot": "jsonata"
            },
            {
                "t": "set",
                "p": "gesamt",
                "pt": "msg",
                "to": "$round(durchfluss  / 1000 + gesamt,2)",
                "tot": "jsonata"
            },
            {
                "t": "set",
                "p": "tag",
                "pt": "msg",
                "to": "$round(durchfluss  + tag,2)",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1310,
        "y": 200,
        "wires": [
            [
                "3cadfd8c1dbfa20b",
                "5e2dc84502fe15bc",
                "9dd3ce02d730f224",
                "f789b44727c86701",
                "255ab1c8683bf5c0"
            ]
        ]
    },
    {
        "id": "65e798b0af11b036",
        "type": "ioBroker get",
        "z": "57f47df45469191a",
        "name": "durchfluss",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Durchfluss",
        "attrname": "durchfluss",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 550,
        "y": 200,
        "wires": [
            [
                "7fe41aeac2afc960"
            ]
        ]
    },
    {
        "id": "2f31af30b00a2e0d",
        "type": "ioBroker out",
        "z": "57f47df45469191a",
        "name": "durchfluss",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Durchfluss",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1740,
        "y": 140,
        "wires": []
    },
    {
        "id": "1e60f0c6483fb618",
        "type": "ioBroker out",
        "z": "57f47df45469191a",
        "name": "tag",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Tag",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1720,
        "y": 190,
        "wires": []
    },
    {
        "id": "b3ba72380c43f293",
        "type": "ioBroker out",
        "z": "57f47df45469191a",
        "name": "jahr",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Jahr",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1720,
        "y": 240,
        "wires": []
    },
    {
        "id": "12a33a4a325f5704",
        "type": "ioBroker out",
        "z": "57f47df45469191a",
        "name": "gesamt",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Gesamt",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1720,
        "y": 300,
        "wires": []
    },
    {
        "id": "7fe41aeac2afc960",
        "type": "ioBroker get",
        "z": "57f47df45469191a",
        "name": "tag",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Tag",
        "attrname": "tag",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 710,
        "y": 200,
        "wires": [
            [
                "13649107c9018426"
            ]
        ]
    },
    {
        "id": "5e2dc84502fe15bc",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "durchfluss",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1560,
        "y": 140,
        "wires": [
            [
                "2f31af30b00a2e0d"
            ]
        ]
    },
    {
        "id": "9dd3ce02d730f224",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "tag",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1560,
        "y": 190,
        "wires": [
            [
                "1e60f0c6483fb618"
            ]
        ]
    },
    {
        "id": "f789b44727c86701",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "jahr",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1560,
        "y": 240,
        "wires": [
            [
                "b3ba72380c43f293"
            ]
        ]
    },
    {
        "id": "3cadfd8c1dbfa20b",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "gesamt",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1550,
        "y": 300,
        "wires": [
            [
                "12a33a4a325f5704"
            ]
        ]
    },
    {
        "id": "f6b34918e00ee539",
        "type": "ioBroker out",
        "z": "57f47df45469191a",
        "name": "Magnetventil",
        "topic": "sonoff.0.GordonX-Home-Kaffeemaschine.POWER2",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1210,
        "y": 480,
        "wires": []
    },
    {
        "id": "a7aee810793358d4",
        "type": "ioBroker in",
        "z": "57f47df45469191a",
        "name": "Schwimmer",
        "attrname": "payload",
        "topic": "sonoff.0.GordonX-Home-Kaffeemaschine.POWER1",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "outFormat": "MQTT",
        "x": 110,
        "y": 520,
        "wires": [
            [
                "f60ac0ca806c32a9",
                "bd9e4c4480c0d54e"
            ]
        ]
    },
    {
        "id": "1c8289437f02d28d",
        "type": "debug",
        "z": "57f47df45469191a",
        "name": "Tag Reset",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1120,
        "y": 720,
        "wires": []
    },
    {
        "id": "2abe9b4e2b8bd59f",
        "type": "ioBroker out",
        "z": "57f47df45469191a",
        "name": "tag",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Tag",
        "ack": "true",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1110,
        "y": 760,
        "wires": []
    },
    {
        "id": "204ce8ed94afc854",
        "type": "http request",
        "z": "57f47df45469191a",
        "name": "Senden",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "http://192.168.0.96/cm?user=user&password=password&cmnd=counter1%200",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 1130,
        "y": 120,
        "wires": [
            [
                "fc91906f018dd65d"
            ]
        ]
    },
    {
        "id": "df44712c5b90825f",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "Aqua Counter Reset",
        "rules": [
            {
                "t": "set",
                "p": "url",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 800,
        "y": 120,
        "wires": [
            [
                "e47538d2c25a955b"
            ]
        ]
    },
    {
        "id": "fc91906f018dd65d",
        "type": "debug",
        "z": "57f47df45469191a",
        "name": "Ausgabe Reset",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1290,
        "y": 120,
        "wires": []
    },
    {
        "id": "c2a42c63f9bd1067",
        "type": "delay",
        "z": "57f47df45469191a",
        "name": "Verzögerung",
        "pauseType": "delay",
        "timeout": "1",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 540,
        "y": 120,
        "wires": [
            [
                "df44712c5b90825f"
            ]
        ]
    },
    {
        "id": "513f1580376329e8",
        "type": "debug",
        "z": "57f47df45469191a",
        "name": "Jahr Reset",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1130,
        "y": 820,
        "wires": []
    },
    {
        "id": "34cdcca2b8430dbe",
        "type": "ioBroker out",
        "z": "57f47df45469191a",
        "name": "Jahr",
        "topic": "0_userdata.0.Kaffeemaschine.Wasser_Jahr",
        "ack": "true",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1110,
        "y": 860,
        "wires": []
    },
    {
        "id": "9eb9d437d9e6e723",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "Tag Reset",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 540,
        "y": 740,
        "wires": [
            [
                "6b79e98a03c7d558"
            ]
        ]
    },
    {
        "id": "40f2e95147eee6e4",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "Jahr Reset",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 550,
        "y": 840,
        "wires": [
            [
                "60f2c9666867f1f5"
            ]
        ]
    },
    {
        "id": "4bc79cd25cf2de2c",
        "type": "inject",
        "z": "57f47df45469191a",
        "name": "Counter Reset Manuell",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 320,
        "y": 120,
        "wires": [
            [
                "c2a42c63f9bd1067"
            ]
        ]
    },
    {
        "id": "ca70e8a2d1e42876",
        "type": "delay",
        "z": "57f47df45469191a",
        "name": "warten",
        "pauseType": "delay",
        "timeout": "30",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 1110,
        "y": 200,
        "wires": [
            [
                "44b5924ef3efb629"
            ]
        ]
    },
    {
        "id": "e47538d2c25a955b",
        "type": "delay",
        "z": "57f47df45469191a",
        "name": "warten",
        "pauseType": "delay",
        "timeout": "70",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 980,
        "y": 120,
        "wires": [
            [
                "204ce8ed94afc854"
            ]
        ]
    },
    {
        "id": "42e9bb25fbc436e5",
        "type": "cronplus",
        "z": "57f47df45469191a",
        "name": "Aqua Tag Reset",
        "outputField": "payload",
        "timeZone": "",
        "storeName": "",
        "commandResponseMsgOutput": "output1",
        "defaultLocation": "",
        "defaultLocationType": "default",
        "outputs": 1,
        "options": [
            {
                "name": "Zeitplan",
                "topic": "Counter Aqua Reset",
                "payloadType": "default",
                "payload": "",
                "expressionType": "cron",
                "expression": "0 0 0 * * ? *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            }
        ],
        "x": 340,
        "y": 740,
        "wires": [
            [
                "9eb9d437d9e6e723"
            ]
        ]
    },
    {
        "id": "16bbc7cef0219d28",
        "type": "cronplus",
        "z": "57f47df45469191a",
        "name": "Aqua Jahr Reset",
        "outputField": "payload",
        "timeZone": "",
        "storeName": "",
        "commandResponseMsgOutput": "output1",
        "defaultLocation": "",
        "defaultLocationType": "default",
        "outputs": 1,
        "options": [
            {
                "name": "Zeitplan",
                "topic": "Counter Aqua Reset",
                "payloadType": "default",
                "payload": "",
                "expressionType": "cron",
                "expression": "0 0 0 31 12 ? *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            }
        ],
        "x": 350,
        "y": 840,
        "wires": [
            [
                "40f2e95147eee6e4"
            ]
        ]
    },
    {
        "id": "9ea6bd731fca5dc3",
        "type": "trigger",
        "z": "57f47df45469191a",
        "name": "Triggger nach 2sek stabil true",
        "op1": "",
        "op2": "true",
        "op1type": "nul",
        "op2type": "bool",
        "duration": "2000",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 2,
        "x": 690,
        "y": 500,
        "wires": [
            [],
            [
                "88bc1672bac70da9",
                "f6b34918e00ee539"
            ]
        ]
    },
    {
        "id": "88bc1672bac70da9",
        "type": "debug",
        "z": "57f47df45469191a",
        "name": "Magnetschalter ein",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1230,
        "y": 440,
        "wires": []
    },
    {
        "id": "f60ac0ca806c32a9",
        "type": "function",
        "z": "57f47df45469191a",
        "name": "true->Start - false->Reset Trigger",
        "func": "let news = msg.payload;\n\nif(news == true){\n    msg.payload = true;\n    return msg;\n}\nif(news == false){\n    msg.reset = true;\n    return msg;\n}\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 380,
        "y": 500,
        "wires": [
            [
                "9ea6bd731fca5dc3"
            ]
        ]
    },
    {
        "id": "5f9ad613d80393e6",
        "type": "trigger",
        "z": "57f47df45469191a",
        "name": "Trigger nach 2sek stabli false",
        "op1": "",
        "op2": "true",
        "op1type": "nul",
        "op2type": "bool",
        "duration": "2000",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 2,
        "x": 680,
        "y": 540,
        "wires": [
            [],
            [
                "120a6dd3771ba5a4",
                "46e8b52eb69c4015"
            ]
        ]
    },
    {
        "id": "b17cb1d4b5701144",
        "type": "debug",
        "z": "57f47df45469191a",
        "name": "Counter lesen",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1220,
        "y": 400,
        "wires": []
    },
    {
        "id": "bd9e4c4480c0d54e",
        "type": "function",
        "z": "57f47df45469191a",
        "name": "false->Start - true->Reset Trigger",
        "func": "let news = msg.payload;\n\nif(news == false){\n    msg.payload = true;\n    return msg;\n}\nif(news == true){\n    msg.reset = true;\n    return msg;\n}\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 380,
        "y": 540,
        "wires": [
            [
                "5f9ad613d80393e6"
            ]
        ]
    },
    {
        "id": "120a6dd3771ba5a4",
        "type": "change",
        "z": "57f47df45469191a",
        "name": "true -> false",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "true",
                "fromt": "bool",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 930,
        "y": 540,
        "wires": [
            [
                "66ebfbae27154f3d",
                "f6b34918e00ee539"
            ]
        ]
    },
    {
        "id": "66ebfbae27154f3d",
        "type": "debug",
        "z": "57f47df45469191a",
        "name": "Magnetschalter aus",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1230,
        "y": 540,
        "wires": []
    },
    {
        "id": "46e8b52eb69c4015",
        "type": "delay",
        "z": "57f47df45469191a",
        "name": "Verzögerung 1s",
        "pauseType": "delay",
        "timeout": "1",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 940,
        "y": 400,
        "wires": [
            [
                "b17cb1d4b5701144",
                "65e798b0af11b036"
            ]
        ]
    }
]