@geschild
also der deaktivierte Bereich funktioniert nicht korrekt.
Es soll bei Motion Bewegung das Licht mit 1002 eingeschaltet werden für 5 min.
wenn erneute bewegung soll das licht an bleiben. bis zB 1 min. keine Bewegung mehr vorhanden ist.
Wenn der Roborock staubsauger nicht beim laden ist also zustand nicht 8 dann soll das Licht per Motion funktionieren wenn er unterwegs ist, und der status ein anderer ist soll der motion sensor nicht reagieren.
wenn Schalter betätigt wird, soll das Licht nach 45 min ausgeschaltet werden.
Das ganz muss per 1002 ein bzw ausgeschaltet werden.
Für die Hue Geräte braucht man Hue Magic
node-red-contrib-huemagic-fork
Spoiler
[
    {
        "id": "fca95f262626d456",
        "type": "tab",
        "label": "Bad",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "f7911bc401eced22",
        "type": "junction",
        "z": "fca95f262626d456",
        "x": 1040,
        "y": 640,
        "wires": [
            [
                "9535dd91050e1de7",
                "984bc6a2c3a86e29",
                "8bb042655784af36"
            ]
        ]
    },
    {
        "id": "f4b203f76105caf6",
        "type": "junction",
        "z": "fca95f262626d456",
        "d": true,
        "x": 400,
        "y": 360,
        "wires": [
            [
                "af4218c06a9d43ec"
            ]
        ]
    },
    {
        "id": "af4218c06a9d43ec",
        "type": "junction",
        "z": "fca95f262626d456",
        "d": true,
        "x": 580,
        "y": 360,
        "wires": [
            [
                "0b3b39dabb245112",
                "daa89a680fdd1262"
            ]
        ]
    },
    {
        "id": "da484e86cb75f0e5",
        "type": "junction",
        "z": "fca95f262626d456",
        "d": true,
        "x": 980,
        "y": 180,
        "wires": [
            [
                "ac1ffe5b3a83ecd3"
            ]
        ]
    },
    {
        "id": "ac1ffe5b3a83ecd3",
        "type": "junction",
        "z": "fca95f262626d456",
        "d": true,
        "x": 1020,
        "y": 260,
        "wires": [
            [
                "36b938943d09ebb8",
                "f5092a35d07b4474"
            ]
        ]
    },
    {
        "id": "27f9ed12f7a45e84",
        "type": "junction",
        "z": "fca95f262626d456",
        "d": true,
        "x": 660,
        "y": 180,
        "wires": [
            [
                "b1aada2fac907d73"
            ]
        ]
    },
    {
        "id": "4b8f1c9564a38605",
        "type": "junction",
        "z": "fca95f262626d456",
        "d": true,
        "x": 1000,
        "y": 320,
        "wires": [
            [
                "ac1ffe5b3a83ecd3"
            ]
        ]
    },
    {
        "id": "7bc2b7578ffbabe3",
        "type": "ioBroker get",
        "z": "fca95f262626d456",
        "name": "VSwitch 2",
        "topic": "0_userdata.0.GordonX-Home.0.Bad.Virtueller_Schalter_2",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 820,
        "y": 580,
        "wires": [
            [
                "f9916b7b609a4872"
            ]
        ]
    },
    {
        "id": "f9916b7b609a4872",
        "type": "change",
        "z": "fca95f262626d456",
        "name": "toggle",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$not(payload)\t",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 960,
        "y": 580,
        "wires": [
            [
                "19db4b5cf607df63"
            ]
        ]
    },
    {
        "id": "19db4b5cf607df63",
        "type": "ioBroker out",
        "z": "fca95f262626d456",
        "name": "VSwitch 2",
        "topic": "0_userdata.0.GordonX-Home.0.Bad.Virtueller_Schalter_2",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1160,
        "y": 580,
        "wires": []
    },
    {
        "id": "ba3d7ecc609d611a",
        "type": "ioBroker get",
        "z": "fca95f262626d456",
        "name": "VSwitch 3",
        "topic": "0_userdata.0.GordonX-Home.0.Bad.Virtueller_Schalter_3",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 820,
        "y": 640,
        "wires": [
            [
                "b785f33bd5389843"
            ]
        ]
    },
    {
        "id": "b785f33bd5389843",
        "type": "change",
        "z": "fca95f262626d456",
        "name": "toggle",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$not(payload)\t",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 970,
        "y": 640,
        "wires": [
            [
                "ee55387f0a29bec4",
                "f7911bc401eced22"
            ]
        ]
    },
    {
        "id": "ee55387f0a29bec4",
        "type": "ioBroker out",
        "z": "fca95f262626d456",
        "name": "VSwitch 3",
        "topic": "0_userdata.0.GordonX-Home.0.Bad.Virtueller_Schalter_3",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1160,
        "y": 820,
        "wires": []
    },
    {
        "id": "ae91ecd3729d1f8b",
        "type": "ioBroker get",
        "z": "fca95f262626d456",
        "name": "VSwitch 4",
        "topic": "0_userdata.0.GordonX-Home.0.Bad.Virtueller_Schalter_4",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 820,
        "y": 700,
        "wires": [
            [
                "556103d4e4e7fa4a"
            ]
        ]
    },
    {
        "id": "556103d4e4e7fa4a",
        "type": "change",
        "z": "fca95f262626d456",
        "name": "toggle",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$not(payload)\t",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 970,
        "y": 700,
        "wires": [
            [
                "3b2803663d8b4023"
            ]
        ]
    },
    {
        "id": "3b2803663d8b4023",
        "type": "ioBroker out",
        "z": "fca95f262626d456",
        "name": "VSwitch 4",
        "topic": "0_userdata.0.GordonX-Home.0.Bad.Virtueller_Schalter_4",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1160,
        "y": 880,
        "wires": []
    },
    {
        "id": "c577d279cf9947a6",
        "type": "ioBroker get",
        "z": "fca95f262626d456",
        "name": "VSwitch 1",
        "topic": "0_userdata.0.GordonX-Home.0.Bad.Virtueller_Schalter_1",
        "attrname": "payload",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 840,
        "y": 460,
        "wires": [
            [
                "38514d6d7f2e9871"
            ]
        ]
    },
    {
        "id": "38514d6d7f2e9871",
        "type": "change",
        "z": "fca95f262626d456",
        "name": "toggle",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$not(payload)\t",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 970,
        "y": 460,
        "wires": [
            [
                "f5092a35d07b4474",
                "36b938943d09ebb8"
            ]
        ]
    },
    {
        "id": "f5092a35d07b4474",
        "type": "ioBroker out",
        "z": "fca95f262626d456",
        "name": "VSwitch 1",
        "topic": "0_userdata.0.GordonX-Home.0.Bad.Virtueller_Schalter_1",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1160,
        "y": 520,
        "wires": []
    },
    {
        "id": "36b938943d09ebb8",
        "type": "ioBroker out",
        "z": "fca95f262626d456",
        "name": "Bad Schalter",
        "topic": "tuya.0.bf523b506862d1d720fboe.2",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1170,
        "y": 460,
        "wires": []
    },
    {
        "id": "a4db0bbf8fc4180d",
        "type": "switch",
        "z": "fca95f262626d456",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "1002",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "2002",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "3002",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "4002",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 4,
        "x": 630,
        "y": 600,
        "wires": [
            [
                "c577d279cf9947a6"
            ],
            [
                "7bc2b7578ffbabe3"
            ],
            [
                "ba3d7ecc609d611a"
            ],
            [
                "ae91ecd3729d1f8b"
            ]
        ]
    },
    {
        "id": "984bc6a2c3a86e29",
        "type": "hue-light",
        "z": "fca95f262626d456",
        "name": "Wohnzimmer 1",
        "bridge": "cbd54dbabf6f65be",
        "lightid": "8e4238e6-eb02-4110-b2df-b598f509696d",
        "colornamer": true,
        "skipevents": false,
        "initevents": false,
        "x": 1200,
        "y": 700,
        "wires": [
            []
        ]
    },
    {
        "id": "8bb042655784af36",
        "type": "hue-light",
        "z": "fca95f262626d456",
        "name": "Wohnzimmer 2",
        "bridge": "cbd54dbabf6f65be",
        "lightid": "94745f7d-34a3-4438-a272-6c17a19028a6",
        "colornamer": true,
        "skipevents": false,
        "initevents": false,
        "x": 1200,
        "y": 640,
        "wires": [
            []
        ]
    },
    {
        "id": "9535dd91050e1de7",
        "type": "hue-light",
        "z": "fca95f262626d456",
        "name": "Wohnzimmer 3",
        "bridge": "cbd54dbabf6f65be",
        "lightid": "2be455c4-b24d-4fc6-b3e0-9b86f78e7b83",
        "colornamer": true,
        "skipevents": false,
        "initevents": false,
        "x": 1200,
        "y": 760,
        "wires": [
            []
        ]
    },
    {
        "id": "f90ac36919e30901",
        "type": "ioBroker in",
        "z": "fca95f262626d456",
        "name": "Bad Schalter",
        "attrname": "payload",
        "topic": "hue.0.Bad_Schalter.buttonevent",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "outFormat": "MQTT",
        "x": 150,
        "y": 600,
        "wires": [
            [
                "a4db0bbf8fc4180d",
                "45b8e889d3e1dd5c",
                "5591058f02dc158a"
            ]
        ]
    },
    {
        "id": "42ae788f45e11c84",
        "type": "ioBroker get",
        "z": "fca95f262626d456",
        "d": true,
        "name": "Robi Status",
        "topic": "roborock.0.Devices.7Fc43lXlk5X7fmVJtBkqnZ.deviceStatus.state",
        "attrname": "roborock",
        "payloadType": "value",
        "errOnInvalidState": "nothing",
        "x": 730,
        "y": 100,
        "wires": [
            [
                "70758c48309cd0c0"
            ]
        ]
    },
    {
        "id": "cbaf04caa3815a5a",
        "type": "switch",
        "z": "fca95f262626d456",
        "d": true,
        "name": "Bewegung",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 550,
        "y": 120,
        "wires": [
            [
                "42ae788f45e11c84",
                "27f9ed12f7a45e84"
            ],
            [
                "27f9ed12f7a45e84"
            ]
        ]
    },
    {
        "id": "70758c48309cd0c0",
        "type": "switch",
        "z": "fca95f262626d456",
        "d": true,
        "name": "Robi nicht 8",
        "property": "roborock",
        "propertyType": "msg",
        "rules": [
            {
                "t": "neq",
                "v": "8",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 890,
        "y": 100,
        "wires": [
            [
                "da484e86cb75f0e5"
            ]
        ]
    },
    {
        "id": "b1aada2fac907d73",
        "type": "trigger",
        "z": "fca95f262626d456",
        "d": true,
        "name": "",
        "op1": "",
        "op2": "false",
        "op1type": "nul",
        "op2type": "bool",
        "duration": "5",
        "extend": true,
        "overrideDelay": false,
        "units": "min",
        "reset": "true",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 750,
        "y": 180,
        "wires": [
            [
                "da484e86cb75f0e5"
            ]
        ]
    },
    {
        "id": "fe2313f85edf2ae0",
        "type": "switch",
        "z": "fca95f262626d456",
        "d": true,
        "name": "",
        "property": "Schalter.Küche",
        "propertyType": "flow",
        "rules": [
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 410,
        "y": 120,
        "wires": [
            [
                "cbaf04caa3815a5a"
            ]
        ]
    },
    {
        "id": "45b8e889d3e1dd5c",
        "type": "change",
        "z": "fca95f262626d456",
        "d": true,
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "reset",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 530,
        "y": 180,
        "wires": [
            [
                "27f9ed12f7a45e84"
            ]
        ]
    },
    {
        "id": "c511e779aae7fd1b",
        "type": "change",
        "z": "fca95f262626d456",
        "d": true,
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "reset",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 500,
        "y": 240,
        "wires": [
            [
                "27f9ed12f7a45e84"
            ]
        ]
    },
    {
        "id": "5591058f02dc158a",
        "type": "switch",
        "z": "fca95f262626d456",
        "d": true,
        "name": "true/false?",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 270,
        "y": 280,
        "wires": [
            [
                "a79c461971cfdc1d",
                "c511e779aae7fd1b"
            ],
            [
                "f4b203f76105caf6"
            ]
        ]
    },
    {
        "id": "a79c461971cfdc1d",
        "type": "change",
        "z": "fca95f262626d456",
        "d": true,
        "name": "Setze Schalter",
        "rules": [
            {
                "t": "set",
                "p": "Schalter.Küche",
                "pt": "flow",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 500,
        "y": 300,
        "wires": [
            [
                "0b3b39dabb245112"
            ]
        ]
    },
    {
        "id": "0b3b39dabb245112",
        "type": "trigger",
        "z": "fca95f262626d456",
        "d": true,
        "name": "",
        "op1": "true",
        "op2": "false",
        "op1type": "bool",
        "op2type": "bool",
        "duration": "45",
        "extend": false,
        "overrideDelay": false,
        "units": "min",
        "reset": "false",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 2,
        "x": 700,
        "y": 300,
        "wires": [
            [
                "4b8f1c9564a38605"
            ],
            [
                "daa89a680fdd1262"
            ]
        ]
    },
    {
        "id": "daa89a680fdd1262",
        "type": "change",
        "z": "fca95f262626d456",
        "d": true,
        "name": "setze Schalter",
        "rules": [
            {
                "t": "set",
                "p": "Schalter.Küche",
                "pt": "flow",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 360,
        "wires": [
            [
                "4b8f1c9564a38605"
            ]
        ]
    },
    {
        "id": "95941cd9420e5c7a",
        "type": "ioBroker in",
        "z": "fca95f262626d456",
        "d": true,
        "name": "Bad Motion",
        "attrname": "payload",
        "topic": "hue.0.Bad_Motion_Sensor.presence",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "outFormat": "MQTT",
        "x": 250,
        "y": 120,
        "wires": [
            [
                "fe2313f85edf2ae0",
                "a79c461971cfdc1d"
            ]
        ]
    },
    {
        "id": "a9cd56527a3c5be4",
        "type": "inject",
        "z": "fca95f262626d456",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 690,
        "y": 460,
        "wires": [
            [
                "c577d279cf9947a6"
            ]
        ]
    },
    {
        "id": "8e73437e6157e567",
        "type": "amazon-echo-device",
        "z": "fca95f262626d456",
        "name": "Bad Schalter",
        "topic": "hue.0.Bad_Schalter.buttonevent",
        "x": 330,
        "y": 640,
        "wires": [
            [
                "12c59aacfe566fbf"
            ]
        ]
    },
    {
        "id": "12c59aacfe566fbf",
        "type": "change",
        "z": "fca95f262626d456",
        "name": "wechsel",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "on",
                "fromt": "str",
                "to": "1002",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "off",
                "fromt": "str",
                "to": "1002",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 480,
        "y": 640,
        "wires": [
            [
                "a4db0bbf8fc4180d"
            ]
        ]
    },
    {
        "id": "94ecf2c94996cd35",
        "type": "link in",
        "z": "fca95f262626d456",
        "name": "link in 5",
        "links": [
            "0ca586f6fc46857e"
        ],
        "x": 215,
        "y": 640,
        "wires": [
            [
                "8e73437e6157e567"
            ]
        ]
    },
    {
        "id": "6e9f5ac6b1f6c91e",
        "type": "inject",
        "z": "fca95f262626d456",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1002",
        "payloadType": "str",
        "x": 490,
        "y": 560,
        "wires": [
            [
                "a4db0bbf8fc4180d"
            ]
        ]
    },
    {
        "id": "cbd54dbabf6f65be",
        "type": "hue-bridge",
        "name": "Hue GordonX",
        "bridge": "192.168.0.8",
        "key": "SlfyXwpcaEvRN0d1DU2JrrOlwrm9Debhhm9A4E-d",
        "worker": "10",
        "autoupdates": true,
        "disableupdates": false
    }
]
Screenshot 2025-03-12 194728.png