merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
390 stars 61 forks source link

Are there any possibilities to set rooms with my dreams f9? #132

Closed IvanDF closed 2 years ago

IvanDF commented 2 years ago

Reading the other opened issues regarding cleaning by rooms, I have read that it is possible to set the cleaner by rooms.

I add to JSON config the action, but on my Apple HomeKit when I active the action "Pulisci Stanza" turns off immediately without giving the input to my Dreame F9. I didn't understand what I should insert in "params".

Here the code inside my JSON:

"actionButtons": [
    {
        "action": "start_clean",
        "name": "Pulisci Stanza",
        "params": [
            1,
            0
        ]
    }
],
merdok commented 2 years ago

Hi,

what you created looks already pretty good, expect that in the spec for your vacuum there is only 1 parameter! You can have a look here how the parameters are constructed: https://github.com/merdok/homebridge-miot/pull/51#issue-934185629

It might actually also be that your vacuum cleaner has the one hidden parameter which is not in the spec, in that case i would need to add it. But could you please test with the information that you there?

You can also add the one hidden parameter here locally on your disk and test it out then https://github.com/merdok/homebridge-miot/blob/main/lib/modules/robotcleaner/devices/dreame.vacuum.p2008.js#L132

It should look like this with the hidden parameter: https://github.com/merdok/homebridge-miot/blob/main/lib/modules/robotcleaner/devices/dreame.vacuum.p2041.js#L121

IvanDF commented 2 years ago

Hi, i am new here, and I think I don't understand about "hidden params" and testing in local, I read the comment #51 and tried to replicate it without success... I saw the file about dreame.vacuum.p2008.js and the row about "start_clean".

I searched about some examples of JSON files for that, but nothing

merdok commented 2 years ago

"hidden params" means that they are there but are not documented in the official xiaomi specification for the device, hence they might be missing in my implementation since i base my implementation on the specification.

I have already linked you two files with the exact lines of code. You need edit the first file in your local homebridge installation which is for your vacuum (dreame.vacuum.p2008.js) and just replace the marked line of code with the line of code from the other file(dreame.vacuum.p2041.js), then save the file and restart homerbidge. After that you can play around with the example json from the linked comment.

IvanDF commented 2 years ago

Hi, sorry for the late reply, I tried to search inside Homebridge's local files but I didn't find anything about dreame.vacuum... I installed it on my raspberry and in it I only have json's files.

I have also tried to install Homebridge on Raspbian OS using the terminal but inside of Homebridge folder there aren't the files you told me about.

merdok commented 2 years ago

The installed packages are not in your homebridge directory, you should check in your node_modulesdirectory, usually located under /usr/lib/ on a raspberry pi.

IvanDF commented 2 years ago

Ok, I finally found the file for my vacuum and modified it.

I’m trying with different params in the json file but without success

merdok commented 2 years ago

I am not sure at this point what your issue might be. Either you typing the parameters wrong, or you are using wrong room ids... I guess someone with a similar vacuum would need to help you.

merdok commented 2 years ago

Have a look here for a small guide on how to use room cleaning on dreame devices: https://github.com/merdok/homebridge-miot/blob/main/docs/robotcleaner.md