Mise à jour : depuis quelques mois, je suis passé sur Valetudo RE qui propose plus de fonctionnalités et des mises à jour plus régulières.

On va voir comment connecter votre Roborock à Domoticz sans plugin grâce à Node-RED.

Ce post ne traite pas de l'installation et la configuration de NodeRED. Vous devez donc l'avoir installé et y avoir configuré un serveur MQTT.

Activer MQTT sur votre robot

Sur le robot, en SSH, modifier le fichier /mnt/data/valetudo/config.json :

  "mqtt": {
    "enabled": true,
    "identifier": "rockrobo",
    "topicPrefix": "valetudo",
    "autoconfPrefix": "homeassistant",
    "broker_url": "mqtt://192.168.0.47",
    "provideMapData": true,
    "caPath": ""
  },

En remplaçant 192.168.0.47 par l'adresse de votre serveur MQTT.

Un reboot du robot devrait suffire.

Créer la configuration dans Domoticz

Si vous n'en avez pas déjà un, il faut avoir un matériel de type Dummy sur votre Domoticz, il vous permettra ensuite de créer des interrupteurs virtuels.

J'ai créé deux interrupteurs virtuels : un pour lancer/arrêter le nettoyage et l'autre pour choisir le mode d'aspiration.

roborock-1

roborock-2

J'ai également créé une variable Roborock de type chaîne qui prendra la valeur True / False.

Créer la configuration Node-RED

node-red-flow

Subflows

On va tout d'abord commencer par créer deux subflows :

  • Check Fan
  • Check Control

Ces deux subflows vont aller vérifier l'état de la variable Roborock créé plus haut. Si la variable est à False, c'est qu'une action vient d'être effectuée par l'utilisateur. On récupère l'état de l'interrupteur virtuel (état ou aspiration) et il sera envoyé en ordre MQTT à l'aspirateur.

La variable permet d'éviter un système de boucle qui ferait que lorsqu'une action est effectuée dans Domoticz, l'ordre soit transmis à Valetudo puis récupéré de nouveau par Domoticz, retransmis à Valetudo et ainsi de suite.

Le subflow Check Fan (il faudra modifier l'adresse de votre Domoticz, la variable et l'idx de l'interrupteur virtuel correspondant au mode d'aspiration) :

[
    {
        "id": "39915139.179ace",
        "type": "subflow",
        "name": "Check Fan",
        "info": "",
        "category": "",
        "in": [
            {
                "x": 60,
                "y": 40,
                "wires": [
                    {
                        "id": "428645e0.ee6adc"
                    }
                ]
            }
        ],
        "out": [
            {
                "x": 820,
                "y": 40,
                "wires": [
                    {
                        "id": "5bc4a8c2.278dc",
                        "port": 0
                    }
                ]
            }
        ],
        "env": []
    },
    {
        "id": "8e776008.646408",
        "type": "switch",
        "z": "39915139.179ace",
        "name": "Check VAR",
        "property": "payload.result[0].Value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "False",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 410,
        "y": 100,
        "wires": [
            [
                "5bc4a8c2.278dc"
            ]
        ]
    },
    {
        "id": "5bc4a8c2.278dc",
        "type": "http request",
        "z": "39915139.179ace",
        "name": "Check Fan Speed",
        "method": "GET",
        "ret": "obj",
        "paytoqs": false,
        "url": "http://127.0.0.1:8080/json.htm?type=devices&rid=452",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 630,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "428645e0.ee6adc",
        "type": "http request",
        "z": "39915139.179ace",
        "name": "Get VAR",
        "method": "GET",
        "ret": "obj",
        "paytoqs": false,
        "url": "http://127.0.0.1:8080/json.htm?type=command&param=getuservariable&idx=19",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 220,
        "y": 100,
        "wires": [
            [
                "8e776008.646408"
            ]
        ]
    }
]

Le subflow Check Control (il faudra modifier l'adresse de votre Domoticz, la variable et l'idx de l'interrupteur virtuel correspondant à l'état) :

[
    {
        "id": "ce34769c.6e7d28",
        "type": "subflow",
        "name": "Check Control",
        "info": "",
        "category": "",
        "in": [
            {
                "x": 100,
                "y": 40,
                "wires": [
                    {
                        "id": "a0c5660a.8f7ed8"
                    }
                ]
            }
        ],
        "out": [
            {
                "x": 820,
                "y": 40,
                "wires": [
                    {
                        "id": "d85cad03.173de8",
                        "port": 0
                    }
                ]
            }
        ],
        "env": []
    },
    {
        "id": "7a8afa2.5483804",
        "type": "switch",
        "z": "ce34769c.6e7d28",
        "name": "Check VAR",
        "property": "payload.result[0].Value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "False",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 430,
        "y": 80,
        "wires": [
            [
                "d85cad03.173de8"
            ]
        ]
    },
    {
        "id": "d85cad03.173de8",
        "type": "http request",
        "z": "ce34769c.6e7d28",
        "name": "Check State",
        "method": "GET",
        "ret": "obj",
        "paytoqs": false,
        "url": "http://127.0.0.1:8080/json.htm?type=devices&rid=451",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 610,
        "y": 80,
        "wires": [
            []
        ]
    },
    {
        "id": "a0c5660a.8f7ed8",
        "type": "http request",
        "z": "ce34769c.6e7d28",
        "name": "Get VAR",
        "method": "GET",
        "ret": "obj",
        "paytoqs": false,
        "url": "http://127.0.0.1:8080/json.htm?type=command&param=getuservariable&idx=19",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 240,
        "y": 80,
        "wires": [
            [
                "7a8afa2.5483804"
            ]
        ]
    }
]

Flow

Le flow est découpé en 3 parties :

  • La première partie qui s'occupe de récupérer les actions issues de Domoticz et les convertir en ordre MQTT pour Valetudo
  • La deuxième partie qui récupère une modification du mode d'aspiration issue directement depuis l'interface Valetudo et qui les enverra vers Domoticz pour que le statut soit à jour. La variable Roborock passera à True pendant 2 secondes, empêchant que l'ordre récupéré par Domoticz soit de nouveau envoyé à Valetudo.
  • La troisième partie qui fait globalement la même chose que la deuxième partie mais pour l'état de l'aspirateur : nettoyage, nettoyage ciblé, etc.

Les idx et les URL sont à adapter :

[
    {
        "id": "ce34769c.6e7d28",
        "type": "subflow",
        "name": "Check Control",
        "info": "",
        "category": "",
        "in": [
            {
                "x": 100,
                "y": 40,
                "wires": [
                    {
                        "id": "a0c5660a.8f7ed8"
                    }
                ]
            }
        ],
        "out": [
            {
                "x": 820,
                "y": 40,
                "wires": [
                    {
                        "id": "d85cad03.173de8",
                        "port": 0
                    }
                ]
            }
        ],
        "env": []
    },
    {
        "id": "7a8afa2.5483804",
        "type": "switch",
        "z": "ce34769c.6e7d28",
        "name": "Check VAR",
        "property": "payload.result[0].Value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "False",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 430,
        "y": 80,
        "wires": [
            [
                "d85cad03.173de8"
            ]
        ]
    },
    {
        "id": "d85cad03.173de8",
        "type": "http request",
        "z": "ce34769c.6e7d28",
        "name": "Check State",
        "method": "GET",
        "ret": "obj",
        "paytoqs": false,
        "url": "http://127.0.0.1:8080/json.htm?type=devices&rid=451",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 610,
        "y": 80,
        "wires": [
            []
        ]
    },
    {
        "id": "a0c5660a.8f7ed8",
        "type": "http request",
        "z": "ce34769c.6e7d28",
        "name": "Get VAR",
        "method": "GET",
        "ret": "obj",
        "paytoqs": false,
        "url": "http://127.0.0.1:8080/json.htm?type=command&param=getuservariable&idx=19",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 240,
        "y": 80,
        "wires": [
            [
                "7a8afa2.5483804"
            ]
        ]
    },
    {
        "id": "39915139.179ace",
        "type": "subflow",
        "name": "Check Fan",
        "info": "",
        "category": "",
        "in": [
            {
                "x": 60,
                "y": 40,
                "wires": [
                    {
                        "id": "428645e0.ee6adc"
                    }
                ]
            }
        ],
        "out": [
            {
                "x": 820,
                "y": 40,
                "wires": [
                    {
                        "id": "5bc4a8c2.278dc",
                        "port": 0
                    }
                ]
            }
        ],
        "env": []
    },
    {
        "id": "8e776008.646408",
        "type": "switch",
        "z": "39915139.179ace",
        "name": "Check VAR",
        "property": "payload.result[0].Value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "False",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 410,
        "y": 100,
        "wires": [
            [
                "5bc4a8c2.278dc"
            ]
        ]
    },
    {
        "id": "5bc4a8c2.278dc",
        "type": "http request",
        "z": "39915139.179ace",
        "name": "Check Fan Speed",
        "method": "GET",
        "ret": "obj",
        "paytoqs": false,
        "url": "http://127.0.0.1:8080/json.htm?type=devices&rid=452",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 630,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "428645e0.ee6adc",
        "type": "http request",
        "z": "39915139.179ace",
        "name": "Get VAR",
        "method": "GET",
        "ret": "obj",
        "paytoqs": false,
        "url": "http://127.0.0.1:8080/json.htm?type=command&param=getuservariable&idx=19",
        "tls": "",
        "proxy": "",
        "authType": "basic",
        "x": 220,
        "y": 100,
        "wires": [
            [
                "8e776008.646408"
            ]
        ]
    },
    {
        "id": "d6e42e12.e1e9c",
        "type": "tab",
        "label": "Robot",
        "disabled": false,
        "info": ""
    },
    {
        "id": "86e6ce22.e2785",
        "type": "switch",
        "z": "d6e42e12.e1e9c",
        "name": "Check value",
        "property": "payload.result[0].Level",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "10",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "20",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "30",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "40",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "50",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 5,
        "x": 750,
        "y": 120,
        "wires": [
            [
                "c5299115.d73a2"
            ],
            [
                "ea024188.793c"
            ],
            [
                "a4101444.3627f8"
            ],
            [
                "4f14a25d.0b1acc"
            ],
            [
                "1ec8af3.09f3a51"
            ]
        ]
    },
    {
        "id": "f335cbf.53f5f38",
        "type": "mqtt in",
        "z": "d6e42e12.e1e9c",
        "name": "Domoticz",
        "topic": "domoticz/out",
        "qos": "1",
        "datatype": "json",
        "broker": "1949a812.2568e8",
        "x": 120,
        "y": 220,
        "wires": [
            [
                "40d4db92.c146e4"
            ]
        ]
    },
    {
        "id": "40d4db92.c146e4",
        "type": "switch",
        "z": "d6e42e12.e1e9c",
        "name": "Check IDX",
        "property": "payload.idx",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "451",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "452",
                "vt": "str"
            }
        ],
        "checkall": "false",
        "repair": false,
        "outputs": 2,
        "x": 310,
        "y": 220,
        "wires": [
            [
                "36e6123.dfe85ee"
            ],
            [
                "11fa5d12.c603f3"
            ]
        ]
    },
    {
        "id": "c5299115.d73a2",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Start",
        "func": "msg.payload = 'start';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 40,
        "wires": [
            [
                "17687ff9.c2106"
            ]
        ]
    },
    {
        "id": "a4101444.3627f8",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Stop",
        "func": "msg.payload = 'stop';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 120,
        "wires": [
            [
                "17687ff9.c2106"
            ]
        ]
    },
    {
        "id": "4f14a25d.0b1acc",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Pause",
        "func": "msg.payload = 'pause';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 160,
        "wires": [
            [
                "17687ff9.c2106"
            ]
        ]
    },
    {
        "id": "17687ff9.c2106",
        "type": "mqtt out",
        "z": "d6e42e12.e1e9c",
        "name": "Roborock Control",
        "topic": "valetudo/rockrobo/command",
        "qos": "",
        "retain": "",
        "broker": "1949a812.2568e8",
        "x": 1190,
        "y": 120,
        "wires": []
    },
    {
        "id": "68cef261.fb38fc",
        "type": "switch",
        "z": "d6e42e12.e1e9c",
        "name": "Check value",
        "property": "payload.result[0].Level",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "10",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "20",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "30",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "40",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "50",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 5,
        "x": 750,
        "y": 320,
        "wires": [
            [
                "af7a47a2.0a7198"
            ],
            [
                "8f822490.de6318"
            ],
            [
                "b76beb2f.6fc498"
            ],
            [
                "c60b3dfd.ffd0f"
            ],
            [
                "c89d6b74.326cd8"
            ]
        ]
    },
    {
        "id": "af7a47a2.0a7198",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Quiet",
        "func": "msg.payload = 'min';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 240,
        "wires": [
            [
                "39b7aa6f.0a3f86"
            ]
        ]
    },
    {
        "id": "8f822490.de6318",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Balanced",
        "func": "msg.payload = 'medium';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 940,
        "y": 280,
        "wires": [
            [
                "39b7aa6f.0a3f86"
            ]
        ]
    },
    {
        "id": "b76beb2f.6fc498",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Turbo",
        "func": "msg.payload = 'high';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 320,
        "wires": [
            [
                "39b7aa6f.0a3f86"
            ]
        ]
    },
    {
        "id": "c60b3dfd.ffd0f",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Max",
        "func": "msg.payload = 'max';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 360,
        "wires": [
            [
                "39b7aa6f.0a3f86"
            ]
        ]
    },
    {
        "id": "c89d6b74.326cd8",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Mop",
        "func": "msg.payload = 'mop';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 400,
        "wires": [
            [
                "39b7aa6f.0a3f86"
            ]
        ]
    },
    {
        "id": "39b7aa6f.0a3f86",
        "type": "mqtt out",
        "z": "d6e42e12.e1e9c",
        "name": "Roborock Fan",
        "topic": "valetudo/rockrobo/set_fan_speed",
        "qos": "",
        "retain": "",
        "broker": "1949a812.2568e8",
        "x": 1180,
        "y": 320,
        "wires": []
    },
    {
        "id": "197f93d1.90d50c",
        "type": "mqtt in",
        "z": "d6e42e12.e1e9c",
        "name": "Roborock",
        "topic": "valetudo/rockrobo/state",
        "qos": "2",
        "datatype": "json",
        "broker": "1949a812.2568e8",
        "x": 120,
        "y": 580,
        "wires": [
            [
                "806e7d41.cc3ab"
            ]
        ]
    },
    {
        "id": "806e7d41.cc3ab",
        "type": "switch",
        "z": "d6e42e12.e1e9c",
        "name": "Check Fan Speed",
        "property": "payload.fan_speed",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "min",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "medium",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "high",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "max",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "mop",
                "vt": "str"
            }
        ],
        "checkall": "false",
        "repair": false,
        "outputs": 5,
        "x": 350,
        "y": 580,
        "wires": [
            [
                "f5aef3e.8db451",
                "2e10dbd9.4ecf14",
                "96bec378.87dd1"
            ],
            [
                "ef1d07e3.8c5828",
                "2e10dbd9.4ecf14",
                "96bec378.87dd1"
            ],
            [
                "bf5734be.6201b8",
                "2e10dbd9.4ecf14",
                "96bec378.87dd1"
            ],
            [
                "321abec5.6f3062",
                "2e10dbd9.4ecf14",
                "96bec378.87dd1"
            ],
            [
                "e09aa6db.ce3968",
                "2e10dbd9.4ecf14",
                "96bec378.87dd1"
            ]
        ]
    },
    {
        "id": "11fa5d12.c603f3",
        "type": "subflow:39915139.179ace",
        "z": "d6e42e12.e1e9c",
        "name": "",
        "x": 540,
        "y": 320,
        "wires": [
            [
                "68cef261.fb38fc"
            ]
        ]
    },
    {
        "id": "f5aef3e.8db451",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Quiet",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 452, \"switchcmd\": \"Set Level\", \"level\": 10}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 500,
        "wires": [
            [
                "22b473e1.45508c"
            ]
        ]
    },
    {
        "id": "ef1d07e3.8c5828",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Balanced",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 452, \"switchcmd\": \"Set Level\", \"level\": 20}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 560,
        "y": 540,
        "wires": [
            [
                "22b473e1.45508c"
            ]
        ]
    },
    {
        "id": "bf5734be.6201b8",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Turbo",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 452, \"switchcmd\": \"Set Level\", \"level\": 30}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 580,
        "wires": [
            [
                "22b473e1.45508c"
            ]
        ]
    },
    {
        "id": "321abec5.6f3062",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Max",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 452, \"switchcmd\": \"Set Level\", \"level\": 40}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 620,
        "wires": [
            [
                "22b473e1.45508c"
            ]
        ]
    },
    {
        "id": "e09aa6db.ce3968",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Mop",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 452, \"switchcmd\": \"Set Level\", \"level\": 50}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 660,
        "wires": [
            [
                "22b473e1.45508c"
            ]
        ]
    },
    {
        "id": "22b473e1.45508c",
        "type": "mqtt out",
        "z": "d6e42e12.e1e9c",
        "name": "Domoticz",
        "topic": "domoticz/in",
        "qos": "",
        "retain": "",
        "broker": "1949a812.2568e8",
        "x": 900,
        "y": 560,
        "wires": []
    },
    {
        "id": "2e10dbd9.4ecf14",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Lock",
        "func": "msg.payload = '{\"command\": \"setuservariable\", \"idx\": 19, \"value\": \"True\"}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 460,
        "wires": [
            [
                "22b473e1.45508c"
            ]
        ]
    },
    {
        "id": "4a14011.073ba",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Unlock",
        "func": "msg.payload = '{\"command\": \"setuservariable\", \"idx\": 19, \"value\": \"False\"}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 700,
        "y": 700,
        "wires": [
            [
                "22b473e1.45508c"
            ]
        ]
    },
    {
        "id": "96bec378.87dd1",
        "type": "delay",
        "z": "d6e42e12.e1e9c",
        "name": "Wait 2s",
        "pauseType": "delay",
        "timeout": "2",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "x": 560,
        "y": 700,
        "wires": [
            [
                "4a14011.073ba"
            ]
        ]
    },
    {
        "id": "36e6123.dfe85ee",
        "type": "subflow:ce34769c.6e7d28",
        "z": "d6e42e12.e1e9c",
        "name": "",
        "x": 550,
        "y": 120,
        "wires": [
            [
                "86e6ce22.e2785"
            ]
        ]
    },
    {
        "id": "d00b6e8b.e701",
        "type": "mqtt in",
        "z": "d6e42e12.e1e9c",
        "name": "Roborock",
        "topic": "valetudo/rockrobo/attributes",
        "qos": "2",
        "datatype": "json",
        "broker": "1949a812.2568e8",
        "x": 120,
        "y": 880,
        "wires": [
            [
                "7c32ed5f.32e3f4"
            ]
        ]
    },
    {
        "id": "7c32ed5f.32e3f4",
        "type": "switch",
        "z": "d6e42e12.e1e9c",
        "name": "Check Attributes",
        "property": "payload.valetudo_state.name",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "Cleaning",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Spot cleaning",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Idle",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Paused",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Returning home",
                "vt": "str"
            }
        ],
        "checkall": "false",
        "repair": false,
        "outputs": 5,
        "x": 350,
        "y": 880,
        "wires": [
            [
                "e932b08a.2d98",
                "1677bfa.287aa4",
                "9a6ac4e2.3c41c8"
            ],
            [
                "1677bfa.287aa4",
                "9a6ac4e2.3c41c8",
                "666fdf47.ff0ec"
            ],
            [
                "e3d7f4ed.cbef08",
                "1677bfa.287aa4",
                "9a6ac4e2.3c41c8"
            ],
            [
                "99b215.f94cbde8",
                "1677bfa.287aa4",
                "9a6ac4e2.3c41c8"
            ],
            [
                "2fdf434c.2ffbbc",
                "1677bfa.287aa4",
                "9a6ac4e2.3c41c8"
            ]
        ]
    },
    {
        "id": "e932b08a.2d98",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Start",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 451, \"switchcmd\": \"Set Level\", \"level\": 10}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 800,
        "wires": [
            [
                "fd6a463c.4b7878"
            ]
        ]
    },
    {
        "id": "e3d7f4ed.cbef08",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Stop",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 451, \"switchcmd\": \"Set Level\", \"level\": 30}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 880,
        "wires": [
            [
                "fd6a463c.4b7878"
            ]
        ]
    },
    {
        "id": "99b215.f94cbde8",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Pause",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 451, \"switchcmd\": \"Set Level\", \"level\": 40}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 920,
        "wires": [
            [
                "fd6a463c.4b7878"
            ]
        ]
    },
    {
        "id": "fd6a463c.4b7878",
        "type": "mqtt out",
        "z": "d6e42e12.e1e9c",
        "name": "Domoticz",
        "topic": "domoticz/in",
        "qos": "",
        "retain": "",
        "broker": "1949a812.2568e8",
        "x": 890,
        "y": 860,
        "wires": []
    },
    {
        "id": "1677bfa.287aa4",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Lock",
        "func": "msg.payload = '{\"command\": \"setuservariable\", \"idx\": 19, \"value\": \"True\"}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 760,
        "wires": [
            [
                "fd6a463c.4b7878"
            ]
        ]
    },
    {
        "id": "ebe69c2f.ebd93",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Unlock",
        "func": "msg.payload = '{\"command\": \"setuservariable\", \"idx\": 19, \"value\": \"False\"}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 690,
        "y": 1000,
        "wires": [
            [
                "fd6a463c.4b7878"
            ]
        ]
    },
    {
        "id": "9a6ac4e2.3c41c8",
        "type": "delay",
        "z": "d6e42e12.e1e9c",
        "name": "Wait 2s",
        "pauseType": "delay",
        "timeout": "2",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "x": 560,
        "y": 1000,
        "wires": [
            [
                "ebe69c2f.ebd93"
            ]
        ]
    },
    {
        "id": "1ec8af3.09f3a51",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Home",
        "func": "msg.payload = 'return_to_base';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 200,
        "wires": [
            [
                "17687ff9.c2106"
            ]
        ]
    },
    {
        "id": "2fdf434c.2ffbbc",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Home",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 451, \"switchcmd\": \"Set Level\", \"level\": 50}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 960,
        "wires": [
            [
                "fd6a463c.4b7878"
            ]
        ]
    },
    {
        "id": "ea024188.793c",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Spot",
        "func": "msg.payload = 'clean_spot';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 930,
        "y": 80,
        "wires": [
            [
                "17687ff9.c2106"
            ]
        ]
    },
    {
        "id": "666fdf47.ff0ec",
        "type": "function",
        "z": "d6e42e12.e1e9c",
        "name": "Spot",
        "func": "msg.payload = '{\"command\": \"switchlight\", \"idx\": 451, \"switchcmd\": \"Set Level\", \"level\": 10}';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 840,
        "wires": [
            []
        ]
    },
    {
        "id": "3fb8fb68.6a8e04",
        "type": "comment",
        "z": "d6e42e12.e1e9c",
        "name": "Depuis Domoticz",
        "info": "",
        "x": 140,
        "y": 180,
        "wires": []
    },
    {
        "id": "728afa57.495a24",
        "type": "comment",
        "z": "d6e42e12.e1e9c",
        "name": "Depuis Valetudo",
        "info": "",
        "x": 140,
        "y": 540,
        "wires": []
    },
    {
        "id": "2cf384c4.56535c",
        "type": "comment",
        "z": "d6e42e12.e1e9c",
        "name": "Depuis Valetudo",
        "info": "",
        "x": 140,
        "y": 840,
        "wires": []
    },
    {
        "id": "1949a812.2568e8",
        "type": "mqtt-broker",
        "z": "",
        "name": "Mosquitto",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": true,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "closeTopic": "",
        "closeQos": "0",
        "closeRetain": "false",
        "closePayload": "",
        "willTopic": "",
        "willQos": "0",
        "willRetain": "false",
        "willPayload": ""
    }
]