iRobot 9xx on openHAB

I’ve just added the binding above after the original binding stopped controlling my Roomba. Whilst trying to get it working I installed jsonpath 2.5.0.

I can now control the robot although I get this in the log several times after a reboot. What have I missed?

 Error while starting bundle: file:/usr/share/openhab/addons/json-path-2.5.0.jar
 org.osgi.framework.BundleException: Could not resolve module: com.jayway.jsonpath.json-path [237]
 Unresolved requirement: Import-Package: org.json; resolution:="optional"
 Unresolved requirement: Import-Package: org.apache.tapestry5.json; resolution:="optional"
 Unresolved requirement: Import-Package: org.codehaus.jettison.json; version="[1.4.0,2.0.0)"; resolution:="optional"
 Unresolved requirement: Import-Package: net.minidev.json; version="[2.3.0,3.0.0)"

at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:440) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.8]

Hi!
I just started to work or play around with OH3.
I managed to install the official binding for irobot and can see status and last command, but if I try to send a command nothing happens. Not sure if I do something wrong. I just added the Command Item and I try to send “dock” selecting the command in the item overview. Is this correct or am I totaly wrong that it should work like this. I have an i7+.
Thanks for helping me.

Just solved my own problem, at some stage whilst trying to get this to go I’d ended up with json-path-2.5.0.jar in my addons folder. Deleting it has made the problem go away

I’ve just had to ditch the original iRobot binding for the binding in this thread because I couldn’t control my Roomba 980. It had been working happily for months and still seemed to get status updates. I’d suggest copying its password before you do anything as my roomba didn’t seem keen to give it up again.

Not sure what I’m doing wrong.
I added the .jar file to the addon folder but I cannot see anything in openhab.

I’m using the official iRobot binding and I always get

Status: 
OFFLINE COMMUNICATION_ERROR 
Timeout

straight after

ONLINE
CONFIGURATION_PENDING
Robot authentication is successful

In openhab.log I see

2021-08-29 23:56:45.787 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.0.XX' with clientid XXXXXXXXXXXXXXX
2021-08-29 23:56:46.388 [WARN ] [rnal.handler.IRobotConnectionHandler] - MQTT connection failed: Timeout

should I switch to the unofficial binding in this thread?

I’ve switched to controlling the Roomba via IFTTT. Poor integration, but it works.

I have running the Irobot binding and works perfect. I was trying to switch the lights on when the iRobot is cleaning i.e. the livingroom.
When I check the channel LastCommand, I see something like this:

'iRobotRoomba_LastCommand' changed from {"command":"start","initiator":"rmtApp","time":1637676124,"ordered":1,"pmap_id":"1234567890","regions":[{"region_id":"3","type":"rid"},{"region_id":"9","type":"rid"}],"user_pmapv_id":"123456789890","favorite_id":"1234566789","robot_id":"XXXXXXXXXXXXXXXX","select_all":false} to {"command":"pause","initiator":"rmtApp","time":1637676263,"ordered":null,"pmap_id":null,"regions":null,"user_pmapv_id":null,"favorite_id":null,"robot_id":null,"select_all":null}

When I do a check on the complete comand, the timestamp is included. Can I use a wildcard there to skip the timestamp?
Or can I test for just these 2 parts in this command:

"command":"start"
"regions":[{"region_id":"3","type":"rid"}]

When I see just the “command”:“start” and the region part, Then I can switch the lights in these rooms.

Anyone knows how to do this?

You might want to have a look at JsonPath transformation, specifically the rules section.

In your rule you would have a comparison like

val RoombaStartCommand = transform("JSONPATH", "$.command", iRobotRoomba_LastCommand.state.toString)
val RoombaregionIDnumber = transform("JSONPATH", "$.regions.length()", iRobotRoomba_LastCommand.state.toString)
var Roombaregion = null

var i = 0
while (i < RoombaregionIDnumber) {
	var RoombaregionID = transform("JSONPATH", "$.regions.[" + i + "].region_id", iRobotRoomba_LastCommand.state.toString)
	if (RoombaregionID == "3") {
		Roombaregion = RoombaregionID
	}
}
if (RoombaStartCommand == "start" && Roombaregion == "3") {
	turn lights on
}

Just throwing something in here, success not guaranteed.

Thank you for your reply @Chiuaua79 , I was trying to put it in a rule and this is the error message:

Script execution of rule with UID 'KNX-6' failed: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.IntegerExtensions.operator_lessThan(int,byte) on instance: null in KNX

RoombaregionIDnumber is a string, and we compare that in the while loop with an int… Is that the problem?

Edit: When I use the Json online validator, I see that $.regions.length() is returning 2, which is correct.
But when I print a log of i.e. RoombaStartCommand, I get the whole JSON string as a result.
What is going wrong?

And do we need to ++ the i in the while loop?

I suppose you need

i = i + 1

somewhere in the while {action}.

You do have the JSONPATH transformation plugin installed? It looks like your string is not being transformed.

The failure is indeed suggesting it fails comparing int with a byte (the i value with RoombaregionIDnumber). They both need to be of the same type and may be RoombaregionIDnumber needs to be converted to int first. You can temporary insert some additional log lines in the rule to see what the outputs for every val or var are and how far the rule runs.

I found the problem, The JSONPATH plugin was not installed. Now it seems to work. Thank you.

Happy new year everyone,

it’s a long time ago, i posted last time here… Meanwhile, dorita980 describes, how iRobot cloud can be accessed. The stuff is quite straight forward, that i implemented a bridge for binding. Bridge configuration needs iRobot cloud login data only. As usual, the code can be found on my openhab fork and prebuilt plugin in my binary repository.

Greetings,

Alexander

3 Likes

Hello @falkena

I‘m using official openhab 3.2.0 release with official irobot binding.
There is no map datapoint, is that correct? I can remember using your fork long time ago there was such a datapoint. Is this fork not back in official binding from openhab 3.2.0?

Regards

Hi guys! Occasionally checking out my old threads…
So, the official binding (which i started and submitted) indeed doesn’t support map. This because there’s no such thing as a “map data point”. The robot, while moving, reports X, Y coordinates and directional angle. So, the map needs to be built. For this purpose, while the robot is running, the binding needs to collect those reports and store them somewhere. Maybe in a file (there will be lots of them). Then the file needs to be visualized on request. It’s possible to implement a servlet or a custom REST request to serve the map, similar to what i’ve done in Danfoss binding.
Sorry guys, i have completely no time to work on this project atm. In fact what we currently have is sufficient for my needs; and i still have tons of unimplemented things in my smart home, so i am proceeding with them.
Also, frankly speaking, after completely unsuccessful attempt to submit a Herzborg binding ([herzborg] Herzborg binding by Sonic-Amiga · Pull Request #9327 · openhab/openhab-addons · GitHub) i got frustrated. :frowning: Looks like contribution acceptance process is very authoritarian; only a couple of people are making all the decisions; and if they dislike something (it can be anything), they just stop responding with even no way for you to know what was wrong.

1 Like

Thanks for developing and sharing this binding.

I just wanted to share that I installed the binding today. My Roomba i7 appeared in the inbox very quickly. The only problem I had setting it up was that at first I pressed the CLEAN button on the Roomba, and that didn’t help it register. When I carefully read the instructions and pressed and held the HOME button, the Thing came Online.

At First, thanks for your work.

I have a problem with " Cleaning specific regions":
I dont know how i put the parameters to command channel.

I tried:

cleanRegions:ZGFWneexTSCzHwzxxxx;[r=]8;[220414T1xxxxx]
cleanRegions:<ZGFWneexTSCzHwzxxxx>;[r=]<8>;[<220414T1xxxxx>]

But both doesn’t work.

has anybody a hint for me ?

Thanks
Stephan

I am also having some difficulty with specifying regions. I’ve tried

configuration: {}
triggers: []
conditions: []
actions:
  - inputs: {}
    id: "1"
    configuration:
      itemName: iRobotRoomba_Command
      pmap_id: D_vK0oWeTISnSsz8r8LhCw
      regions: 9
      event: 1
      command: clean
    type: core.ItemCommandAction

as well as

configuration: {}
triggers: []
conditions: []
actions:
  - inputs: {}
    id: "1"
    configuration:
      itemName: iRobotRoomba_Command
      pmap_id: D_vK0oWeTISnSsz8r8LhCw
      regions:
        region: 9
        type: rid
      event: 1
      command: clean
    type: core.ItemCommandAction

but it doesn’t seem to pass along the region info. The lastcommand string shows nulls.

{"command":"start","time":1650997183,"initiator":"openhab","event":null,"ordered":null,"pmap_id":null,"regions":null,"user_pmapv_id":null,"favorite_id":null,"robot_id":null,"select_all":null}

Any pointers on what I’m doing wrong?

I’m having issues connecting my Roomba J7+ and Braava M6. The binding can retrieve the robot ID but not the password.

Here is my setup:

Roomba J7+ - Software version
Braava M6 - Software version
Both robots have fixed IPs set at the DHCP server level. The IPs and network addresses are the same as OpenHAB’s.
Both robots are on the dock, fully charged, and connected to the Wi-Fi.

  • Hardware: Raspberry Pi 4B (ARM64) / 4G RAM
  • OS: CentOS 8 (64-bits)
  • OpenHAB 3.3.0

The first problem: The binding didn’t discover any of the robots, even after manually scanning. I had to manually add each robot and the binding retrieved the robot ID based on the robot’s IP.

The second problem: I followed the steps mentioned in the documentation, but instead of 2 seconds I had to wait for around 12 seconds for the robots to play the tones and another 30+ seconds for the next tone, just to find out that the binding reported one of two errors:


1. CONFIGURATION_ERROR java.net.NoRouteToHostException: No route to host (Host unreachable)
2. CONFIGURATION_ERROR java.net.ConnectException: Connection refused (Connection refused)

I read as much as I could from this thread and followed the suggestion to force close the iRobot app from both of my iPhones and even turned the phones off (just in case), restarted the robots, then attempted the connection again, to no avail. I deleted the things, restarted the robots, and manually created them again. No change.

Some additional things I noticed are that the initial state is not CONFIGURATION_PENDING but CONFIGURATION ERROR Robot authentication is required
image

and after setting the binding to DEBUG mode in the Karaf Console, nothing except the following is periodically displayed:

[DEBUG] [rnal.discovery.IRobotDiscoveryService] - Starting broadcast for /10.255.255.255

I haven’t tried manually downloading the password yet. That will be my next test.

Continuing with my previous comment and after installing/updating all the required tools, I tried to manually download the password without success:

[2022-08-04 23:56:26,338][ INFO](Roomba              ) *******************
[2022-08-04 23:56:26,339][ INFO](Roomba              ) * Program Started *
[2022-08-04 23:56:26,341][ INFO](Roomba              ) *******************
[2022-08-04 23:56:26,342][ INFO](Roomba              ) Roomba.py Version: 2.0i
[2022-08-04 23:56:26,343][ INFO](Roomba              ) Python Version: 3.7.3 (default, Sep  5 2019, 17:14:41) [Clang 11.0.0 (clang-1100.0.33.8)]
[2022-08-04 23:56:26,344][ INFO](Roomba              ) Paho MQTT Version: 1.6.1
[2022-08-04 23:56:26,345][ INFO](Roomba              ) CV Version: 4.6.0
[2022-08-04 23:56:26,346][ INFO](Roomba              ) PIL Version: 9.2.0
[2022-08-04 23:56:26,347][ INFO](Roomba              ) <CNTRL C> to Exit
[2022-08-04 23:56:26,348][ INFO](Roomba              ) Roomba MQTT data Interface
[2022-08-04 23:56:26,349][ INFO](Roomba.Password     ) Using Password version 2.1
[2022-08-04 23:56:26,351][ INFO](Roomba.Password     ) reading/writing info from config file ./config.ini
[2022-08-04 23:56:26,352][WARNI](Roomba.Password     ) No roomba or config file defined, I will attempt to discover Roombas, please put the Roomba on the dock and follow the instructions:
[2022-08-04 23:56:26,354][ INFO](Roomba.Password     ) reading/writing info from config file ./config.ini
[2022-08-04 23:56:26,357][ INFO](Roomba.Password     ) waiting on port: 5678 for data
[2022-08-04 23:56:26,986][ INFO](Roomba.Password     ) Robot at IP: 10.XX.XX.XXX Data: 
  "ver": "3",
  "hostname": "iRobot-87540903ADXXXXXXXXXXX",
  "robotname": "Roomba",
  "robotid": "87540903ADXXXXXXXX",
  "ip": "10.XX.XX.XXX",
  "mac": "50:14:.....",
  "sw": "sanmarino+22.21.1+2022-06-02-570490a425b+Firmware-Build+1339",
  "sku": "m61XXXX",
  "nc": 1,
  "proto": "mqtt",
  "cap": {
    "oMode": 4,
    "edge": 0,
    "maps": 3,
    "pmaps": 10,
    "mc": 1,
    "tHold": 1,
    "tLine": 2,
    "area": 1,
    "eco": 1,
    "multiPass": 2,
    "team": 1,
    "pp": 0,
    "lang": 2,
    "5ghz": 1,
    "prov": 3,
    "sched": 2,
    "svcConf": 1,
    "ota": 2,
    "log": 2,
    "langOta": 0,
    "expectingUserConf": 1
  },
  "cloudConnState": 14
}
[2022-08-04 23:56:27,685][ INFO](Roomba.Password     ) Robot at IP: 10.YY.YY.YYY Data: {
  "ver": "3",
  "hostname": "iRobot-1EE47CB5CDCE4EYYYYYY",
  "robotname": "Braava",
  "robotid": "1EE47CB5CDCEYYYY",
  "ip": "10.YY.YY.YYY",
  "mac": "50:14:....",
  "sw": "sanmarino+22.21.1+2022-06-02-570490a425b+Firmware-Build+1339",
  "sku": "m61YYYY",
  "nc": 0,
  "proto": "mqtt",
  "cap": {
    "oMode": 4,
    "edge": 0,
    "maps": 3,
    "pmaps": 10,
    "mc": 1,
    "tHold": 1,
    "tLine": 2,
    "area": 1,
    "eco": 1,
    "multiPass": 2,
    "team": 1,
    "pp": 0,
    "lang": 2,
    "5ghz": 1,
    "prov": 3,
    "sched": 2,
    "svcConf": 1,
    "ota": 2,
    "log": 2,
    "langOta": 0,
    "tileScan": 1
  }
}
[2022-08-04 23:56:39,720][ INFO](Roomba.Password     ) 0 robot(s) already defined in file./config.ini, found 2 robot(s) on network
[2022-08-05 00:00:13,180][ INFO](Roomba.Password     ) To add/update Your robot details,make sure your robot (Braava) at IP 10.YY.YY.YYY is on the Home Base and powered on (green lights on). Then press and hold the HOME button on your robot until it plays a series of tones (about 2 seconds). Release the button and your robot will flash WIFI light.
Press <Enter> to continue...
s<Enter> to skip configuring this robot: 
[2022-08-05 00:02:51,358][ INFO](Roomba.Password     ) Roomba (Braava) IP address is: 10.YY.YY.YYY
[2022-08-05 00:03:01,362][ERROR](Roomba.Password     ) Connection Timeout Error (for 10.YY.YY.YYY): timed out
[2022-08-05 00:03:01,363][ERROR](Roomba.Password     ) Unable to get password from roomba
[2022-08-05 00:03:01,364][ERROR](Roomba.Password     ) Error getting password for robot Braava at ip10.YY.YY.YYY, received 0 bytes. Follow the instructions and try again.
[2022-08-05 00:03:01,366][ INFO](Roomba.Password     ) reading/writing info from config file ./config.ini
[2022-08-05 00:03:01,367][WARNI](Roomba.Password     ) No roomba or config file defined, I will attempt to discover Roombas, please put the Roomba on the dock and follow the instructions:
[2022-08-05 00:03:01,368][ INFO](Roomba.Password     ) reading/writing info from config file ./config.ini

The time out were displayed before the robots played the tone for the 2nd time.
The program repeated over and over again, cycling through each robot until I manually canceled it.

When I tried the cloud version I got the following problem:

nelsonaponte@NELSONS-AIR roomba % python3 ./password.py UUUUUUUU PPPPPPPPP
quote> 

It seems like my username (includes @ and +) or password (80-char long) are not correctly understood and

quote>  

Something else is expected.

UPDATE: I found Getting password on Roomba j7+ · Issue #95 · NickWaterton/Roomba980-Python · GitHub and run

nelsonaponte@NELSONS-AIR roomba % python3 ./getcloudpassword.py UUUUUUUU PPPPPPPPP
quote> 

But had the same behavior