What capability to use for a Roomba driver?

I'm looking at the driver capability list, and while I'll be the first to admit it's an impressive collection, the one item I don't see a match for is my Roomba.

I've currently got it to the point where I can do simple control of it using dorita980

and rest980:

working together under Node.js. That works just fine, I can get the Roomba to go and clean, or return to the dock by simply calling an http:// endpoint provided by Node.js. Extending that to make the calls from Hubitat should be trivial, but then we get to the problem.

There currently isn't a "capability.vacuumcleaner" and nothing else jumps out at me as being an obvious choice.

I can possibly use "capability.testCapability" to get a driver up and running, but that's not a viable permanent solution. What is the best course of action in a case like this?

You don't have to use any of the built-in capabilities if you don't want to. You can just declare custom commands and attributes.

But at least including capability Actuator is useful because then you can select the device in RM and use it to execute your custom commands.


I don't know exactly what you are trying to support in your driver, but sometimes I will map commands from built-in capability types to something relevant to the device.

For example, maybe you could support capability Switch and have the on() and off() commands start and stop the cleaning cycle.

2 Likes

That's useful to know. I'll start with Actuator since it allows sending commands via RM, something I consider essential for anything attached to a Hubitat.

And yes, the general idea is to map the commands exposed by the Node.js bridge to commands in the driver. To begin with, just the very simple "Start" and "Dock" i.e. stop cleaning and return home to recharge and empty the onboard dustbin.

Those will be enough to get the system working, because I can then write a couple of RM rules that will start t cleaning at a particular time of day, and then stop after a while to go back home.

Later will come working with mapping commands, I currently have it running round mapping the house, and Imay be able to divide the house up into rooms, or more likely sections, and so I can tell it "Go clean the front of the house", or "Go clean the back of the house".

1 Like

I did an integration for Tesla vehicles, so I've been down the road of "what is this device?" My suggestion would be to stop looking for a capability and instead think about all the capabilities that comprise the device.

  • You can start and stop its actions -- that's a switch.
  • It has active and inactive states -- that's a motion sensor.
  • It is or isn't at its base station -- that's a presence sensor (or power source; see below)
  • It is or isn't in any particular room of the house at any given moment -- that might be a collection of child presence sensors, if it's room-aware.
  • It has a battery that needs to recharge periodically -- that's a battery level and a power source.

It's not one device type, it's a bundle of them in a single package.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.