Skip to content
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

Robot still running - changedCharging / changedCleaning #36

Closed
maisun opened this issue Jan 20, 2019 · 23 comments
Closed

Robot still running - changedCharging / changedCleaning #36

maisun opened this issue Jan 20, 2019 · 23 comments

Comments

@maisun
Copy link

maisun commented Jan 20, 2019

Hi, thank you for the new version with the fix for the running status.
However I still seem to have some problem with status after the cleaning job is completed.
Basically when the roborock S50 finishes full house clean and returns to the dock station, HomeKit thinks it's still running until either 1) I manually turn the fan off (but it gives issue next time when I start cleaning from Homekit) or 2) restart HomeBridge service. I did several tests recently, same behaviour regardless if I start cleaning from Homekit or Mi Home. If I start clean and stop manually in HomeKit (turn off the fan), everything works as expected.
To conclude: it looks to me that the plugin cannot detect when the cleaning job is finished (and the roborock returns to the dock station) and think it's still running (forever).

@nicoh88
Copy link
Member

nicoh88 commented Jan 20, 2019

Hmm, I use the plugin exactly the same way.

A HomeKit Automation starts the robot and cleans the house. After the cleaning he drives into the dock. The status is always correct, updated within 30 seconds. At the conclusion, when driving to the dock and docking.

I can not understand your problem. So i need a debug log where the problem occurs, of course with the timestamps when the status should have updated.

Can it be that your robot loses the WLAN signal during the cleaning, because the signal becomes too weak? Because in this case, the status can no longer update. since no automatic reconnect can take place over the api without a restart of homebridge. In this case, you would have to work on your wireless coverage.

@maisun
Copy link
Author

maisun commented Jan 20, 2019

Hi Nico, thank you for replying! I do have a room with weak WIFI signal and maybe that's the reason. I checked the log file of HomeBridge but couldn't find anything suspicious, what error message shall I search for disconnect? Would it be possible to implement re-connect logic every 30 seconds when the device is offline?
Below is the logs that I grep from yesterday about roborock plugin. The cleaning job according to Mi Home started at 10:48 and finished at 12:52. Noticed that I tried to start cleaning from HomeKit and the first time it didn't do anything, so I had to turn off the fan and started again, which then worked. There was no restart of HomeBridge since last cleaning, so the plugin still seemed to have connection to roborock when I started cleaning yesterday.

{"log":"[1/19/2019, 9:47:45 AM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is false.\n","stream":"stdout","time":"2019-01-19T09:47:45.295381199Z"}
{"log":"[1/19/2019, 9:47:45 AM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T09:47:45.295822992Z"}
{"log":"[1/19/2019, 9:47:45 AM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is false.\n","stream":"stdout","time":"2019-01-19T09:47:45.296093232Z"}
{"log":"[1/19/2019, 9:47:45 AM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T09:47:45.297644113Z"}
{"log":"[1/19/2019, 9:47:48 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:47:48.580963266Z"}
{"log":"[1/19/2019, 9:47:48 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:47:48.609079364Z"}
{"log":"[1/19/2019, 9:47:48 AM] [Roborock] ACT setCleaning | roborock.vacuum.s5 | Start cleaning.\n","stream":"stdout","time":"2019-01-19T09:47:48.60995636Z"}
{"log":"[1/19/2019, 9:47:48 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:47:48.85244656Z"}
{"log":"[1/19/2019, 9:47:48 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:47:48.85250116Z"}
{"log":"[1/19/2019, 9:47:49 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 75% over miIO.\n","stream":"stdout","time":"2019-01-19T09:47:49.12981948Z"}
{"log":"[1/19/2019, 9:47:49 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 75% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:47:49.129865344Z"}
{"log":"[1/19/2019, 9:47:49 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:47:49.51170441Z"}
{"log":"[1/19/2019, 9:47:49 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:47:49.511751858Z"}
{"log":"[1/19/2019, 9:47:49 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:47:49.773610127Z"}
{"log":"[1/19/2019, 9:47:49 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:47:49.773658523Z"}
{"log":"[1/19/2019, 9:47:50 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:47:50.150987855Z"}
{"log":"[1/19/2019, 9:47:50 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:47:50.151063407Z"}
{"log":"[1/19/2019, 9:48:03 AM] [Roborock] ACT setCleaning | roborock.vacuum.s5 | Stop cleaning and go to charge.\n","stream":"stdout","time":"2019-01-19T09:48:03.159808678Z"}
{"log":"[1/19/2019, 9:48:04 AM] [Roborock] MON changedCharging | roborock.vacuum.s5 | ChargingState has changed, is now true\n","stream":"stdout","time":"2019-01-19T09:48:04.179213376Z"}
{"log":"[1/19/2019, 9:48:04 AM] [Roborock] INF changedCharging | roborock.vacuum.s5 | Charging is active.\n","stream":"stdout","time":"2019-01-19T09:48:04.1794126Z"}
{"log":"[1/19/2019, 9:48:04 AM] [Roborock] INF changedCharging | roborock.vacuum.s5 | Robot was docked.\n","stream":"stdout","time":"2019-01-19T09:48:04.180639661Z"}
{"log":"[1/19/2019, 9:48:08 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 38% over miIO.\n","stream":"stdout","time":"2019-01-19T09:48:08.507169508Z"}
{"log":"[1/19/2019, 9:48:08 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 38% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:48:08.50726588Z"}
{"log":"[1/19/2019, 9:48:08 AM] [Roborock] ACT setCleaning | roborock.vacuum.s5 | Start cleaning.\n","stream":"stdout","time":"2019-01-19T09:48:08.507284864Z"}
{"log":"[1/19/2019, 9:48:08 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 38% over miIO.\n","stream":"stdout","time":"2019-01-19T09:48:08.769895209Z"}
{"log":"[1/19/2019, 9:48:08 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 38% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:48:08.770638165Z"}
{"log":"[1/19/2019, 9:48:09 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:48:09.076011431Z"}
{"log":"[1/19/2019, 9:48:09 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:48:09.076310435Z"}
{"log":"[1/19/2019, 9:48:09 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:48:09.355322832Z"}
{"log":"[1/19/2019, 9:48:09 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:48:09.355648896Z"}
{"log":"[1/19/2019, 9:48:09 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:48:09.634584433Z"}
{"log":"[1/19/2019, 9:48:09 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:48:09.634664545Z"}
{"log":"[1/19/2019, 9:48:09 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed set to 60% over miIO.\n","stream":"stdout","time":"2019-01-19T09:48:09.942002644Z"}
{"log":"[1/19/2019, 9:48:09 AM] [Roborock] ACT setSpeed | roborock.vacuum.s5 | FanSpeed in HomeKit set to 60% after CLEANUP.\n","stream":"stdout","time":"2019-01-19T09:48:09.942255652Z"}
{"log":"[1/19/2019, 10:33:26 AM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-19T10:33:26.620271956Z"}
{"log":"[1/19/2019, 10:33:26 AM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T10:33:26.620342804Z"}
{"log":"[1/19/2019, 10:57:55 AM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-19T10:57:55.789364399Z"}
{"log":"[1/19/2019, 10:57:55 AM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T10:57:55.789548935Z"}
{"log":"[1/19/2019, 10:57:57 AM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-19T10:57:57.965316076Z"}
{"log":"[1/19/2019, 10:57:57 AM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T10:57:57.965612284Z"}
{"log":"[1/19/2019, 10:58:25 AM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-19T10:58:25.870367558Z"}
{"log":"[1/19/2019, 10:58:25 AM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T10:58:25.870892895Z"}
{"log":"[1/19/2019, 10:58:25 AM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-19T10:58:25.871060655Z"}
{"log":"[1/19/2019, 10:58:25 AM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T10:58:25.871553171Z"}
{"log":"[1/19/2019, 11:53:57 AM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-19T11:53:57.946317731Z"}
{"log":"[1/19/2019, 11:53:57 AM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T11:53:57.946542491Z"}
{"log":"[1/19/2019, 11:53:57 AM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-19T11:53:57.946856147Z"}
{"log":"[1/19/2019, 11:53:57 AM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T11:53:57.947379204Z"}
{"log":"[1/19/2019, 11:54:31 AM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-19T11:54:31.182997268Z"}
{"log":"[1/19/2019, 11:54:31 AM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T11:54:31.183399196Z"}
{"log":"[1/19/2019, 11:54:31 AM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-19T11:54:31.183757504Z"}
{"log":"[1/19/2019, 11:54:31 AM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T11:54:31.184149208Z"}
{"log":"[1/19/2019, 12:00:28 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-19T12:00:28.81989853Z"}
{"log":"[1/19/2019, 12:00:28 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T12:00:28.820269498Z"}
{"log":"[1/19/2019, 12:00:28 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-19T12:00:28.82058469Z"}
{"log":"[1/19/2019, 12:00:28 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T12:00:28.821058103Z"}
{"log":"[1/19/2019, 12:03:02 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-19T12:03:02.278918797Z"}
{"log":"[1/19/2019, 12:03:02 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T12:03:02.279191893Z"}
{"log":"[1/19/2019, 12:03:02 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-19T12:03:02.279584929Z"}
{"log":"[1/19/2019, 12:03:02 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T12:03:02.280035938Z"}
{"log":"[1/19/2019, 1:12:53 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-19T13:12:53.333912547Z"}
{"log":"[1/19/2019, 1:12:53 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T13:12:53.334234807Z"}
{"log":"[1/19/2019, 1:12:53 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-19T13:12:53.334572595Z"}
{"log":"[1/19/2019, 1:12:53 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T13:12:53.335033563Z"}
{"log":"[1/19/2019, 1:12:58 PM] [Roborock] ACT setCleaning | roborock.vacuum.s5 | Stop cleaning and go to charge.\n","stream":"stdout","time":"2019-01-19T13:12:58.749391901Z"}
{"log":"[1/19/2019, 5:37:32 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is false.\n","stream":"stdout","time":"2019-01-19T17:37:32.252375442Z"}
{"log":"[1/19/2019, 5:37:32 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T17:37:32.252595258Z"}
{"log":"[1/19/2019, 5:37:32 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is false.\n","stream":"stdout","time":"2019-01-19T17:37:32.252917602Z"}
{"log":"[1/19/2019, 5:37:32 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-19T17:37:32.25344649Z"}
{"log":"[1/19/2019, 5:41:04 PM] Loaded plugin: homebridge-xiaomi-roborock-vacuum\n","stream":"stdout","time":"2019-01-19T17:41:04.229591444Z"}
{"log":"[1/19/2019, 5:41:04 PM] Registering accessory 'homebridge-xiaomi-roborock-vacuum.XiaomiRoborockVacuum'\n","stream":"stdout","time":"2019-01-19T17:41:04.230155264Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] STA getDevice | Model: roborock.vacuum.s5\n","stream":"stdout","time":"2019-01-19T17:41:05.140786667Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] MON changedCleaning | roborock.vacuum.s5 | CleaningState has changed, is now false\n","stream":"stdout","time":"2019-01-19T17:41:05.145368929Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] INF changedCleaning | roborock.vacuum.s5 | Cleaning was stopped.\n","stream":"stdout","time":"2019-01-19T17:41:05.145622705Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] MON changedCharging | roborock.vacuum.s5 | ChargingState has changed, is now true\n","stream":"stdout","time":"2019-01-19T17:41:05.146495669Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] INF changedCharging | roborock.vacuum.s5 | Charging is active.\n","stream":"stdout","time":"2019-01-19T17:41:05.146697305Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] INF changedCharging | roborock.vacuum.s5 | Robot was docked.\n","stream":"stdout","time":"2019-01-19T17:41:05.147429954Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] MON changedSpeed | roborock.vacuum.s5 | FanSpeed has changed, is now 60%\n","stream":"stdout","time":"2019-01-19T17:41:05.148272162Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] INF changedSpeed | roborock.vacuum.s5 | Speed was changed to 60%\n","stream":"stdout","time":"2019-01-19T17:41:05.14853591Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] MON changedPause | roborock.vacuum.s5 | CleaningState has changed, is now false\n","stream":"stdout","time":"2019-01-19T17:41:05.150210571Z"}
{"log":"[1/19/2019, 5:41:05 PM] [Roborock] INF changedPause | roborock.vacuum.s5 | Paused not possible, no cleaning\n","stream":"stdout","time":"2019-01-19T17:41:05.150453007Z"}
{"log":"[1/19/2019, 6:16:40 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is false.\n","stream":"stdout","time":"2019-01-19T18:16:40.139090881Z"}
{"log":"[1/19/2019, 6:16:40 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-19T18:16:40.139148493Z"}
{"log":"[1/19/2019, 6:16:40 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is false.\n","stream":"stdout","time":"2019-01-19T18:16:40.139166649Z"}
{"log":"[1/19/2019, 6:16:40 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is true.\n","stream":"stdout","time":"2019-01-19T18:16:40.139182537Z"}

@nicoh88
Copy link
Member

nicoh88 commented Jan 20, 2019

Hi, in the debuglog you can clearly see that he has not got any information after starting. Not even that the battery is only at X% percent.

[1/20/2019, 5:39:05 PM] [Staubsauger EG Flur] DEB setCleaning | roborock.vacuum.s5 | Cleaning set it to true.
[1/20/2019, 5:39:05 PM] [Staubsauger EG Flur] ACT setCleaning | roborock.vacuum.s5 | Start cleaning, not charging.
[1/20/2019, 5:39:05 PM] [Staubsauger EG Flur] ACT setCleaning - dock | roborock.vacuum.s5 | Docked set to false.
[1/20/2019, 5:39:06 PM] [Staubsauger EG Flur] DEB changedCharging | roborock.vacuum.s5 | ChargingState false, LastChargingStatefalse
[1/20/2019, 5:39:06 PM] [Staubsauger EG Flur] DEB changedCleaning | roborock.vacuum.s5 | CleaningState true, LastCleaningStatetrue
[1/20/2019, 5:40:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 99%
[1/20/2019, 5:41:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 98%
[1/20/2019, 5:44:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 97%
[1/20/2019, 5:46:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 96%
[1/20/2019, 5:48:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 95%
[1/20/2019, 5:50:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 94%
[1/20/2019, 5:52:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 93%
[1/20/2019, 5:54:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 92%
[1/20/2019, 5:56:09 PM] [Staubsauger OG Bad] INF getCleaning | rockrobo.vacuum.v1 | Cleaning is false.
[1/20/2019, 5:56:09 PM] [Staubsauger OG Bad] INF getSpeed | rockrobo.vacuum.v1 | Fanspeed is 60%.
[1/20/2019, 5:56:09 PM] [Staubsauger OG Bad] INF getDocked | rockrobo.vacuum.v1 | Robot Docked is true.
[1/20/2019, 5:56:09 PM] [Staubsauger EG Flur] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.
[1/20/2019, 5:56:09 PM] [Staubsauger EG Flur] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.
[1/20/2019, 5:56:09 PM] [Staubsauger EG Flur] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.
[1/20/2019, 5:56:10 PM] [Staubsauger OG Bad] INF getPausestate | rockrobo.vacuum.v1 | Pause possible is false.
[1/20/2019, 5:56:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 91%
[1/20/2019, 5:57:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 90%
[1/20/2019, 6:00:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 89%
[1/20/2019, 6:02:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 88%
[1/20/2019, 6:04:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 87%
[1/20/2019, 6:06:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 86%
[1/20/2019, 6:08:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 85%
[1/20/2019, 6:10:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 84%
[1/20/2019, 6:11:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 83%
[1/20/2019, 6:13:25 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 82%
[1/20/2019, 6:14:25 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 81%
[1/20/2019, 6:16:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 80%
[1/20/2019, 6:19:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 79%
[1/20/2019, 6:20:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 78%
[1/20/2019, 6:22:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 77%
[1/20/2019, 6:24:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 76%
[1/20/2019, 6:26:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 75%
[1/20/2019, 6:28:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 74%
[1/20/2019, 6:29:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 73%
[1/20/2019, 6:31:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 72%
[1/20/2019, 6:34:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 71%
[1/20/2019, 6:35:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 70%
[1/20/2019, 6:36:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 69%
[1/20/2019, 6:37:56 PM] [Staubsauger EG Flur] DEB changedCleaning | roborock.vacuum.s5 | CleaningState false, LastCleaningStatetrue
[1/20/2019, 6:37:56 PM] [Staubsauger EG Flur] MON changedCleaning | roborock.vacuum.s5 | CleaningState has changed, is now false
[1/20/2019, 6:37:56 PM] [Staubsauger EG Flur] INF changedCleaning | roborock.vacuum.s5 | Cleaning was stopped.
[1/20/2019, 6:38:54 PM] [Staubsauger EG Flur] DEB changedCharging | roborock.vacuum.s5 | ChargingState true, LastChargingStatefalse
[1/20/2019, 6:38:54 PM] [Staubsauger EG Flur] MON changedCharging | roborock.vacuum.s5 | ChargingState has changed, is now true
[1/20/2019, 6:38:54 PM] [Staubsauger EG Flur] INF changedCharging | roborock.vacuum.s5 | Charging is active.
[1/20/2019, 6:38:54 PM] [Staubsauger EG Flur] INF changedCharging | roborock.vacuum.s5 | Robot was docked.
[1/20/2019, 6:38:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 68%
[1/20/2019, 6:42:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 69%
[1/20/2019, 6:44:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 70%
[1/20/2019, 6:45:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 71%
[1/20/2019, 6:47:54 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 72%
[1/20/2019, 6:49:24 PM] [Staubsauger EG Flur] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 73%

I think that problem is the wifi. Start the robot near the WLAN-AP, block the way and see if the statuses are updated properly. Restart homebridge before. Happy again a debug log.

Unfortunately, you can not install a reconnect logic. Since the miio API does not notice when no information comes or the connection is demolished - and it is quite normal, if the robot does nothing, that he even hours, even days, no infos sends.

@nicoh88 nicoh88 changed the title Still have some issues with the latest version Robot still running - changedCharging / changedCleaning Jan 20, 2019
@maisun
Copy link
Author

maisun commented Jan 20, 2019

Hi Nico, I don't any debug message in the log. How you show me how to enable debug logs? Thanks!

@nicoh88
Copy link
Member

nicoh88 commented Jan 20, 2019

Start homebridge with additional parameter -D.

@maisun
Copy link
Author

maisun commented Jan 22, 2019

Hi again, I enabled debug mode now and can see the battery level. It decrease until 77% and seems to lost the connection:

{"log":"[1/22/2019, 12:02:03 PM] [Roborock] DEB changedCharging | roborock.vacuum.s5 | ChargingState false\n","stream":"stdout","time":"2019-01-22T12:02:03.597490682Z"}
{"log":"[1/22/2019, 12:02:03 PM] [Roborock] DEB changedCleaning | roborock.vacuum.s5 | CleaningState true\n","stream":"stdout","time":"2019-01-22T12:02:03.597540158Z"}
{"log":"[1/22/2019, 12:02:03 PM] [Roborock] DEB changedPause | roborock.vacuum.s5 | CleaningState true\n","stream":"stdout","time":"2019-01-22T12:02:03.597559826Z"}
{"log":"[1/22/2019, 12:02:14 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-22T12:02:14.203160863Z"}
{"log":"[1/22/2019, 12:02:14 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-22T12:02:14.203995583Z"}
{"log":"[1/22/2019, 12:02:14 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-22T12:02:14.208369622Z"}
{"log":"[1/22/2019, 12:02:14 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-22T12:02:14.209213138Z"}
{"log":"[1/22/2019, 12:03:12 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-22T12:03:12.735018917Z"}
{"log":"[1/22/2019, 12:03:12 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-22T12:03:12.737957815Z"}
{"log":"[1/22/2019, 12:03:12 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-22T12:03:12.737982211Z"}
{"log":"[1/22/2019, 12:03:12 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-22T12:03:12.738635215Z"}
{"log":"[1/22/2019, 12:04:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 99%\n","stream":"stdout","time":"2019-01-22T12:04:16.574299706Z"}
{"log":"[1/22/2019, 12:06:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 98%\n","stream":"stdout","time":"2019-01-22T12:06:16.574457895Z"}
{"log":"[1/22/2019, 12:08:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 97%\n","stream":"stdout","time":"2019-01-22T12:08:16.578001717Z"}
{"log":"[1/22/2019, 12:10:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 96%\n","stream":"stdout","time":"2019-01-22T12:10:16.578673457Z"}
{"log":"[1/22/2019, 12:12:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 95%\n","stream":"stdout","time":"2019-01-22T12:12:16.578939118Z"}
{"log":"[1/22/2019, 12:14:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 94%\n","stream":"stdout","time":"2019-01-22T12:14:16.583960537Z"}
{"log":"[1/22/2019, 12:16:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 93%\n","stream":"stdout","time":"2019-01-22T12:16:16.594136654Z"}
{"log":"[1/22/2019, 12:18:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 92%\n","stream":"stdout","time":"2019-01-22T12:18:16.586854539Z"}
{"log":"[1/22/2019, 12:20:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 91%\n","stream":"stdout","time":"2019-01-22T12:20:16.590963418Z"}
{"log":"[1/22/2019, 12:22:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 90%\n","stream":"stdout","time":"2019-01-22T12:22:16.609952939Z"}
{"log":"[1/22/2019, 12:24:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 89%\n","stream":"stdout","time":"2019-01-22T12:24:16.703136132Z"}
{"log":"[1/22/2019, 12:26:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 88%\n","stream":"stdout","time":"2019-01-22T12:26:16.645193497Z"}
{"log":"[1/22/2019, 12:28:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 87%\n","stream":"stdout","time":"2019-01-22T12:28:16.606763987Z"}
{"log":"[1/22/2019, 12:30:18 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 86%\n","stream":"stdout","time":"2019-01-22T12:30:18.660911171Z"}
{"log":"[1/22/2019, 12:32:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 85%\n","stream":"stdout","time":"2019-01-22T12:32:16.611980674Z"}
{"log":"[1/22/2019, 12:34:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 84%\n","stream":"stdout","time":"2019-01-22T12:34:16.608945409Z"}
{"log":"[1/22/2019, 12:36:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 83%\n","stream":"stdout","time":"2019-01-22T12:36:16.607347541Z"}
{"log":"[1/22/2019, 12:38:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 82%\n","stream":"stdout","time":"2019-01-22T12:38:16.610085551Z"}
{"log":"[1/22/2019, 12:40:16 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 81%\n","stream":"stdout","time":"2019-01-22T12:40:16.614526073Z"}
{"log":"[1/22/2019, 12:41:46 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 80%\n","stream":"stdout","time":"2019-01-22T12:41:46.628216883Z"}
{"log":"[1/22/2019, 12:43:46 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 79%\n","stream":"stdout","time":"2019-01-22T12:43:46.636420127Z"}
{"log":"[1/22/2019, 12:45:46 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 78%\n","stream":"stdout","time":"2019-01-22T12:45:46.626748535Z"}
{"log":"[1/22/2019, 12:47:46 PM] [Roborock] DEB changedBattery | roborock.vacuum.s5 | BatteryLevel 77%\n","stream":"stdout","time":"2019-01-22T12:47:46.632148818Z"}
{"log":"[1/22/2019, 2:42:15 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-22T14:42:15.492985097Z"}
{"log":"[1/22/2019, 2:42:15 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-22T14:42:15.49590315Z"}
{"log":"[1/22/2019, 2:42:15 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-22T14:42:15.498008647Z"}
{"log":"[1/22/2019, 2:42:15 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-22T14:42:15.500136452Z"}
{"log":"[1/22/2019, 2:46:17 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-22T14:46:17.633950406Z"}
{"log":"[1/22/2019, 2:46:17 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-22T14:46:17.635366839Z"}
{"log":"[1/22/2019, 2:46:17 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-22T14:46:17.636640856Z"}
{"log":"[1/22/2019, 2:46:17 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-22T14:46:17.639005013Z"}
{"log":"[1/22/2019, 2:52:03 PM] [Roborock] INF getPausestate | roborock.vacuum.s5 | Pause possible is true.\n","stream":"stdout","time":"2019-01-22T14:52:03.550963712Z"}
{"log":"[1/22/2019, 2:52:03 PM] [Roborock] INF getSpeed | roborock.vacuum.s5 | Fanspeed is 60%.\n","stream":"stdout","time":"2019-01-22T14:52:03.550979288Z"}
{"log":"[1/22/2019, 2:52:03 PM] [Roborock] INF getCleaning | roborock.vacuum.s5 | Cleaning is true.\n","stream":"stdout","time":"2019-01-22T14:52:03.552986529Z"}
{"log":"[1/22/2019, 2:52:03 PM] [Roborock] INF getDocked | roborock.vacuum.s5 | Robot Docked is false.\n","stream":"stdout","time":"2019-01-22T14:52:03.553011705Z"}

@nicoh88
Copy link
Member

nicoh88 commented Jan 23, 2019

Certainly the weak Wi-Fi signals

@maisun
Copy link
Author

maisun commented Jan 25, 2019

I think so too :( Is there a way to test where does the robot lost the signal?

@maisun
Copy link
Author

maisun commented Jan 26, 2019

Ok tried another plugin "homebridge-xiaomi-mi-robot-vacuum" which doesn't have the issue. Guess it reconnects - I probably have to stay with that.
Thanks for the help!

@nicoh88 nicoh88 closed this as completed Jan 30, 2019
@nicoh88
Copy link
Member

nicoh88 commented Feb 5, 2019

@maisun

Really? I checked his code. Him plugin makes everything similar, like my plugin - no reconnect.

@maisun
Copy link
Author

maisun commented Feb 6, 2019

@maisun

Really? I checked his code. Him plugin makes everything similar, like my plugin - no reconnect.

Hi Nico, I must say that I'm also confused now.
It turned out that his plugin works sometimes but gives the same problem (status is cleaning in HomeKit but the robot has already returned to dock) other times. One slight benefit I get from his plugin is I can always manually switch off the robot from HomeKit. With your plugin, I can't switch off, I have to restart HomeBridge to show the off status.
As you suggested, WIFI can be an issue. I do know there are certain spots in my house with weak signal. But I also noticed that the device simply lost connection while charging with 2 meters distance to the wireless router. Another cause I can think of is miio library - it is shared with other Xiaomi hardware such as light bulbs and aqara gateway, one thing I'd like to try is to create a new HomeBridge instance only for the robot.
I'm not a javascript developer, but know programming a little bit. My question: is it possible to implement re-connect logic? Not sure how miio keeps the connection to the robot, but one way that I can think of is to use heartbeat - for example every minute try to get the battery status, if it fails for more than 5 minutes then reconnect. Could this logic work?

@maisun
Copy link
Author

maisun commented Feb 6, 2019

Just briefly looked into the code:

 getBattery: function(callback) {
    var that = this;
    var log = that.log;

    if(!that.device) {
        log.error('ERR getBattery | No vacuum cleaner is discovered.');
        callback(new Error('ERR getBattery | No vacuum cleaner is discovered.'));
        return;
    }

    log.info('INF getBattery | ' + that.model + ' | Batterylevel is ' + that.battery + '%.')
    callback(null, that.battery);
}

Do I expect the error message 'ERR getBattery | No vacuum cleaner is discovered.' printed out in HomeBridge log file? Looks like it is updated when requested by HomeKit at the moment, could this be called periodically and reset the connection when the error returned? Assume people with bigger space will most likely suffer the same WIFI issues, implement the re-connect machnism could be very useful feature.

@nicoh88
Copy link
Member

nicoh88 commented Feb 6, 2019

Is the message ERR getBattery | No vacuum cleaner is discovered often seen in the Homebridge logfile or just once? If more often, at what time interval?

@maisun
Copy link
Author

maisun commented Feb 6, 2019

Is the message ERR getBattery | No vacuum cleaner is discovered often seen in the Homebridge logfile or just once? If more often, at what time interval?

Searched in the log and couldn't find this error at all. I'm wondering:

  1. If HomeKit tries to pull battery periodically
  2. When the connection is broken, does miio send back the error?

@nicoh88
Copy link
Member

nicoh88 commented Feb 6, 2019

No idea, you said it would be like that.

HomeKit only gets the battery status on request. The message would only appear ... it will not work the way you think.

If you do not get a message in your debug log that the Wi-Fi connection has been torn off, the plugin can not re-establish the connection. In my opinion, it does not get the miIO API. So I can not do anything here.

@maisun
Copy link
Author

maisun commented Feb 6, 2019

work

Ok, understood. Could it be possible to pull the battery state from your plugin every minute? I also started a thread on this in miio project.

@nicoh88
Copy link
Member

nicoh88 commented Feb 6, 2019

Yes do it: https://github.com/aholstenson/miio/

The API communicates any battery level changes, then the message appears - not every minute.

@maisun
Copy link
Author

maisun commented Feb 6, 2019

Thanks!
Already did: aholstenson/miio#221
Sorry I thought the battery status is pulled from miio so assumed you can triggered from the plugin.
I looked into the implementation for vacuum cleaner in miio:
https://github.com/aholstenson/miio/blob/master/lib/devices/vacuum.js
I don't see any error handling there. I'm thinking what will happen if we call the method "getHistory" periodically. It won't do anything to the device and may print out some error

/**
 * Get information about the cleaning history of the device. Contains
 * information about the number of times it has been started and
 * the days it has been run.
 */
getHistory() {
	return this.call('get_clean_summary')
		.then(result => {
			return {
				count: result[2],
				days: result[3].map(ts => new Date(ts * 1000))
			};
		});
}

@nicoh88
Copy link
Member

nicoh88 commented Feb 6, 2019

Fork it, code it, test it and make a pull request.

@maisun
Copy link
Author

maisun commented Feb 6, 2019

Fork it, code it, test it and make a pull request.

Would like to try but not really familiar with javascript ecosystem so will take some time. Will write back when I manage this. Thanks for the help!

@nicoh88
Copy link
Member

nicoh88 commented Feb 6, 2019

I feel the same as you. I am it administrator, not a programmer. I can write simple batch, powershell, and bash scripts. It is my first javascript plugin. Much try and error, step by step, it takes a long time, but it works. :-D

@maisun
Copy link
Author

maisun commented Feb 7, 2019

I like that :-) which editor/ide do you use?

@nicoh88
Copy link
Member

nicoh88 commented Feb 7, 2019

I use Sublime Text on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants