[RELEASE] Rumba for Roomba

I am not sure if I an installing this correctly. I copied the code from the Github link and created a DTH and a device using the DTH in smarthings, then I put in the blid and password. However the device is unresponsive to any commands and shows battery as 0.

You need to run a node js server on your computer, I am not certain that the cloud api works even though the code is still present.
For that, read through the original thread linked in the first post.
I will try and also make a new setup guide to post in this thread.

I got the REST gateway running, then I Deleted the Rumba device and readded it. The device was showing connected in the SmartThings app but with 0 battery. I hit the on button and the roomba started cleaning, but then the SmartThings app shows it was offline and I could not get it back online.

It seems this is related to the health check issue.

Try commenting out the capability health check by adding two forward slashes.
Like this
//capability ‘Health Check’
and let me know if that fixes it for you.

It did not work. I was able to repeat what I did before. I deleted the device, the added it again and it showed online. I hit start and it starts cleaning but goes offline in the SmartThings app.

I’ve uploaded a hot fix to the github which removes health check related functionality until ST provides more insight on this capability.

Try downloading the DTH again.

@nayelyz still need help getting this to work correctly with health check

@nayelyz

Please enlighten me as to why this device is getting stuck offline.

It has to do with the hubResponse always returning null. Not sure why it is null as there is obviously data.

Came across this old thread but might be applicable. Schedule a timeout when polling that ultimately sends offline, unschedule the timeout if the hubaction is successfull and send online.

I’ll ask in that thread to see if they can post an example I can integrate into the DTH.

@mvevitsis, What is the result of the parsing method of the hub response to the sendHubCommand?

When the device is truely offline (node server down or robot disconnected from wifi) then there is no result, simply times out.

Here is what I came up with using the logic found here

I built in a scheduled timeout into the poll action. After two polls the timeout will send the offline event. If I get a successful response, the timeout is unscheduled and an online event is sent. Horrible work around but seems to be working.

private local_poll() {
	local_get('/api/local/config/preferences', 'local_poll_cbk')
    runIn(30,timeout)
}

def connected() {
	log.debug "Server is Online"
	sendEvent(name: "DeviceWatch-DeviceStatus", value: "online")
    state.timeout = 0
    unschedule(timeout)
}

def timeout() {
	if (state.timeout == 1){
    	log.error "Check server, not responding - Second Attempt"
    	sendEvent(name: "DeviceWatch-DeviceStatus", value: "offline")
        } else if (state.timeout == 0) {
    		log.error "Check server, not responding - First Attempt"
            state.timeout = 1
            }
}

connected is called in the callback based on http result status

private local_poll_cbk(physicalgraph.device.HubResponse hubResponse) {
    def status = hubResponse.status
    //log.debug "http status: ${status}"
    if(status == 200){
    	connected()
        }
    def data = hubResponse.json

@fieldsjm I’ve added your code to the main branch hosted on the GitHub. Thanks for troubleshooting this (and even writing the solution for me).
Now that this is resolved I’m going to move on to adding custom capabilities to get back some lost functionality (like displaying bin status).

Version 1.7 has been released to my GitHub with a separate bin status capability. Now it is easier to distinguish between errors (such as stuck) and the bin being full. Bin status can also be used in automations on the if side e.g. to send an alert.

The next release will add a toggle for “always finish” which will allow you to decide what the robot does when the bin is full.
I can also add a toggle for ‘edge clean’
but it is not possible to get the current state of the carpet boost or # of cleaning passes, so I can’t build a capability or it would go out of sync with the irobot app.

@fieldsjm

Nice work, updated. ‘Always finish’ would be useful. The others are nice feature but not a necessity.

Hi, great work on this DTH. I got my Roomba 676 up and running with it today using the REST gateway.

One small note, i’m getting an error when trying to dock my Roomba. I’ve tracked it down to the pause(1000) in this method:

private local_pauseAndDock() {
	local_get('/api/local/action/pause', 'local_dummy_cbk')
    pause(1000)
	local_get('/api/local/action/dock', 'local_dummy_cbk')
}

From the logs

[40e1e3fb-0653-4058-986a-daa6d46d18f5](https://graph-eu01-    euwest1.api.smartthings.com/ide/logs#40e1e3fb-0653-4058-986a-daa6d46d18f5) 16:23:45: error groovy.lang.MissingMethodException: No signature of method: script_dth_78f427ca34359ad598e642a77be4f366af2e06ab0baab6b0d524268845275f58.pause() is applicable for argument types: (java.lang.Integer) values: [1000]
    Possible solutions: pause(), pages(), parse(java.lang.Object), page(), pages(groovy.lang.Closure), page(java.util.Map) @line 1042 (local_pauseAndDock)

Changing it to just pause() seems to have fixed it fo me. From GIT, it looks like that line may have been added/changed later than the rest (it has different indentation) so I’m not sure if that is meant to be there?

1 Like

Thanks for tracking down the error, I will edit the repo to fix this issue. No, it’s been there since the beginning. I’ve changed the original DTH to fix most of the errors with the new app, but I guess I missed that one.

1 Like

@mvevitsis

Just want to say many thanks for updating this DTH, it looks like it has many useful features if I can get in running. I think I have understood the key aspects of the setup but I must be missing something…

So I have:

  1. Installed node.js, dorita980, rest980 on windows
  2. Got blid/pass for Roomba S9 & Braava M6 successfully
  3. Tested an index.js and kicked off a Roomba clean successfully (just as a test)
  4. Configured rest980
  5. Installed DTH and published (with no mods to code)
  6. Add device manually via IDE (and put my Roomba IP address in device ID, not sure what I needed to put in here as it was “required”…?)
  7. I can see the device in my SmartThings, REST implemented, added details to device settings but it is not updating status (Roomba is “off”, Battery is “0%”) - but when I pressed charging button, it did “empty bin and dock”, even though it was docked.

What am I missing?
Any help to get this fully configured and integrated into ST with status would be much appreciated.

The job after that is to get the Braava controlled in the same way, I assume I will need another instance of REST980 running with the Braava config.

Thanks.
SD24

On the device settings, you need to input the ip address of the server running node js, not the robot.
You also need to select to use dorita/rest980 and not the cloud api (which I think is broken).

I don’t put any effort into fixing the cloud api because it doesn’t support all of the features and because it will break every time irobot changes something in the app.

Lastly, this DTH requires a SmartThings hub. The hub sends the LAN commands to the server even if you are not at home.

@mvevitsis
Thanks, I am not using cloud and I have a ST hub.

On the device settings in smartthings app, I have enabled local rest gateway and put in details of the server (192.168.1.93).
I have not run anything else on node js except rest980 (via npm start).
Is this what I’m supposed to configure and does this settings and device status page look correct?

I will do further testing tomorrow and will let you know if I have had any success.

That looks correct. Make sure the ip address is static (reserved) and make sure that port is not being used by anything else.