merdok / homebridge-miot

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

getting rooms #412

Closed tommyMX closed 1 year ago

tommyMX commented 1 year ago

Hi,

is it possible to add the rooms or get the rooms what are in the Mi Cloud / App ?

For the cleaner robot

Thank you

tommyMX commented 1 year ago

I have the model:

ijai.vacuum.v19

The S6 Pure

merdok commented 1 year ago

As already mentioned in another issue of yours: you can try to use the miot cli and run the following command in terminal to see if that outputs something. miot send <IP> -t <TOKEN> get_room_mapping '[]'

tommyMX commented 1 year ago

so seems he can't connect to get the room mapping...

INFO Connecting to device at 192.168.178.90 ERROR Could not connect to device, handshake timeout

But in Homebridge the device is active and I can start him from there

tommyMX commented 1 year ago

I forced the cloud mi connection in the settings from your plugin

tommyMX commented 1 year ago

but I ping the IP and got a reply

merdok commented 1 year ago

ERROR Could not connect to device, handshake timeout usually means that the token is invalid

tommyMX commented 1 year ago

so when we get the connection fixed I can get with this:

105 │ 'map:mijia-room-list' │ '10.22' │ 'mijia-room-list'

tommyMX commented 1 year ago

ERROR Could not connect to device, handshake timeout usually means that the token is invalid

But I dont understand its the same token in the plugin config in HB and there I can start and stop cleaning

Bildschirm­foto 2023-01-11 um 21 01 46
merdok commented 1 year ago

Yes, it is

tommyMX commented 1 year ago

But why I can't connect to the device over the bash :-(

merdok commented 1 year ago

not sure, maybe a typo somewhere?

tommyMX commented 1 year ago

not really, I looked again and make copy/paste..

is it different when I am in the plugin self, forcing the mi cloud but over the bash its another way maybe?

tommyMX commented 1 year ago

so I tried to login over cloud in the bash and gives this out: (MiCloud) Login step 1 (MiCloud) Login step 2 ERROR Login step 2 failed

tommyMX commented 1 year ago

Log in to the MiCloud

Options: --help Show help [boolean] --version Show version number [boolean] -u, --username Username [string] -p, --password Password [string] -f, --file File with the micloud credentials [string]

[Error: ENOENT: no such file or directory, open './micloudlogin.json'] { errno: -2, code: 'ENOENT', syscall: 'open', path: './micloudlogin.json' }

merdok commented 1 year ago

Yes, you have to either create micloudlogin.json file with your micloud login credentials inserted or you can put them straight into the terminal if you feel comfortable with that.

tommyMX commented 1 year ago

how must look the json file? but I dont think that this problem is resolved then.

Because the plugin is working fine over the HB GUI, but in the bash it dont work..

and I am sure everything username/password and token is right...copy/paste

any idea?

tommyMX commented 1 year ago

so what is step 2?

the command is

miot cloud login -u "NAME" -p "password" right?

merdok commented 1 year ago

A json with two keys username and password with the corresponding value

tommyMX commented 1 year ago

i am not the expert how a json must look :-)

is that the command for the bash I wrote? without the "" ?

tommyMX commented 1 year ago

when I try to login the password will be shorten, I have some special characters in it like .... $$%* maybe is this the problem in the bash?

tommyMX commented 1 year ago

lets try with the json file, can you give me a example and where I must put the file

merdok commented 1 year ago
{
"username": "USER",
"password": "PASSWORD"
}
tommyMX commented 1 year ago

perfekt i logged in in the bash

tommyMX commented 1 year ago

but still the test to the device failed... ERROR Could not connect to the device at 192.168.178.90! Make sure the ip and token are correct!

But I am sure the token is the same one like in the plugin config, also when I ping the IP, I got a response

tommyMX commented 1 year ago

maybe he tries to connect local and thats the problem and over the Plugin he connect over the cloud

tommyMX commented 1 year ago

yes so over miot cloud list-devices I get informations about my device...

so how can I use the get room mapping command over the cloud?

merdok commented 1 year ago

just go to the room cleaning guide here and try out the guide for various devices https://github.com/merdok/homebridge-miot/blob/main/docs/robotcleaner.md

tommyMX commented 1 year ago

yes I know this, but is there no command for the over the bash

because the modified app is still not working on android.

so is it possible to get the room mapping over the cloud command?

merdok commented 1 year ago

If you cannot find any equivalent command there then you need to capture the commands with the modified android app

tommyMX commented 1 year ago

The modified app isn’t working actually

tommyMX commented 1 year ago

The fetch list command put out some commands

https://merdok.github.io/miotspec/?model=ijai.vacuum.v19

like that

but how can I use them in the bash with the commands

So for any new devices come up in the future for no one will this plug-in work then :-/

merdok commented 1 year ago

You have to read the docs and follow the procedures inside there. You also have examples there on how to use the cli tools to execute commands: miot send <IP> -t <TOKEN> get_properties '[{siid":8,"piid":2}]'

tommyMX commented 1 year ago

I am not an expert with Know-how like others

anyway that make no sense when the plug-in is in 1 year so old because everyone is using a new device

no future for this plug-in sorry it is like it is

when no developer here to improve the plug-in for new devices

tommyMX commented 1 year ago

The plug-in will have no future that’s not what a developer is