[RELEASE] Rumba for Roomba

The device handlers for Roomba haven’t been updated in a long time and none of them work with the new app.

I’m here today to fix that. This device handler is a modified version of the original device handler from this thread from 2016
https://community.smartthings.com/t/roomba-980-wifi-connectivity-reverse-engineering/44860/201

First, I want to think the original authors and contributors
Steve-Gregory, Adrian Caramaliu, Justin Dybedahl

You can find my DTH here:
https://github.com/Matvei27/Rumba/blob/master/rumba.groovy

Setup: setup is the same as it was before. You can use either the cloud or the local API. For more information see the original thread.

Compatibility: 900/i/s series, and probably Braava (only WiFi models).

Version history:
1.5: Fixed healthcheck, additional tweaks to state logic
1.0: Initial release

New features:

  1. Rewrote app to use standard capability robotCleanerMovment for state display and buttons.
  2. Because this capability is proposed and doesn’t yet support automations, I’ve used the switch capability, which also displays on the dashboard view

Roadmap:
We will try to add the following features

  1. Set cleaningPasses (one, two, auto)
  2. Set carpetBoost (auto, performance, eco)
  3. Set edgeClean (on, off)
  4. Set alwaysFinish (on, off)

However, although I figured out finally how to make custom capabilities in ST, there are some unresolved problems with the Roomba API, so I may only be able to implement #3 and #4.

Screenshots:

Screenshot_20201015-034611_SmartThings

5 Likes

I wish there was an integration for roborock as well

it seems that there is an unofficial API for it, you could build an integration for it, but I don’t have one.

Not a developer to be honest. Maybe i will try to clone some of your code if that’s alright.

Nice Work, just installed and giving it a test run (running locally). robotCleanerMovment UI is a surprise, more aesthetically pleasing than I expected, IMHO.

I will be interested to see the push notifications for errors.

Any thoughts on adding custom capabilities like consumable status so that it is visible in the new app? Bin full should present an error message but the classic UI also displayed run stats too. Not sure if the time and effort to create the custom capabilities is worth it, just posing the question.


Interesting observation: I received a low battery error from the iRobot App but nothing from ST. After review, the last successful API call reported 13% battery, since that call, no response from the API. Apparently Roomba shuts off Wifi at a certain point so status is unknown, ST still thinks it is cleaning. Wondering if we can build in a timeout feature, no response in x min, roomba_value = error, not sure if that's possible.

Bin full will show a status ‘reserve’ on the ui and an error will show ‘alarm’

Yes, I will add a timeout feature if possible.

1 Like

If you want to test the push notifications, try starting a cleaning, and then place the roomba upside down.

Let me know if it works for you.

I have some bug fixes coming soon:

  1. Change bin-full response from reserve to alarm, because the reserve text for robotCleanerMovement has changed to indicate scheduling, which this doesn’t support outside of the built in automations. Unfortunately this means that all errors, including bin full will just show “error” in the UI. Please enable push notifications if you want to know the specific error code. At some point I may build a custom capability text field for bin status or for the error code, but not this minute.

  2. Bug fix for when API is not responding i.e. Roomba is offline or wifi is disabled, this will return robotCleanerMovement(powerOff) which will show “off” in the UI display so you know its offline

Explanation of movement modes from the UI:
Idle: paused
Cleaning: cleaning
Power off: offline
Error: some kind of error including bin full
Docking: returning to dock
Charging: currently charging

@mvevitsis Can i have a link to the roborock unofficial api please?

Please make a separate thread for roborock as I don’t plan to make a dth for them.

Thank you @mvevitsis

That sounds great.

Noticing some oddities on my end, concerned that it is due to my use of the local API.

While cleaning, I see this:


Cleaning and Charging at the same time?

After about 30mins of cleaning, I received a wheel stuck notification from the iRobot App; nothing from ST. Double checked and preference is set to send notifications. All device notifications allowed in ST settings. Any ideas?

The button says charging always. If you are actually charging the area where it says cleaning (the status area) will say charging instead. The text on the button never changes, this is the correct behavior.

Can you please try starting a cleaning and then flipping the robot upside down so it is stuck and see if that triggers a notification

Intereating…Wonder what maps to that? Anyway, I will try this afternoon. Roomba was running on a schedule earlier, will try the flip when I get home.

The button is supposed to say ‘charge’ probably, it’s just weird english.

You can’t change the text, the button sends the command setRobotCleanerMovement(charging)

Where charging is the mode.

So don’t worry about it, that’s working as designed.

I am going to change the logic though so the status says returning to dock until it actually reaches the dock, then it will poll again and confirm it reached the dock before it displays charging in the status field.

Currently, if you press the charging button, the status will change to charging immediately, even before it reaches the dock.

@fieldsjm were you able to get push notifications to work?
If they do not work, it means that SmartThings is not allowing me to sendPush from a DTH like I can from a SmartApp.

No alerts. I do see error state in the UI. For what its worth, I have 2 different models (960 and 890), both work with the handler but neither send alerts. (Wanted to make sure it wasnt a firmware issue).

That is my assumption.

In this case I would have to design a custom capability to display the error message but it’s low on my list of priorities. First I have to figure out what to do about the device going offline.

@fieldsjm

I have a new version on the GitHub (version 1.1) where I attempted to implement a healthcheck. If there is no hub response it should show the device as offline. Try it and let me know if it works for you.

The interval for the health check is twice the set polling interval. So please wait a bit after the device has gone offline to see if it marks it offline in ST.

Getting errors in IDE, I created a new device as I’m always having cache issues. After inputting my preferences, I get this:

b9d4c355-e458-4e19-8ace-0dc5beb10661 9:46:22 AM: error grails.validation.ValidationException: Validation Error(s) occurred during save():
- Field error in object 'physicalgraph.device.Device' on field 'deviceNetworkId': rejected value [C0A801E5:0BB8]; codes [physicalgraph.device.Device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique.error,device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.error.deviceNetworkId,device.deviceNetworkId.unique.error.java.lang.String,device.deviceNetworkId.unique.error,physicalgraph.device.Device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique,device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.deviceNetworkId,device.deviceNetworkId.unique.java.lang.String,device.deviceNetworkId.unique,unique.physicalgraph.device.Device.deviceNetworkId,unique.deviceNetworkId,unique.java.lang.String,unique]; arguments [deviceNetworkId,class physicalgraph.device.Device,C0A801E5:0BB8]; default message [{0} must be unique]
b9d4c355-e458-4e19-8ace-0dc5beb10661 9:46:22 AM: debug Executing 'updateDeviceNetworkID'
b9d4c355-e458-4e19-8ace-0dc5beb10661 9:46:18 AM: error physicalgraph.scheduling.CronExpressionException: Invalid cron expression found '0 0/null * * * ?' @line 182 (updated)