[
    {
        "id": "ac23c128.6e23c8",
        "type": "switch",
        "z": "f5448114.a19e18",
        "name": "",
        "property": "shellyip",
        "propertyType": "msg",
        "rules": [
            {
                "t": "nnull"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 130,
        "y": 240,
        "wires": [
            [
                "1c17f5c1.44deda"
            ],
            [
                "fc2b4b7a.bb841"
            ]
        ]
    },
    {
        "id": "bc815643.5e953",
        "type": "http request",
        "z": "f5448114.a19e18",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 810,
        "y": 140,
        "wires": [
            [
                "56709080.90607"
            ]
        ]
    },
    {
        "id": "72a0d60c.632b68",
        "type": "function",
        "z": "f5448114.a19e18",
        "name": "Werte Befehle aus",
        "func": "msg.url=\"http://BENUTZERNAME:PASSWORT@192.168.2.\"+msg.shellyip+\"/roller/0\";\n\nif(msg.payload==\"open\" || msg.payload==\"close\" || msg.payload==\"stop\") {\n    msg.url = msg.url+\"?go=\"+msg.payload;\n\n}\nelse {\n    msg.debugpayload = msg.payload;\n    msg.payload = parseFloat(msg.payload);\n    if(msg.payload>=0 && msg.payload <=100) {\n        var weg = Math.abs(parseFloat(msg.rollostand)-msg.payload);\n        if(weg > 9) {\n            msg.url = msg.url+\"?go=to_pos&roller_pos=\"+msg.payload;\n      \n        }\n    }\n    \n}\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 630,
        "y": 140,
        "wires": [
            [
                "bc815643.5e953"
            ]
        ]
    },
    {
        "id": "95b59945.42c36",
        "type": "json",
        "z": "f5448114.a19e18",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 1030,
        "y": 120,
        "wires": [
            [
                "c4f15f80.33e37"
            ]
        ]
    },
    {
        "id": "56709080.90607",
        "type": "switch",
        "z": "f5448114.a19e18",
        "name": "",
        "property": "statusCode",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "200",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 915,
        "y": 140,
        "wires": [
            [
                "95b59945.42c36"
            ],
            [
                "fc2b4b7a.bb841"
            ]
        ],
        "l": false
    },
    {
        "id": "c4f15f80.33e37",
        "type": "change",
        "z": "f5448114.a19e18",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "shellyfeedback",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "shellyfeedback.current_pos",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1190,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "71cc7df7.58ebbc",
        "type": "change",
        "z": "f5448114.a19e18",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "Arbeite ...",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 210,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "fc2b4b7a.bb841",
        "type": "change",
        "z": "f5448114.a19e18",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "Error",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1070,
        "y": 220,
        "wires": [
            []
        ]
    },
    {
        "id": "df669144.4f8be",
        "type": "catch",
        "z": "f5448114.a19e18",
        "name": "",
        "scope": [
            "bc815643.5e953",
            "95b59945.42c36"
        ],
        "uncaught": false,
        "x": 850,
        "y": 260,
        "wires": [
            [
                "fc2b4b7a.bb841"
            ]
        ]
    },
    {
        "id": "1c17f5c1.44deda",
        "type": "function",
        "z": "f5448114.a19e18",
        "name": "Variablenzuordnung ip zu iobroker var",
        "func": "msg.shellyip2 = parseFloat(msg.shellyip);\nswitch (msg.shellyip2) {\n    case 1:\n        msg.iobrokerpoint = \"shelly1\";\n        break;\n    case 2:\n        msg.iobrokerpoint = \"shelly2\";\n        break;\n    case 3:\n        msg.iobrokerpoint = \"shelly3\";\n        break;\n    case 4:\n        msg.iobrokerpoint = \"shelly4\";\n        break;\n    case 5:\n        msg.iobrokerpoint = \"shelly5\";\n        break;\n    case 6:\n        msg.iobrokerpoint = \"shelly6\";\n        break;\n    case 7:\n        msg.iobrokerpoint = \"shelly7\";\n        break;\n    case 8:\n        msg.iobrokerpoint = \"shelly8\";\n        break;\n    default:\n        var nobod=true;\n        break;\n}\n\nif(nobod === true) {\n    return [null,msg];\n}\nelse {\n    msg.topic = \"jac.0.Rollos.\"+msg.iobrokerpoint;\n    return [msg,null];\n}",
        "outputs": 2,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 350,
        "y": 200,
        "wires": [
            [
                "12e32620.3d3a52"
            ],
            [
                "fc2b4b7a.bb841"
            ]
        ]
    },
    {
        "id": "12e32620.3d3a52",
        "type": "ioBroker get",
        "z": "f5448114.a19e18",
        "name": "Lade aktuellen Stand",
        "topic": "",
        "attrname": "rollostand",
        "payloadType": "value",
        "x": 420,
        "y": 140,
        "wires": [
            [
                "72a0d60c.632b68"
            ]
        ]
    }
]