merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
364 stars 62 forks source link

Dreame - always last cleaning mode executed by default #567

Closed Phil2kj closed 2 months ago

Phil2kj commented 5 months ago

Hello everyone, I have the following issue and/or question: I am using a Dreame L10S and have successfully integrated it into Homebridge / HomeKit. The vacuum cleaner responds and I can control it via Apple HomeKit / Homebridge. However, I have created a command for my kitchen. This command should be defined so that only this room is vacuumed once by default. No mopping. This command is as follows:

{ "action": "vacuum-extend:start-clean", "name": "saugen Küche", "params": [ { "piid": 1, "value": 18 }, { "piid": 10, "value": "{\"selects\":[[1,1,1,1,1]]}" } ] },

Now my problem: If I start a wipe cleaning via the Xiaomi app and the Dreame wipes my apartment and I then afterwards execute the above command the next time, the Dreame starts a wipe cleaning and not the vacuuming command. So the cleaning mode that the Dreame last had is then always carried out by default via my room cleaning command.

My question: How can I change this? What am I doing wrong?

Thank you for your support Phil

Here is my full code of my DREAME used incl. some test commands (which do not work): { "devices": [ { "name": "DreameBot", "ip": "192.168.xxxxxx", "token": "xxxxxxxxxxxxxxxx", "deviceId": "xxxxxx", "model": "dreame.vacuum.r2228o", "pollingInterval": 10, "deepDebugLog": false, "micloud": { "country": "de" }, "buzzerControl": true, "ledControl": true, "childLockControl": true, "modeControl": true, "actionButtons": [ { "action": "audio:play-sound", "name": "play sound" }, { "action": "vacuum-extend:start-clean", "name": "saugen Küche", "params": [ { "piid": 1, "value": 18 }, { "piid": 10, "value": "{\"selects\":[[1,1,1,1,1]]}" } ] }, { "action": "vacuum-extend:start-clean", "name": "saugen Küche 2x", "params": [ { "piid": 1, "value": 18 }, { "piid": 10, "value": "{\"selects\":[[1,2,1,2,1]]}" } ] }, { "action": "vacuum:start-sweep", "name": "Test Küche", "params": [ { "piid": 1, "value": 18 }, { "piid": 10, "value": "{\"selects\":[[1,2,1,2,1]]}" } ] }, { "action": "vacuum:start-sweep", "name": "Test Küche sweep", "params": [ { "piid": 1, "value": 18 }, { "piid": 10, "value": "{\"selects\":[[1,1,1,1,1]]}" } ] }, { "action": "vacuum-extend:wash-mop", "name": "Wash mop" }, { "action": "vacuum-extend:start-clean", "name": "saugen Wohnung" } ] } ], "platform": "miot" } ],

merdok commented 5 months ago

Hi, i guess that you have to set the mode the desired one before starting the clean, so you more or less would need to create an automation which consists of the two commands: first set the mode and then start the kitchen clean. I am nor sure if you can include the mode in the room clean action, it might be that one of the selects params decides the mode...

Phil2kj commented 5 months ago

Hi merdok, thanks for your reply. With the current selects I understood from the readme that the following 5 attributes can be configured:

With your hint I tried to add following command: { "action": "vacuum-extend:cleaning-mode", "name": "Staubsauger Modus", "params": [ "2" ] }

Unfortunately I am unable to include this action command into my exiting kitchen command. Do you have any idea how to do so?

THANKS a lot!

Phil2kj commented 5 months ago

or would you somehow add this as a property command? I tried to add two properties to my JSON: "propertyControl": [ { "property": "vacuum-extend:cleaning-mode", "name": "Vacuum Mode Cleaning", "value": "2" }, { "property": "vacuum:mode", "name": "Vacuum Mode", "value": "2" } ] Not really anything with success - probably because they do not have any relations to my kitchen clean command. Would be awesome if anyone of you could give me some hint. Thank you so much.

merdok commented 5 months ago

Like mentioned, you already have the possibilities with the home app to run two commands, like by creating a scene and activating it. Currently it is not possible to have a switch which executes multiple commands and/or sets multiple properties.