iRobot Roomba i7+ Configuration using Rest980

I tried deleting the latest.png after a clean and when I point the browser to
http://ip:port/image.php
I have something like:

Notice: Trying to get property 'attributes' of non-object in /app/image.php on line 221

Notice: Trying to get property 'batPct' of non-object in /app/image.php on line 221

Warning: Cannot modify header information - headers already sent by (output started at /app/image.php:221) in /app/image.php on line 241
�PNG  IHDR�� 2� pHYs���+e IDATx���y�u���w-���~�$�H�!,!Fa�� #ڭCӈ�t���0��L+���}�����Q��i��PQH؂��$fa a���ܳUթ������s/��f>�繏�ɽ�s�^�ԧ>��eY�B!�Bq�2��' �B!�B l�B!�B�$�B!�BqH��V!�B!�!M[!�B!��4 l�B!�B�$�B!�BqH��V!�B!�!M[!�B!��4 l�B!�B�$�B!�BqH��V!�B!�!M[!�B!��4 l�B!�B�$�B!�BqH��V!�B!�!M[!�B!��4 l�B!�B�$�B!�BqH��V!�B!�!M[!�B!��4 l�B!�B�$�B!�B

it seems like all that rubbish is indeed the png file but the browser is not able to read it.
I am using the latest version of Firefox on Windows.

Mikael, can you share what your nginx configuration looks like having both paths identified?

These are the two nginx I have

Ohhh, got it. For some reason I thought _2 was a newer package not that it should be used for a second iRobot. Thanks!

The you need to modify the image.php file in each folder:

// ADJUST THESE PARAMETERS

$vacuum_log = ‘http://192.168.107.10:8084/vacuum.log’; # Could also be HTTPS

$set_first_coordinate = 0; # Ability to skip initial coordinate(s) if incorrect data logged

$overlay_image = ‘floor.png’; # Background Layer

$overlay_walls = false; # Allows overlaying of walls, used in fill mode to cover ‘spray’

$walls_image = ‘walls.png’; # Walls Image must contain transparent floor

$show_stuck_positions = true;

$line_thickness = 2; # Default 2, Set to ~60 for Fill Mode

$map_width = 1050; # Ensure overlay and wall images match this size

$map_height = 900; # Ensure overlay and wall images match this size

$x_offset = 220;

$y_offset = 220;

$flip_vertical = false;

$flip_horizontal = false;

$rotate_angle = 0; # Allows rotating of the roomba lines

$scale=1.00; # Allows scaling of roomba lines

$ha_rest980 = ‘https://192.168.107.10:3002/api/states/sensor.rest980’;

$ha_token = ‘<ha_long_live_token>’;

$ha_timezone = ‘Europe/Lisbon’; # Supported Timezones https://www.php.net/manual/en/timezones.php

$ha_text_delimiter = " \n"; # How text is displayed on the map top " \n" --> New Line ## " |" --> Show on one line

// ADJUST THESE PARAMETERS

$vacuum_log = ‘http://192.168.107.10:8083/vacuum.log’; # Could also be HTTPS

$set_first_coordinate = 0; # Ability to skip initial coordinate(s) if incorrect data logged

$overlay_image = ‘floor.png’; # Background Layer

$overlay_walls = false; # Allows overlaying of walls, used in fill mode to cover ‘spray’

$walls_image = ‘walls.png’; # Walls Image must contain transparent floor

$show_stuck_positions = true;

$line_thickness = 2; # Default 2, Set to ~60 for Fill Mode

$map_width = 1440; # Ensure overlay and wall images match this size

$map_height = 1829; # Ensure overlay and wall images match this size

$x_offset = 220;

$y_offset = 220;

$flip_vertical = false;

$flip_horizontal = false;

$rotate_angle = 0; # Allows rotating of the roomba lines

$scale=1.00; # Allows scaling of roomba lines

$ha_rest980 = ‘https://192.168.107.10:3001/api/states/sensor.rest980’;

$ha_token = ‘<ha_long_live_token>’;

$ha_timezone = ‘Europe/Lisbon’; # Supported Timezones https://www.php.net/manual/en/timezones.php

$ha_text_delimiter = " \n"; # How text is displayed on the map top " \n" --> New Line ## " |" --> Show on one line

So i’ve setup my i7 without an issue. I’ve got my Braava working and the map (same as i7) is working as well but it’s rotated 90 degrees. I’ve tried using the rotate_angle and adjusting the offsets and it seems like its just one big line instead of what its supposed to be. I really don’t want to rotate my floor file. Any ideas?

1 Like

i suspect you haven’t set the long lived token correctly and its unable to get the attributes from HA

the rotation works, but its expotential - so you will really need to adjust the offsets to bring it back into view when using the rotation

for example mirek was using rotate_angle of 180 and needed to use -740 and -560 offsets to get it working

Hi Jeremy,

Here is what it looks like without any rotate angle.
No Rotate.

Then, with a -90 rotate angle or 270 rotate angle and x_offset -820 and y_offset -720, this is what it looks like
.Rotate-90

I’m not finding the correct values to make it look correct.

My humble advise (i went through the same problem with finding the right parameters!); lets first apply very low scale (0.2 or so). This will give you high chance to see how the actual trial of vacuum looks and how it is positioned versus starting position. Once you position it correctly from rotation point of view, start playing with increasing the scale (to have approximately right coverage fitting map) and finally offset value to position the trial in the right place over the map.

Hi Mirek, I appreciate your suggestions. I tried using a scale of .2 and can see it on the floor plan but its very scrunched… I then changed it to .4 to make it a little larger. Adjusting the Y offset seems to make it move but the x offset doesn’t seem to make any adjustments at all, regardless of what i choose. I’ve tried 1000 and -1000 for the x offset and it stays in the same spot.

$x_offset = 5;
$y_offset = -1220;
$flip_vertical = false;
$flip_horizontal = false;
$rotate_angle = 270; # Allows rotating of the roomba lines
$scale=0.4; # Allows scaling of roomba lines

This photo (not using rotation) is using the same plot data from the Braava.

f5cbcd42a172bf4bbc8b1d077dafd22877f1b515

@ Brandon, with resetting all the transformation values (I mean scalling=1, no rotation, no offset) I understand you receive map as on the very last picture. How this should be positioned over your real map? What is coverage? Could you put this on the came map with different color?
To me (but this is guess, not knowing where the furnitures are placed), trial of vacuum movement is covering dinning room, kitchen and foyer? In this case it would seems to be very close to actual map, perhaps with the exception of startiung point. If so, you can try versy subtle scalling and offset and eliminate starting point, that sometimes is reported incorrectly (that was my case that was fixed by @Jeremy by adding option:

$set_first_coordinate = 3; # Ability to skip initial coordinate(s) if incorrect data logged

As you can see I had to remove first 3 position recordings that were totaly inaccurate to make reasonable map.

Hi Mirek, my issues relate to the mapping for my iRobot Braava. The second photo is spot on, if it was rotated 90 degrees clockwise. The plotting on the map should only be covering the kitchen area. I’m not so concerned about the long line that is off to the side. You can see in the center of the green lines my kitchen island that it went around. If I rotated my floor.png 90 degress counter-clockwise I would easily be able to line up the map.

I also have an iRobot i7 and the map is in the same orientation and the plotting was spot on, just a few minor adjustments but didn’t need to rotate it at all.

I’ve rotated my floor.png 90 degress and adjusted the offsets/scale and it lines up perfectly. However I’d like to keep the floor.png in the correct orientation and rotate the plotted green lines.

Here it is with the rotated image

Hi @Syrius
just passing on info to you my Roomba i7 software version is now 3.8.3
still having some problems (communication errors) after it docks. That’s not why i’m here the changes now makes new users have difficulty setting up this HA addon.

the step 5 instructions from https://github.com/jeremywillans/ha-rest980-roomba

* Navigate to  `http://<ip or fqdn of docker host>:<rest980port>/api/local/info/state`
* Look for the "lastCommand" section and copy down the following info
  * regions
  • if you chose “Clean All” in iRobot app, then monitored the rest980 url
    regions section will have null
    "regions":null,

  • if you chose “Choose Rooms” and you chose just 1 room, then monitored the rest980 url regions section will have something like below, it no longer has region_name, region_type.

    "regions":[{"region_id":"27","type":"rid"}],
    
  • but if you chose “Choose Rooms” and checked all the boxes on all the rooms sequentially (the rooms listed (for now) are in region_id ascending order)
    you can just take the name list order from the app and correlate it to the region_id
    values from the regions section. my region_id values do have gaps

"regions":[
{"region_id":"1","type":"rid"},
{"region_id":"3","type":"rid"},
{"region_id":"4","type":"rid"},
{"region_id":"7","type":"rid"},
{"region_id":"21","type":"rid"},
{"region_id":"23","type":"rid"},
{"region_id":"24","type":"rid"},
{"region_id":"25","type":"rid"},
{"region_id":"26","type":"rid"},
{"region_id":"27","type":"rid"}]

I did retrain my roombai7, so my region_id’s changed on all but 1 of my rooms,
the 1 room it didn’t change happened to be my test room, so I didn’t notice there was a problem. If someday the iRobot app room order is not listed in region_id ascending order, it’ll be painful to use the app 1 room at a time, to get its corresponding region_id, but we’re not there yet.

on the other hand i can finally schedule vacuuming of rooms in the order i want, it works most of the time, unless the irobot 7 gets stuck, then when you rescue it, it starts vacuuming the entire house after the rescue.

Hi @pnakashian,

Thanks for the update - ill update my get region info to account for these changes.
I might add a note in the instructions to verify your rooms if you retrain

I have a ordered cleaning solution running on my test box, basically tracks the order in which you select the inputs and generates the REST command based on that order :+1:

do you mean from in HA or from iRobot App?

No i haven’t done that, I depend on the iRobot App to schedule room cleaning, as I don’t have a scheduler solution yet in HA. I’ve made little progress finding a scheduler with a gui, Once i have a scheduler with a gui working in HA, then I’ll start looking for a solution to schedule multiple rooms in specific order to clean to replace most of the iRobot App functionality semi-locally, like I have created scripts for each room calling your automation.vacuum_clean_rooms to setup voice commands in alexa to clean specific rooms.

do you mean from in HA or from iRobot App?

in iRobot App.

I’ve really been enjoying you rest980 Docker Image @Syrius. It really works quite well and more reliably than other HA Roomba integrations I’ve tried in the past. There is something however, that has caused me some grief that I think I’ve finally resolved and thought I’d share.

Whenever I restarted HA or rebooted the HA host, my i7 Roomba would become ‘unavailable’ in HA. After beating on it for a while I’d somehow manage to get it working again. This became a regular weekly ritual after upgrading HA. I needed to find some way of automating this repeated beating but first needed to find out what sequence of events I was doing that was somehow restoring this functionality.

I tried to ‘restart’ the Add-on multiple times. I even automated this to occur repeatedly every 10min until the Roomba sensors came out of their ‘unavailable’ state, but that didn’t work. I found that if killed the ‘node ./bin/www’ process and started the rest980 container again that it would work again, every time, consistently. No idea why, but it did.

Following up on a hunch I was able to reproduce this behavior by stopping the rest980 first, then starting it. This seems to do something different than simply restarting the add-on. So now I have an automation that stops the rest980 add-on whenever any of the Roomba sensors are in an ‘unavailable’ state, wait for a short delay, then ‘Start’ the add-on again. This seems to have resolved all my reliability issues with this add-on. Hopefully, this helps anyone else who might have been experiencing similar reliability issues with their Roomba and this add-on.

I’m having some trouble setting this up. I should say first that I have the regular Roomba plugin working, so the BLID/password/ip I have should be correct. I’m using the HASSIO addon and the parameters should be configured (I have no idea how I’m supposed to actually verify that the plugin is able to use the credentials properly).

The /api/local/info/state has no information on it - it is just a blank page. When I go and run a cleaning in a room, it stays blank. The /map page shows the UI… but there is no functionality. I’m basically stuck on “Step 5: Get Room Details” because I can’t seem to get the room details to populate.

Any ideas on how to proceed?

@aLTeReGo - thanks for sharing!

If possible, can you please share your automation? i will add this into the FAQ in case other people run into this issue

what does the logs show for the rest980 container? also refresh the logs after trying to hit the “state” page?

The log is as follows:

[email protected] start /usr/src/app
node ./bin/www
GET /api/local/info/state 200 109.812 ms - 2

I’m not sure if I misunderstood the original instructions. I only did the “HA Addon” part for Step 4 and installed the two “_2” add ons… I was thinking that would spin up all of the things necessary. Do I also need to do the part in the “Docker Run” part of Step 4 to actually spin up the containers?

Release 0.7

This release brings Ordered Cleaning and some example Automations

Other Changes/Bug-fixes

  • Add Image cleanup automation
  • Add initial coordinate skipping to image.php file
  • Add delimiter option for image.php file wording (allows single or multiple lines for the text)
  • Change power_boost to carpet_boost (#5) (other features from here coming soon!)
  • Insert YAML file links in README
  • Fix incorrect YAML link in README (#7
  • Update README to reflect API no longer showing room names
  • Notifications on finish and stuck states, IOS also includes map shown on lock screen
  • Did I mention ORDERED CLEANING?! :partying_face:

Check it out on GH :+1: