bwp91 / homebridge-deebot

Homebridge plugin to integrate ECOVACS Deebot devices into HomeKit.
MIT License
64 stars 4 forks source link

Expose each area and predefined areas as switches instead of an Eve characteristic #140

Open barros001 opened 1 year ago

barros001 commented 1 year ago

When new predefined areas are configured, a new characteristic/control is added so that one can request the robot to work on that predefined area. I see a couple of issues with that

  1. This control is only visible using the Eve app. I understand you can create scenes but this is not ideal in my opinion.
  2. You don't really have control to pick and choose any combination of areas unless you pre-configure them.

Ideally, a user would be able to select any area, or combination of areas and tell the robot to go clean them, without the need for another app to set it up and without the need to pre-configure all possible combinations (which is not feasible).

Example: Something happened and I need to send my robot to clean my hallway and guest bathroom. Right now, unless I have a predefined area configured for the this specific combination, I cannot use Home or even Eve to send my robot to do the job. I'd have to open up the Ecovacs app. With the suggested changes, I could open Home app, "turn on" Guest Bathroom and Hallway and then tell it to go clean.

This is an improvement suggestion rather than a problem.

No

I ended up spending a few hours working on a fork that implements what I'm suggesting. Here's what it does:

  1. It adds a new configuration setting that allows users to ask the plugin to expose all areas defined on the map as a switch
  2. It exposes all configured pre-defined areas as switches as well
  3. When an area switch is turned on, it does NOT tell the robot to go clean, rather, it keeps track of selected areas. One can select multiple areas and predefined areas as long as they are all SPOT areas. Custom coordinate areas can only be selected by itself (it turns off all other switches)
  4. When the robot is asked to clean, the plugin will check if any area is selected, and if so, it will tell the robot to clean the selected areas. If you select multiple areas, it will build an array of all unique area ids and tell the robot to go clean those areas.

The work I've done is more of a proof of concept and is not really polished. Here's a link for a PR on my own fork. A few comments:

  1. I could not figure out how to properly sort the switches. Clean is always first, but Go Charge gets lost somewhere in the middle and all other switches are somewhat random.
  2. When new switches are added after the initial accessory is setup, the custom names are not set for some reason (example, turn off the option to create switches for zones, restart, turn it on and restart again. New switches will not have custom names).
  3. For me, I have 13 areas, and it gets a bit messy with all these switches. Not sure what can be done about it, maybe a new device to group only the area selection switches?
  4. The option to have switches vs an Eve control could be configurable