iRobot Roomba i7+ Configuration using Rest980

Thank you. I am working to also integrate my Braava M6 as well, has anyone else done both S9/i7 and Braava? Do I need to run two instances of Rest980 to get this accomplished?

I would assume so because you will need to specify seperate IP addresses for each.

Do you use my HA addon repo? I can create a second copy in my repo if that makes it easier for you?

I have actually been able to get it to work by creating a new lovelace-roomba-vacuum-card (naming it lovelace-roomba-braava-card) as well as creating a new vacuum.yaml in my packages directory and naming it braava (and then changing all vacuum references to braava references). It is working with both my s9+ and Braaava on two separate lovelace tabs. I was hoping there would be a way to only run rest980 once but you are right, each instance seems to need its own blid etc so i run it twice and specify a different port number for my braava. Works like a charm albeit a little clunky (needing to make sure i restart my rest980s after each restart of my server)
You have done a lot of great work on this and thank you!!!

1 Like

Still working on how to get maps to work without docker :woozy_face:

You really just need php for the map to work, so if you can install it on the same box and access the page over http/https then it should work :+1:

English is not my native language, so I do not completely understand what you mean by this, but I know this shoud be possible from the Dorita980 package. As far as I undertstand Dorita is communicating via MQTT to the robot.
The raw command doesn’t seem to be routed in the REST980 package though.

From Dorita980:

function _apiCall (topic, command, additionalArgs) {
    return new Promise((resolve, reject) => {
      let cmd = {command: command, time: Date.now() / 1000 | 0, initiator: 'localApp'};
      if (topic === 'delta') {
        cmd = {'state': command};
      }
      if (additionalArgs) {
        cmd = Object.assign(cmd, additionalArgs);
      }
      client.publish(topic, JSON.stringify(cmd), function (e) {
        if (e) return reject(e);
        resolve({ok: null}); // for retro compatibility
      });
    });
  }

So technically it is possible. The standard Roomba component in Home assistant hass the SEND_COMMAND option, but like I said before I do not seem to get this working.
Do you think is is possible to add a Raw command option to Rest980 in your Repo?

I’m still not good at programming for Home assistant (not familiar enough with Python) but I would like to learn. I’m trying to avoid to have to write another addon as I think it is best to have it all together.
I saw the original Roomba component is written by @pschmitt, maybe the map part is something he can add to the system component? (If not, sorry to summon you).

NEW VERSION RELEASE

CONTAINS BREAKING CHANGES!

I have published updated versions of the ha-rest-980 and lovelace-roomba-vacuum-card

Please ensure you update your vacuum.yaml file before updating the Lovelace card as there is breaking changes!

I upgraded with no issues, once I remembered to switch back to the regular check-button-card plugin from repo https://github.com/custom-cards/check-button-card.

this has helped me locate the stuck irobot after coming back from work al least 4 times so far.

Thanks @Syrius
/Pierre

1 Like

I can’t tell if all the addons are correct. I’m running hassio within a VM, I ran the plugin to get the ID/PW from the Rooma directly, then installed both the nginx & Vacuum Card via HACS. However, when I navigate to the HA-IP/nginx-PORT/, I get this,

Notice: Undefined offset: -1 in /config/vacuum/image.php on line 55

Warning: Cannot modify header information - headers already sent by (output started at /config/vacuum/image.php:55) in /config/vacuum/image.php on line 235

Followed by everything else at this link - https://www.screencast.com/t/nc4uMoTUAE

Not sure where I went wrong here. Appreciate the help however.

Hi @Adam_Zilko,

Have you run a clean since configuring this? I expect this is referencing the fact that it cant find any entries in vacuum.log (and/or the file does not exist/is no reachable)

Can you please check if this file is in this folder and contains valid coordinates?

I uploaded the Vacuums Github folder to /Config/. I had thought it had run (w/ all room selected but one). However, I can rerun it once it’s done recharging.

if you have run a clean, then the vacuum directory should contain a vacuum.log file? can you confirm if its there?

EDIT - have you added the vacuum.yaml package configurations to your setup?

if not, can you please check if the log position automation has run?
Configuration > Automations > Vacuum Log Position > Last triggered time

Hmm, no, I haven’t added the yaml file configurations. Can you point me in the right direction here? I think I missed something along the way… Sorry, I just installed HA yesterday (first time digging into this), and this particular device integration has been challenging.

Upon further inspection, in regards to the files listed here - https://github.com/jeremywillans/ha-rest980-roomba I only have the Vacuum folder added. Do I just grab the rest of these and upload to /Config/?

Welcome to the wonderful world of Home Assistant :slight_smile:

Have a read through the instructions on the GitHub site, it will walk you through the requirements to get this going.

The vacuum.yaml file contains a large percentage of the coding for this integration, and IMO the easiest deployment method is using Packages

I’ve gone through it several times, and I do see section 6 - https://github.com/jeremywillans/ha-rest980-roomba#step-6-configure-home-assistant-package-and-secrets. However, I’m unclear as to what goes where, and what to add where. Do I move all of those files (except for the Vacuum file) into a folder called packages (after adding -

homeassistant:
  packages: !include_dir_named packages
  • to configuration.yaml), and some how call them?

Again, my apologies on this. I’ll only need to learn it once, and unfortunately, I’m simply in the dark here. I do appreciate your help on this.

All good! we have all been there :slight_smile:

yes add this in your configuration.yaml and copy the vacuum.yaml into the new packages folder

secrets.yaml

you will already have a secrets.yaml file in your config directory → copy the contents of the secrets.yaml file into this existing one.

HACS

you will need to install HACS to get this working → click here and follow the instructions
once installed and running, you will need to install the prerequisite plugins and enable them in lovelace.

note- my lovelace-roomba-vacuum-card is custom so you will need to add this a custom repository in HACS

lovelace.yaml

then you will want to create a new card in lovelace (click three dots in top right corner, select configure UI, then click the red plus sign and select manual card. copy the contents of lovelace.yaml into this configuration pane (removing the existing line), in theory you should get the vacuum card popup in the preview pane, and not a bunch of red errors :grimacing:

let me know how you go with this :+1: reach out if anything dosent make sense

1 Like

I had originally installed HACS, and had installed “Roomba Vacuum Card”. I’m not sure if there’s any other plugins I need aside from that and the nginx docker image?

The nginx plugin port is 3001, so when I navigate to http://192.168.1.198:3001/api/local/info/image.php - I get a 404.

I have copied over vacuum.yaml into the packages directory, added the info to secrets.yaml (and updated the host-ip/port-numbers to http://192.168.1.198:3001).

I’m also still not getting a vacuum.log file. I’m seeing log errors of “no attribute errors”, but am assuming that that’s due to no log file.

I have not moved the docker-compose or docker-portainer-stack files either (as I wasn’t clear on these either). So I don’t know if there’s something there?

Yes you will need these installed

it should just be http://192.168.1.198:3001/image.php

have you installed the rest980 addon? check here under HA ADDON heading

without rest980, the sensor wont populate any details which will be root cause of your issue

My apologies, I didn’t have rest980 Docker Image installed. I restarted everything, and now am seeing this in the logs,

Log Details (ERROR)
Logger: homeassistant.components.vacuum
Integration: Vacuum (documentation, issues)
First occured: 9:12:25 PM (1 occurences)
Last logged: 9:12:25 PM

Error while setting up roomba platform for vacuum
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 303, in _connect
    self.client.connect(self.address, self.roomba_port, 60)
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 937, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 1071, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
    return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
  File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 303, in _connect
    self.client.connect(self.address, self.roomba_port, 60)
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 937, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 1071, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
    return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
  File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 303, in _connect
    self.client.connect(self.address, self.roomba_port, 60)
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 937, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 1071, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.7/site-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
    return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
  File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/roomba/vacuum.py", line 112, in async_setup_platform
    await hass.async_add_job(roomba.connect)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 286, in connect
    if not self._connect():
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 321, in _connect
    self._connect(count, True)
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 321, in _connect
    self._connect(count, True)
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 321, in _connect
    self._connect(count, True)
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 325, in _connect
    "Unable to connect to Roomba at {}".format(self.address))
roomba.roomba.RoombaConnectionError: Unable to connect to Roomba at 192.168.20.46

The IP address is correct, and all firewall rules are setup to allow established and related - as this device is on a VLAN. All MQTT ports are also open. I then tested opening the roomba IP up to the HA server, then restarted, but got the same error as above.

this deployment does not use the HA built in vacuum component - you will need to disable this for it to work!