-
-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Initial support for nextgen vacuums (with prefixed methods) #372
Conversation
# clean_mode, begin_time, clean_trigger, | ||
# back_trigger, clean_strategy, and completed | ||
# | ||
#{"msg_ver":8,"msg_seq":60,"state":5,"battery":93,"clean_mode":0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block comment should start with '# '
@rytilahti I am here and in #370 to help with device. |
The status report contains new information (listed in the PR description), it would be nice if you could do some testing to see what values those can be (especially clean_mode, clean_trigger, back_trigger, and clean_strategy). |
@rytilahti over last days I tried to reverse engineer MI Home APK to find out clean_mode as well as other values meaning in source code w/o any luck. I'll try to analyze status responses that my cleaner will send in different modes during next few weeks and try to figure out how they change. This will not give the full list of possible values though. |
Ok, thanks. It is not that important anyway. I suppose the modes are something like "scheduled cleaning", "user initiated cleaning" or so. which isn't necessarily so important. Is this working for you know otherwise? edit: apparently not (wrt. discussion in #364). maybe that device does not use the same prefix as |
Do we know when this will be done ? any help needed ? My robot is awaiting automation ! |
Is this PR working for you? And which vacuum is it (roborock.vacuum.e2 or roborock.vacuum.c1?)? The automatic fallback to the |
Its roborock.vacuum.c1. I am using this lib altogether with www.home-assistant.io, would be too much hassle to build it myself just for this. Anyway if needed, I can try this separately from home automation to test stuff. |
I tried this PR with Xiaowa E352 model, with RAW command I can get status from vacuum, however there is some erro with cleanup() function.
|
For this PR you should pass |
yup, when I try with --nextgen switch I got timeout and no response from device
|
That would be |
nope, getting Error: {'code': -32600, 'message': 'Req object invalid.'}
so 10. 11. 2018 o 19:29 Teemu R. <notifications@github.com> napísal(a):
… That would be mirobo --nextgen cleaning-history, nextgen simply adds the
user. prefix when deemed necessary, otherwise there is no changes in the
protocol so it shouldn't really timeout on it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#372 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGFfnFOOUF6cxThWfEYUXZ76O_-zJ7i3ks5utxsMgaJpZM4WSCR5>
.
|
So I tried to check the code but I am unable to understand how things works deeply enough.
when I try mirobo status
with mirobo --nextgen -dd status exactly the same.
Output of info
info with nextgen is timeout
Do you have chance what is wrong and point me to some direction what can I try to change ? |
@Luc3as Ah, now I think I know what is happening. Your vacuum expects the "old-style" commands, I suppose, but requires that the parameters list is passed along with it. Could you please try #408 to see if that helps? Related to the cleanup callback, could you also post edit: to add, I cherry-picked the #408 here, as it seems to be necessary for making the vacuums expecting empty parameters if none are given. To sum it up:
|
This seems to work fine with yeelight and gen1 vacuum, however, more testing is needed with other devices and/or this change should only be done for the vacuum. Related to #348 / Xiaowa E352
Hi, roborock.vacuum.c1 here. Everything works (all the cleaning functions, status, timers, etc.) using --nextgen, apart from:
mirobo --debug --nextgen sound
And if I ask for status after these commands throwing, status also throws: mirobo --debug status
Asking for successful stuff (like stop) will return a correct status once again, I guess maybe status returns last error which we're unable to parse or something like that. |
Hi, could you try #408 PR if it is working without nextgen option?
…On Tue, Nov 13, 2018, 08:58 Arnas Navašinskas ***@***.*** wrote:
Hi, roborock.vacuum.c1 here.
Everything works (all the cleaning functions, status, timers, etc.) using
--nextgen, apart from:
mirobo --debug --nextgen serial-number
INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 133, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to 1.1.1.90 with token ccf5863d202af55e3855b96fb3e5c269
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device:Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x05\x0c\xe8\x18\x00\x00U\x90' (total 16)
value = Container:
length = 32
unknown = 0
device_id = b'\x05\x0c\xe8\x18' (total 4)
ts = 1970-01-01 06:05:04
offset1 = 0
offset2 = 16
length = 16
checksum = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' (total 16)
DEBUG:miio.device:Discovered 050ce818 with ts: 1970-01-01 06:05:04, token: b'00000000000000000000000000000000'
DEBUG:miio.device:1.1.1.90:54321 >>: {'id': 134, 'method': 'user.get_serial_number', 'params': []}
DEBUG:miio.device:1.1.1.90:54321 (ts: 1970-01-01 06:05:05, id: 134) << {'result': ['OK'], 'id': 134}
Traceback (most recent call last):
File "C:\Program Files\Python\Python37\Scripts\mirobo-script.py", line 11, in <module>
load_entry_point('python-miio==0.4.9', 'console_scripts', 'mirobo')()
File "c:\program files\python\python37\lib\site-packages\python_miio-0.4.9-py3.7.egg\miio\click_common.py", line 54, in __call__
return self.main(*args, **kwargs)
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\program files\python\python37\lib\site-packages\click\decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\program files\python\python37\lib\site-packages\python_miio-0.4.9-py3.7.egg\miio\vacuum_cli.py", line 506, in serial_number
click.echo("Serial#: %s" % vac.serial_number())
File "c:\program files\python\python37\lib\site-packages\python_miio-0.4.9-py3.7.egg\miio\vacuum.py", line 373, in serial_number
return self.send("get_serial_number")[0]["serial_number"]
TypeError: string indices must be integers
mirobo --debug --nextgen sound
INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 133, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to 1.1.1.90 with token ccf5863d202af55e3855b96fb3e5c269
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device:Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x05\x0c\xe8\x18\x00\x00U\xe8' (total 16)
value = Container:
length = 32
unknown = 0
device_id = b'\x05\x0c\xe8\x18' (total 4)
ts = 1970-01-01 06:06:32
offset1 = 0
offset2 = 16
length = 16
checksum = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' (total 16)
DEBUG:miio.device:Discovered 050ce818 with ts: 1970-01-01 06:06:32, token: b'00000000000000000000000000000000'
DEBUG:miio.device:1.1.1.90:54321 >>: {'id': 134, 'method': 'user.get_current_sound', 'params': []}
DEBUG:miio.device:1.1.1.90:54321 (ts: 1970-01-01 06:06:32, id: 134) << {'result': ['OK'], 'id': 134}
Traceback (most recent call last):
File "C:\Program Files\Python\Python37\Scripts\mirobo-script.py", line 11, in <module>
load_entry_point('python-miio==0.4.9', 'console_scripts', 'mirobo')()
File "c:\program files\python\python37\lib\site-packages\python_miio-0.4.9-py3.7.egg\miio\click_common.py", line 54, in __call__
return self.main(*args, **kwargs)
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\program files\python\python37\lib\site-packages\click\decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "c:\program files\python\python37\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\program files\python\python37\lib\site-packages\python_miio-0.4.9-py3.7.egg\miio\vacuum_cli.py", line 444, in sound
click.echo("Current sound: %s" % vac.sound_info())
File "c:\program files\python\python37\lib\site-packages\python_miio-0.4.9-py3.7.egg\miio\vacuumcontainers.py", line 423, in __repr__
self.current,
File "c:\program files\python\python37\lib\site-packages\python_miio-0.4.9-py3.7.egg\miio\vacuumcontainers.py", line 415, in current
return self.data['sid_in_use']
TypeError: string indices must be integers
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#372 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGFfnIT5yfYme6hyeH-ogNcEP0l0neAVks5uunumgaJpZM4WSCR5>
.
|
roborock.vacuum.c1 With #408 it works without --nextgen same as with this with --nextgen. |
Thanks @Arnasnn for reporting back! I think that this PR is then completely unnecessary (except for the parts of new status information provided by those vacuums) and can be superseded with #408 when it' |
Obsoleted by #408. |
This adds initial support for vacuums using a different call convention (prefixing some calls with
user.
). Passing--nextgen
(name will probably change or get dropped) option sets this mode active.This should fix #348, #364 and #370, but testing is needed.
TODO: