homebridge-xiaomi-roborock-vacuum icon indicating copy to clipboard operation
homebridge-xiaomi-roborock-vacuum copied to clipboard

One zone activated, all zones active.

Open desq42 opened this issue 6 years ago • 11 comments

…would it be possible to show the actual zone which has been activated? If I "switch on" zone A, the Home-App shows all zones (A, B, C, D). (as shown here in homebridge) bildschirmfoto 2019-02-13 um 11 12 03

desq42 avatar Feb 13 '19 10:02 desq42

I know I know. Guess I should put in the readme. I'll look into it, I always use my voice so it never bothered me.

Smileydude avatar Feb 13 '19 10:02 Smileydude

no huge issue, but if I schedule a cleaning I would like to know where the vaccum is working at the moment, when I peek into the HomeApp.

desq42 avatar Feb 13 '19 10:02 desq42

It is because you created multiple instances for the device, all listen to "cleaning: true/false" message. I'm looking into the code and trying to see if I can do zone clean with one device. I believe the only way to do it is to maintain the zone clean state in code.

maisun avatar Feb 13 '19 10:02 maisun

ya you just need to store the name of the zone being cleaned and compare it to find the status of each zone. But then you run into issues with what if you start to clean another zone, it will think it can so it needs to check the true and false value still. It would ideally mark them as disabled or something I guess

Smileydude avatar Feb 13 '19 10:02 Smileydude

ya you just need to store the name of the zone being cleaned and compare it to find the status of each zone. But then you run into issues with what if you start to clean another zone, it will think it can so it needs to check the true and false value still.

Guess this would work:

  1. When zone clean is instructed, record the name of the zone to var cleaningZone.
  2. Keep getting state update, if the cleaningZone exist, only update the switch for that zone.
  3. When receiving command to turn on clean for other zones, check if the vaccum is cleaning, if yes then do nothing (or disallow the action, not sure how to)
  4. When the fan for the cleaningZone is turned off, go back to charge and reset cleaningZone to undefined One thing I need to know more about is the "stateChanged" message, right now it only tells me if the device is cleaning or not. But I know in the "state" object you can also see if the device is doing zone cleaning, is there a way to listen to that instead?

maisun avatar Feb 13 '19 11:02 maisun

Well I don't have access to a house to test this (on a long trip, could be a while before I have a house) so I made a beta npm repository if anyone wants to be my test dummy https://www.npmjs.com/package/homebridge-xiaomi-roborock-vacuum-zones-beta

Smileydude avatar Feb 22 '19 07:02 Smileydude

Hi,

I tried your Beta-Branch, but my Homebridge-Instance crashed instanly. "Module not registered, or something likely...".

Bummer.

desq42 avatar Apr 13 '19 07:04 desq42

Sorry about that, I'll have a space to test my vacuum soon. Will try and debug it myself then :)

Smileydude avatar Apr 13 '19 15:04 Smileydude

Hi, Any news of the beta to show the actual zone that is cleaning? Looks great to me as well (-:

Sent with GitHawk

cobch avatar May 08 '19 08:05 cobch

Sorry been absolutely hectic last few months. I won't be able to support this for at least the next few months as I am living the #vanlife and the vacuum won't fit :) If anyone wants to give it a shot I'm more then happy to approve PR's and publish new packages.

Smileydude avatar Jun 19 '19 17:06 Smileydude

Tested out the zone-tracking branch on S5 with 3.5.7 FW. There's two bugs in the branch.

  1. miio-setCurrentSpeed needs to be this.setCurrentSpeed, otherwise it throws exceptions.
  2. when the vacuum is cleaning, turning the fan speed to zero, pauses the vacuum rather than return to dock.

github9984 avatar Mar 27 '20 14:03 github9984