python-miio icon indicating copy to clipboard operation
python-miio copied to clipboard

Mi Robot Vacuum-Mop 2 Pro (ijai.vacuum.v3)

Open evenywchen opened this issue 2 years ago • 7 comments

Device information:

  • Name(s) of the device: Mi Robot Vacuum-Mop 2 Pro | MJST1SHW
  • Link: https://home.miot-spec.com/s/ijai.vacuum.v3
  • Model: ijai.vacuum.v3
  • Hardware version:
  • Firmware version: 4.1.5_0041

evenywchen avatar Apr 05 '22 07:04 evenywchen

Was there ever any update to this?

jeffrey-zammit avatar Aug 22 '22 12:08 jeffrey-zammit

#1497 adds support for this, but I haven't had time to review it yet. Anyone with a device could contribute by testing that PR (and/or doing code review on it).

rytilahti avatar Sep 06 '22 23:09 rytilahti

Can you advise how I can test this out?

From: Teemu R. @.> Sent: Wednesday, 7 September 2022 01:06 To: rytilahti/python-miio @.> Cc: Jeffrey Zammit @.>; Manual @.> Subject: Re: [rytilahti/python-miio] Mi Robot Vacuum-Mop 2 Pro (ijai.vacuum.v3) (Issue #1385)

#1497 https://github.com/rytilahti/python-miio/pull/1497 adds support for this, but I haven't had time to review it yet. Anyone with a device could contribute by testing that PR (and/or doing code review on it).

— Reply to this email directly, view it on GitHub https://github.com/rytilahti/python-miio/issues/1385#issuecomment-1238735416 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ATXYBLNBGOYH45EHMYCH67TV47E37ANCNFSM5SR2LEBA . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/ATXYBLMT3XKP67EO3XFDXSTV47E37A5CNFSM5SR2LEBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJHKZUOA.gif Message ID: @.*** @.***> >

jeffrey-zammit avatar Sep 07 '22 14:09 jeffrey-zammit

how do i get this PR? i got 1 and can test it

redQs avatar Sep 07 '22 21:09 redQs

I think the simplest way is to use the github client to check out the PR:

gh repo clone rytilahti/python-miio
cd python-miio
gh pr checkout 1497
poetry install
poetry run miiocli pro2vacuum

rytilahti avatar Sep 08 '22 11:09 rytilahti

Any idea how this can be testing using Home Assistant?

From: Teemu R. @.> Sent: Thursday, 8 September 2022 13:38 To: rytilahti/python-miio @.> Cc: Jeffrey Zammit @.>; Manual @.> Subject: Re: [rytilahti/python-miio] Mi Robot Vacuum-Mop 2 Pro (ijai.vacuum.v3) (Issue #1385)

I think the simplest way is to use the github client https://cli.github.com/ to check out the PR:

gh repo clone rytilahti/python-miio cd python-miio gh pr checkout 1497 poetry install poetry run miiocli pro2vacuum

— Reply to this email directly, view it on GitHub https://github.com/rytilahti/python-miio/issues/1385#issuecomment-1240598089 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ATXYBLOWQMXON4RLP2RLHNLV5HFX3ANCNFSM5SR2LEBA . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/ATXYBLOCNJNGKSAYR7NAPS3V5HFX3A5CNFSM5SR2LEBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJHZAMSI.gif Message ID: @.*** @.***> >

jeffrey-zammit avatar Sep 08 '22 13:09 jeffrey-zammit

Sorry, that is not currently possible. Adding support for non-roborock vacuums requires some very heavy refactoring which will take some time. #1495 is the issue where the refactoring work is being tracked.

rytilahti avatar Sep 08 '22 17:09 rytilahti

Hi @rytilahti, i have a ijai.vacuum.v3 and would like to contribute by testing it. Followed the steps you mentioned above (cloning repo, checkout PR) had to setup poetry etc.

~~I am running poetry 1.2.0 with Python 3.8.0 i tried your command above poetry run miiocli pro2vacuum but get an error message from .pcapparser import parse_pcap File "C:\Users\nielm\Downloads\python-miio\miio\devtools\pcapparser.py", line 10, in <module> def read_payloads_from_file(file, tokens: list[str]): TypeError: 'type' object is not subscriptable~~

~~I also ran it with the ip and token args poetry -v run miiocli pro2vacuum --ip 192.168.1.70 --token MYTOKEN but i get the exact same error message. Is there something else i'm missing?~~

EDIT: I would have to scratch the whole comment on top. i re-setup poetry in my WSL env (previously PowerShell env) and i have seemed to progress.

I am now running poetry 1.1.12 with Python 3.10.4 I ran poetry run miiocli pro2vacuum --ip 192.168.1.70 --token MYTOKEN status Result: File "/mnt/c/Users/nielm/Downloads/python-miio/miio/integrations/vacuum/mijia/pro2vacuum.py", line 209, in filter_life_level return self.data["filter_life_level"] KeyError: 'filter_life_level'

let me know if you would like me to test in different versions, meantime i'll dig around.

EDIT2: I commented the KeyError's one by one till I had this: image

I then got the following results the ones marked in green is accurate: image I am not sure what the Error field must show Mop State the mop attachment is not installed but it shows ClothState.On Fan Speed is normally set to Medium and not Standard Water Level tank is not installed but shows WaterLevel.Low

Hope this helps.

EDIT3: Seems the filter name changed to hypa in this model image

Suggested fix for the KeyErrors in pro2vacuum.py: image

Result: image

NEoKhajitt avatar Sep 18 '22 19:09 NEoKhajitt

@NEoKhajitt oops, looks like I accidentally broke python 3.8 support when adding pcapparser... You could modify that exact line locally to have List[str] (uppercase L) instead of list[str] (lowercase l) to fix that for testing. See the linked PR for the required changes and thanks for giving the PR a test! :-)

rytilahti avatar Sep 18 '22 19:09 rytilahti

I just tried changing list[str] to List[str] but I get NameError: name 'List' is not defined

EDIT: Seem like "Type Hints" are only available in Python 3.9^ Suggested change would be adding from typing import List and updating list[str] to List[str]

EDIT2: Oi never mind, seems like i'm "wide asleep" tonight lol I did not check your PR before I wasted my own time lol.

NEoKhajitt avatar Sep 18 '22 21:09 NEoKhajitt