Homebridge-xiaomi-roborock-vacuum: Roborock S6 MaxV | Model stop cleaning is throwing an error

Created on 22 Jun 2020  路  14Comments  路  Source: homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum

If I start the cleaning (switch the Fan state to on) everything works fine:
[2020-6-22 10:42:34] [S6] INF changedCleaning | roborock.vacuum.a10 | Cleaning is ON.
[2020-6-22 10:42:34] [S6] INF changedPause | roborock.vacuum.a10 | Paused possible

If I switch the Fan (S6) to off, I got the following error:
[2020-6-22 10:42:35] [S6] ERR setCleaning | roborock.vacuum.a10 | Failed to set cleaning to false Error: action locked
at Object.reject (/usr/lib/node_modules/homebridge-xiaomi-roborock-vacuum/miio/lib/network.js:506:19)
at DeviceInfo.onMessage (/usr/lib/node_modules/homebridge-xiaomi-roborock-vacuum/miio/lib/network.js:396:13)
at Socket. (/usr/lib/node_modules/homebridge-xiaomi-roborock-vacuum/miio/lib/network.js:169:14)
at Socket.emit (events.js:315:20)
at UDP.onMessage (dgram.js:910:8) {
code: -10003
}

if I switch the Fan (S6) to off again, everything works as excepted:
[2020-6-22 10:42:48] [S6] ACT setCleaning | roborock.vacuum.a10 | Stop cleaning and go to charge.
[2020-6-22 10:42:51] [S6] INF changedPause | roborock.vacuum.a10 | Paused not possible, no cleaning
[2020-6-22 10:42:51] [S6] INF changedCleaning | roborock.vacuum.a10 | Cleaning is OFF.
[2020-6-22 10:42:51] [S6] INF changedPause | roborock.vacuum.a10 | Paused not possible, no cleaning

please let me know if you need futher information

bug

All 14 comments

Q: Does your model support pausing (in the app)?

Q: Does your model support pausing (in the app)?

Yes.

Hmm, interesting... Thanks for reporting the issue... My first guess is that it may be a timing issue.

Can I change s as something in the code and do some tests?

I'd like to know first what command is throwing the error. Can you run homebridge with the following e environment variable on? DEBUG=thing*

That will provide the logs for the underlying communication layer (what messages are sent and received) :)

Something like

thing:miio:96818260 <- Message: `{"result":[{"msg_ver":3,"msg_seq":3142,"state":8,"battery":100,"clean_time":2288,"clean_area":42085000,"error_code":0,"map_present":1,"in_cleaning":0,"in_returning":0,"in_fresh_state":1,"lab_status":1,"water_box_status":0,"fan_power":103,"dnd_enabled":0,"map_status":3,"lock_status":0}],"id":106}`

Here we go:
2020-06-23T18:16:04.792Z thing:miio:321555068 -> (5) {"method":"app_pause","params":[],"id":114}
2020-06-23T18:16:04.829Z thing:miio:321555068 <- Message: {"result":["ok"],"id":114}
2020-06-23T18:16:04.881Z thing:miio:321555068 -> (5) {"method":"get_status","params":[],"id":115}
2020-06-23T18:16:04.882Z thing:miio:321555068 -> (5) {"method":"get_consumable","params":[],"id":116}
2020-06-23T18:16:04.889Z thing:miio:321555068 <- Message: {"result":[{"msg_ver":2,"msg_seq":2550,"state":5,"battery":100,"clean_time":10,"clean_area":0,"error_code":0,"map_present":1,"in_cleaning":1,"in_returning":0,"in_fresh_state":0,"lab_status":1,"water_box_status":0,"fan_power":101,"dnd_enabled":0,"map_status":3,"is_locating":0,"lock_status":0,"water_box_mode":202,"water_box_carriage_status":0,"mop_forbidden_enable":0,"camera_status":385,"is_exploring":0,"home_sec_status":0,"home_sec_enable_password":0,"adbumper_status":[0,0,0]}],"id":115}
2020-06-23T18:16:04.891Z thing:miio:321555068 <- Message: {"result":[{"main_brush_work_time":18890,"side_brush_work_time":9074,"filter_work_time":18890,"filter_element_work_time":10565,"sensor_dirty_time":18379}],"id":116}
2020-06-23T18:16:05.094Z thing:miio:321555068 -> (5) {"method":"get_status","params":[],"id":117}
2020-06-23T18:16:05.096Z thing:miio:321555068 -> (5) {"method":"get_consumable","params":[],"id":118}
2020-06-23T18:16:05.102Z thing:miio:321555068 <- Message: {"result":[{"msg_ver":2,"msg_seq":2551,"state":5,"battery":100,"clean_time":10,"clean_area":0,"error_code":0,"map_present":1,"in_cleaning":1,"in_returning":0,"in_fresh_state":0,"lab_status":1,"water_box_status":0,"fan_power":101,"dnd_enabled":0,"map_status":3,"is_locating":0,"lock_status":0,"water_box_mode":202,"water_box_carriage_status":0,"mop_forbidden_enable":0,"camera_status":385,"is_exploring":0,"home_sec_status":0,"home_sec_enable_password":0,"adbumper_status":[0,0,0]}],"id":117}
2020-06-23T18:16:05.103Z thing:miio:321555068 <- Message: {"result":[{"main_brush_work_time":18890,"side_brush_work_time":9074,"filter_work_time":18890,"filter_element_work_time":10565,"sensor_dirty_time":18379}],"id":118}
2020-06-23T18:16:05.105Z thing:miio:321555068 Property cleanTime changed from 20 to 10
2020-06-23T18:16:05.106Z thing:miio:321555068 Property in_cleaning changed from 0 to 1
2020-06-23T18:16:05.232Z thing:miio:321555068 -> (5) {"method":"get_status","params":[],"id":119}
2020-06-23T18:16:05.234Z thing:miio:321555068 -> (5) {"method":"get_consumable","params":[],"id":120}
2020-06-23T18:16:05.244Z thing:miio:321555068 <- Message: {"result":[{"msg_ver":2,"msg_seq":2552,"state":5,"battery":100,"clean_time":10,"clean_area":0,"error_code":0,"map_present":1,"in_cleaning":1,"in_returning":0,"in_fresh_state":0,"lab_status":1,"water_box_status":0,"fan_power":101,"dnd_enabled":0,"map_status":3,"is_locating":0,"lock_status":0,"water_box_mode":202,"water_box_carriage_status":0,"mop_forbidden_enable":0,"camera_status":385,"is_exploring":0,"home_sec_status":0,"home_sec_enable_password":0,"adbumper_status":[0,0,0]}],"id":119}
2020-06-23T18:16:05.279Z thing:miio:321555068 <- Message: {"result":[{"main_brush_work_time":18890,"side_brush_work_time":9074,"filter_work_time":18890,"filter_element_work_time":10565,"sensor_dirty_time":18379}],"id":120}
2020-06-23T18:16:05.893Z thing:miio:321555068 -> (5) {"method":"app_charge","params":[],"id":121}
2020-06-23T18:16:05.898Z thing:miio:321555068 <- Message: {"error":{"code":-10003,"message":"action locked"},"id":121}
[2020-6-23 20:16:05] [Reinigen] ERR setCleaning | roborock.vacuum.a10 | Failed to set cleaning to false Error: action locked
at Object.reject (/usr/lib/node_modules/homebridge-xiaomi-roborock-vacuum/miio/lib/network.js:506:19)
at DeviceInfo.onMessage (/usr/lib/node_modules/homebridge-xiaomi-roborock-vacuum/miio/lib/network.js:396:13)
at Socket. (/usr/lib/node_modules/homebridge-xiaomi-roborock-vacuum/miio/lib/network.js:169:14)
at Socket.emit (events.js:315:20)
at UDP.onMessage (dgram.js:910:8) {
code: -10003
}

Interesting! Thanks!

Hi, als long as they're some other problems with the S6 MaxV (like reporting the fan speed with 106%), I can also try to implement the model in a new branch?

yes! Pull Requests are welcomed! Please! If you have the time to add the fixes, do so! I'll be happy to merge them and publish a new version :)

Ok.
I have a question, as long I can not test the behavior with one of the "other" vacuums. If the cleaning is in progress and I stop it, the vacuum get into pause mode and if I stop it again he returns to the loading station? Or will he stop and return immediately to the charger?

This is the current code used for _send to charge_:
https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/blob/master/miio/lib/devices/vacuum.js#L237-L251

It pauses the cleaning, if the pause option fails, it tries to stop it.
Then it waits 1 second
And finally, it sends the app_charge command to send it to the dock.

What I can see from your logs:

2020-06-23T18:16:05.893Z thing:miio:321555068 -> (5) {"method":"app_charge","params":[],"id":121}
2020-06-23T18:16:05.898Z thing:miio:321555068 <- Message: {"error":{"code":-10003,"message":"action locked"},"id":121}

Is that the action to app_charge is locked.
Maybe in your model, we should not call pause and call stop instead? 馃し

Another possibility, since you mentioned the second attempt works for you, is to catch the app_charge, looking for the error.code === -10003 and call the activateCharging method again 馃

After all, only a small change:

pause() {
return this.call("app_pause", [], {
refresh: ["state"],
refreshDelay: 1000
}).then(checkResult);
}

Pull request is on the way (with some other changes for the s6 maxV)

Awesome!! Thank you!

It should be fixed by the version 0.12.0 (thanks to you!) :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

normen picture normen  路  14Comments

netRunner0 picture netRunner0  路  13Comments

Tim2309 picture Tim2309  路  6Comments

thechris1992 picture thechris1992  路  9Comments

bedrin picture bedrin  路  4Comments