iRobot 9xx on openHAB

Thnx for the feedback

Grtz

Does anyone know the state of this Roomba OpenHAB binding?

Been years since this github repo had update and hope its not totally abandoned… In any case I have the basics working with the Dorita REST API:

Thanks ALL!

1 Like

Here is my corrected items definition which uses the latest and greatest Dorita / REST API version/responses:

Number roombaBattery 		"Roomba Battery [%d %%]" 				<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.batPct)]" }
Number roombaBatteryTime	"Roomba Battery Time [%.0f min]"		<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.cleanMissionStatus.expireM)]" }
Number roombaRechargeTime	"Roomba Recharge Time [%.0f min]"		<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.cleanMissionStatus.rechrgM)]" }
Number roombaError			"Roomba Error [%d]"						<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.cleanMissionStatus.error)]" }
String roombaInitiator 		"Roomba Initiator [%s]" 				<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.cleanMissionStatus.initiator)]" }
String roombaCycle 			"Roomba Cycle [%s]" 					<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.cleanMissionStatus.cycle)]" }
String roombaPhase 			"Roomba Phase [%s]" 					<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.cleanMissionStatus.phase)]" }
Number roombaCoverage		"Roomba Mission Coverage [%.0f sq ft]" 	<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.cleanMissionStatus.sqft)]" }
Number roombaTime 			"Roomba Mission Time [%.0f min]"	 	<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.cleanMissionStatus.mssnM)]" }
Contact roombaBinPresent 	"Roomba Bin Present [%s]" 				<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.bin.preset)]" }
Contact roombaBinFull 		"Roomba Bin Full [%s]" 					<roomba>  { http="<[http://API_IP:API_PORT/api/local/info/mission:60000:JSONPATH($.bin.full)]" }

Switch roombaMission		"Roomba Start" 							<roomba>  { http=">[ON:GET:http://API_IP:API_PORT/api/local/action/start] >[OFF:GET:http://API_IP:API_PORT/api/local/action/stop]" }
Switch roombaPause			"Roomba Pause" 							<roomba>  { http=">[ON:GET:http://API_IP:API_PORT/api/local/action/pause] >[OFF:GET:http://API_IP:API_PORT/api/local/action/resume]" }
Switch roombaDock 			"Roomba Dock"							<roomba>  { http=">[CHANGED:GET:http://API_IP:API_PORT/api/local/action/dock]" }
3 Likes

Awesome! With a little effort I managed to get the following rule working. Basically I have OpenHAB2 connected to my Roomba 980 (Dorita REST interface), Asterisk PBX and numerous Amazon Echo’s via my Alexa-HA project. The intent was to have voice control over the house vacuum, including automatically turning on all the lights and fans/air purifiers whenever house cleaning is underway and have it automatically pause/resume when an active phone call starts/completes. Here is how I pulled it off. The ‘roombaActive’ item is just a basic virtual Switch that toggles other items throughout the house as needed:

rule "Start house cleaning job"
when
	Item roombaActive received command ON
then
	// Set light levels and turn all lights on 
    sendCommand(Light_Group_Color_All, "80,80,80")
    sendCommand(Light_Group_Switch_All, ON)
    
    // Turn on all the fans
    sendCommand(GF_Fans,ON)
    
    // Start Roomba cleaning mission
    sendCommand(roombaMission,ON)
    roombaDock.postUpdate(OFF)
    
    // Announce
	say("Cleaning your house, sir...")
end

rule "Stop cleaning the house"
when
	Item roombaActive received command OFF
then
	// Turn off all lights
    sendCommand(Light_Group_Switch_All, OFF)
    
    // Turn off all fans
    sendCommand(GF_Fans,OFF)
    
    // Cancel Roomba cleaning mission
    sendCommand(roombaMission,OFF)
    
    // Return Roomba to its dock
    sendCommand(roombaDock,ON)
    
    // Announce
	say("Canceling cleaning job, sorry for the disturbance, sir...")
end

rule "Pause cleaning the house during active phone call"
	when
		Item Incoming_Call received update
	then
	    if (Incoming_Call.state == ON && roombaMission.state == ON && roombaActive.state == ON) {
    		// Turn off all fans
    		sendCommand(GF_Fans,OFF)
    		
    		// Pause Roomba cleaning mission
    		sendCommand(roombaPause,ON)
    	}
    	if (Incoming_Call.state == OFF && roombaPause.state == ON && roombaActive.state == ON) {
    		// Turn on all fans
    		sendCommand(GF_Fans,ON)
 
    		// Resume Roomba cleaning mission
    		sendCommand(roombaPause,OFF)
    	}
end
4 Likes

Here is an additional rule which monitors the roombaPhase and keeps other Roomba states correctly set. Without this, if the Roomba cleaning job was started manually (i.e. the clean button on the vacuum) then my active phone call rule would not trigger…

rule "Update various Roomba switches based on roombaPhase state"
	when
		Item roombaPhase received update
	then
	    if (roombaPhase == 'run') {
    		roombaActive.postUpdate(ON)
    		roombaDock.postUpdate(OFF)
    	}
	    if (roombaPhase == 'charge') {
    		roombaDock.postUpdate(ON)
    	}
    	if (roombaPhase == 'none') {
    		roombaActive.postUpdate(OFF)
    		roombaDock.postUpdate(ON)
    		roombaPause.postUpdate(OFF)
    	}
end
2 Likes

Can anyone share some examples of how to set (i.e. POST) config options to the Roomba via an OpenHAB item? I would like to be able to control more low level settings like ‘cleaning passes’ and ‘edge clean’ via the OpenHAB UI…

If anyone is interested I have posted my python program for controlling a Roomba 980 here: Python Roomba 980

This includes my Openhab set up, ie items, rules, sitemaps, icons, transforms etc. It uses the mqtt binding to get/send things from/to the Roomba.

This supports control of all Roomba features, plus live maps, notifications etc. etc.

Here are some screen shots:
iPad:


iPhone:



6 Likes

Are Roomba 960 and 980 both integratabtle with OpenHAB? I’m considering buying either of these two robotic vacuums. In the battle of Roomba 960 vs 980, I’d prefer the 980 model but I really need to know if it works with OpenHAB.

That looks really impressive!
Maybe I should go for a roomba as well. :slight_smile:

Not all of us are programers or have a lot of experience in python and linux… Is there any way this could be done as a binding? It would help lots of people here.

Thanks

2 Likes

Now that also the Roomba 960 and the 895 support the app control - can anyone tell me if it is compatible with the Dorita Api?

Simple solution:
IRobot has IFTTT support. Works like a charm.

Create an item e.g. Switch irobot_clean
Expose the item to openhabcloud
Create a free IFTTT account
Link openhab to IFTTT
Link your iRobot account to IFTTT
Create an app
If irobot_clean receives update ON THEN start iRobot

Done. Enjoy

Love it. Was a piece of cake without programming or hacking.

2 Likes

Thank you for sharing

maybe you can help

i have Created a free IFTTT account
i have Linked my iRobot account to IFTTT but i am getting all the time options Unavailable

Yes I think I can.
When you search at iRobot you find that there are a few mandatory steps needed and if I remember correctly, it also says you need to log in via your iRobot HOME app at least once into the cloud after the IFTTT feature has been activated. That was also a culprit on my end. I ended up deleting the irobot home app from my iphone and installed it again. I also reset my robot. Maybe there is a log-out feature somewhere but haven‘t found it yet.

But I think deleting the app from your iphone/ipad and then installing and log-in with your account should do the trick. Let me know if you succeed.

Regards,
SJ

1 Like

limited to some countries … answer from Irobot customer service below

I don’t believe that you cannot set this up and would try to change the language on the IOS-device to EN as well as the robot language, do a reset and then install the app again. Don’t think that iRobot will sell different hardware all over the world except power supply.
And as last option you could potentially change your location in your iRobot profile if they put in a check there.
Good luck.
SJ

Thanks

Happy New year

I have removed the iRobot from the application and reinstall the Android application and setup the iRobot on English

It’s not necessary to login to an account in the application.

I have also updated my profile to England

It didn’t help:frowning:

Happy New Year to you too!

I guess the issue is the missing log in into the cloud via app. That was what solved my issue when I set it up. Maybe it is cashed somewhere. You could try a 2nd device and make a fresh install with the app and try then. Besides this, I am out of ideas.

1 Like

Hi

the missing log ? what do you mean ?

it’s documented https://homesupport.irobot.com/app/answers/detail/a_id/880/session/L2F2LzEvdGltZS8xNTE0OTI4NzEyL3NpZC9QNWNqWE1Cbg%3D%3D

G

I mean the log-in into their cloud. It only works if you log in at least once into their cloud. If you cannot log in via your smartphone-app then it does not work. How should their clould recognize your robot?
If you go to IFTTT and configure iRobot-connection it states that you need to log-in at least once.
That was what I experienced, then deleted the app as I could not find a log-in /log-out feature and reconfigured everything. Afterwards it worked. Maybe it is different on Android.
Sorry.