iRobot Roomba i7+ Configuration using Rest980

Check out this post, and the few above it for ideas!

essentially you need to automate activating the input booleans for the rooms and then trigger the automation.

I know… but that’s not going to be approved by wife :frowning:
I hope i oneday will be possible :wink:

:slightly_frowning_face:

thinking about it - even if manual movements were to work, if the bin got full part way through a cleaning cycle you would need to end the clean in order to invoke the manual move (as it would be treated as a separate job). this might then no be so ideal? =/

Not sure if this has been discussed yet…
I have a S9+ and every time a job ends there is a “pause” period where the Smart Maps are being processed/uploaded. While this happens, no commands can be given. In the app the UI blocks everything until it’s done. Any thoughts on how to do the same in HA? Perhaps a different status (e.g. Processing Maps) and hiding all buttons?
I took a quick look at the JSON of the state, and it looks like the only relevant field is notReady: 39 instead of notReady: 0, inside cleanMissionStatus

Yeah I think the i7+ has that also, but I don’t think it’s cause for concern unless you are attempting to smash the next request as soon as it’s docked?

Do you find this to be a problem in your setup?

Well, it’s a bit inconvenient. As I’m configuring/testing in HA, specially getting the map right, I frequently start/stop/dock etc… the map processing happens even when you just stop, not just dock. Without the phone app open, I don’t really know what’s going on and when it’s ready to accept commands again (it doesn’t help that the it takes quite a long time to finish for some reason)

Other than that, my only other argument would be to make it more “pro” :slight_smile: It would get closer and closer to the native functionality inside HA.

I think the minimal amount of work required would be to report the status in the already existing sensor and hide all buttons on the custom card while that status is active.

Yeah ok… I can appreciate that :slight_smile:

The below code added to your vacuum.yaml will update the status and force the Selective Clean to remain locked. The other buttons will take a little more work as they are part of the lovelace roomba card.

      vacuum:
        friendly_name_template: >-
          {{ state_attr('sensor.rest980', 'name') }}
        value_template: >-
          {% if state_attr('sensor.rest980', 'cleanMissionStatus')["cycle"] == 'none' and state_attr('sensor.rest980', 'cleanMissionStatus')["notReady"] == 39 %}
              Pending
          {% else %}
          {% set mapper =  {
            'clean' : 'Clean',
            'quick' : 'Clean',
            'spot' : 'Spot',
            'evac' : 'Empty',
            'dock' : 'Dock',
            'train' : 'Train',
            'none' : 'Ready' } %}
          {% set state =  state_attr('sensor.rest980', 'cleanMissionStatus')["cycle"] %}
          {{ mapper[state] if state in mapper else 'Unknown' }}
          {% endif %}

Cheers for the idea!

ive been waiting for this to come out, so thank you! is there any chance you would be able to do a install video on this? im so frikin lost…

I think that would be nice/OK… Then when it’s parked in the base and we get home from work, we can “call” out the roomba to the location. Or maybe an automation could trigger the movement to that location when the cleaning cycle is done and the bin is full.

This worked nicely for the status. I think this alone would create a couple of bugs on other automations that are looking specifically for the transition between Clean and Ready (as it goes through the “Pending” state first). In my case I had already tweaked a bunch of things (I renamed the states), so I could make it work anyhow.

Only thing missing now would be the card tweaks :slight_smile:

1 Like

Good point, ill add an extra state transition of Pending to Ready for the automation’s :slight_smile:

      - platform: state
        entity_id: sensor.vacuum
        from: 'Pending'
        to: 'Ready'
        for:
          seconds: 10 #applicable for image gen automation

Will get onto the card mods when i find some time!

Hey @waynerigley

Sorry creating a video install isn’t high on the priority list for the time being :frowning:

I’ll PM you and lets see if we can get this rolling.

NEW RELEASE

Maintenance Release 0.4

This update includes the following

  • Removed manually defining pmap_id and user_pmap_id fields, these are now dynamically stored
  • Add Pending State after Cleaning when Roomba is saving maps
  • Update Region examples in secrets.yaml as you only need to send the region ID, not the whole string

secrets.yaml examples

vacuum_kitchen: '{"region_id": "21"}'
vacuum_entry: '{"region_id": "13"}'

Hello,

I have a roomba 980 and I can’t get this to work… Any help much appreciated.
Here is a list of errors, I think are related:

/usr/src/app/node_modules/dorita980/lib/v2/local.js:33
    throw e;
    ^
Error: Connection refused: Not authorized
    at MqttClient._handleConnack (/usr/src/app/node_modules/mqtt/lib/client.js:920:15)
    at MqttClient._handlePacket (/usr/src/app/node_modules/mqtt/lib/client.js:350:12)
    at work (/usr/src/app/node_modules/mqtt/lib/client.js:292:12)
    at Writable.writable._write (/usr/src/app/node_modules/mqtt/lib/client.js:302:5)
    at doWrite (/usr/src/app/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/usr/src/app/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/usr/src/app/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at TLSSocket.ondata (_stream_readable.js:558:20)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at TLSSocket.Readable.push (_stream_readable.js:134:10)
    at TLSWrap.onread (net.js:559:20)
npm ERR! Linux 4.19.114-v8
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the rest980 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs rest980
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls rest980
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log
Logger: homeassistant.components.rest.sensor
Source: components/rest/sensor.py:113
Integration: rest (documentation, issues)
First occurred: 2:43:02 AM (5 occurrences)
Last logged: 2:48:08 AM

Error fetching data: http://192.168.1.50:300/api/local/info/state failed with HTTPConnectionPool(host='192.168.1.50', port=300): Max retries exceeded with url: /api/local/info/state (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f76934ad0>: Failed to establish a new connection: [Errno 111] Connection refused'))
Error fetching data: http://192.168.1.50:300/api/local/info/state failed with HTTPConnectionPool(host='192.168.1.50', port=300): Max retries exceeded with url: /api/local/info/state (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f752f0f90>: Failed to establish a new connection: [Errno 111] Connection refused'))
Error fetching data: http://192.168.1.50:300/api/local/info/state failed with HTTPConnectionPool(host='192.168.1.50', port=300): Max retries exceeded with url: /api/local/info/state (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f730e68d0>: Failed to establish a new connection: [Errno 111] Connection refused'))
Error fetching data: http://192.168.1.50:300/api/local/info/state failed with HTTPConnectionPool(host='192.168.1.50', port=300): Max retries exceeded with url: /api/local/info/state (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f75af7a90>: Failed to establish a new connection: [Errno 111] Connection refused'))
Error fetching data: http://192.168.1.50:300/api/local/info/state failed with HTTPConnectionPool(host='192.168.1.50', port=300): Max retries exceeded with url: /api/local/info/state (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f752a55d0>: Failed to establish a new connection: [Errno 111] Connection refused'))
Log Details (WARNING)
Logger: hacs.deprecated
Source: custom_components/hacs/http.py:35
First occurred: 2:44:15 AM (5 occurrences)
Last logged: 2:44:32 AM

The '/community_plugin/*' is deprecated and will be removed in an upcoming version of HACS, it has been replaced by '/hacsfiles/*', if you use the UI to manage your lovelace configuration, you can update this by going to the settings tab in HACS, if you use YAML to manage your lovelace configuration, you manually need to replace the URL in your resources.

This appears to indicate your blid/password is incorrect.

Can you please check these?

How silly of me, you are correct, it was a typo… Now there is no errors in rest980 log. The errors from dev log still persist though and in the lovelace card all sensors are either unknown or unavailable. I see the buttons for pause, stop and dock, first two don’t do anything, when I press dock roomba beeps, so at least the connection seems to work. What should I check next? Sorry for being a noob.

I suspect this should be port 3000 ! Check your secrets.yaml entries :wink:

Thanks, I fixed that, but it still dones’t work :frowning:
edit: where should vacuum.yaml go? into config folder, vacuum folder or should it be integrated into configuration.yaml?

Log Details (ERROR)
Logger: homeassistant.components.rest.sensor
Source: components/rest/sensor.py:113
Integration: rest (documentation, issues)
First occurred: 5:39:52 PM (2 occurrences)
Last logged: 5:40:24 PM

Error fetching data: http://192.168.1.50:3000/api/local/info/state failed with HTTPConnectionPool(host='192.168.1.50', port=3000): Max retries exceeded with url: /api/local/info/state (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fad927590>: Failed to establish a new connection: [Errno 111] Connection refused'))
Error fetching data: http://192.168.1.50:3000/api/local/info/state failed with HTTPConnectionPool(host='192.168.1.50', port=3000): Max retries exceeded with url: /api/local/info/state (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fad79f250>: Failed to establish a new connection: [Errno 111] Connection refused'))
Log Details (ERROR)
Logger: homeassistant.helpers.entity
Source: helpers/template.py:869
First occurred: 5:40:21 PM (8 occurrences)
Last logged: 5:42:30 PM

Update for sensor.vacuum fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 470, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/template/sensor.py", line 242, in async_update
    attrs[key] = value.async_render()
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 222, in async_render
    return compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 869, in regex_findall_index
    return re.findall(find, value, flags)[index]
IndexError: list index out of range
Log Details (ERROR)
Logger: homeassistant.components.template.sensor
Source: components/template/sensor.py:244
Integration: template (documentation, issues)
First occurred: 6:14:03 PM (4 occurrences)
Last logged: 6:14:03 PM

Error rendering attribute total_area: UndefinedError: 'None' has no attribute 'sqft'
Error rendering attribute job_time: UndefinedError: 'None' has no attribute 'mssnM'
Error rendering attribute job_recharge: UndefinedError: 'None' has no attribute 'rechrgM'
Error rendering attribute job_area: UndefinedError: 'None' has no attribute 'sqft'

In the Packages folder.

I assume you are running the HA Addon for rest980. Please check the config on the and confirm which port is set (should be 3000 by default). Is that IP address the correct one for your HA server? Are you using a custom build with perhaps a firewall enabled?

I am (still) running 64bit home assistant on a rpi 3b+, as I can’t get it to work on rpi4b; nothing special about it I believe and it’s not behing and extra firewall or separate subnet. The IP from the log in post above is correct, vacuum.yaml is in the correct place.
Your HA addon is installed, port is set to 3000, blid, password and ip and firmware of the roomba are set as well. The log is full of this entries and nothing else:

GET /api/local/info/state 200 102.850 ms - 2395