iRobot Roomba i7+ Configuration using Rest980

@Syrius I am working on a PR so you can combine all your rest sensors into a template vacuum. Currently it’s missing attribute_templates, but I’m hoping it’ll get merged sometime in the near future.

I’ve already been able to integrate my Samsung Vacuum with the exposed SmartThings sensors utilizing my modifications.

image


2 Likes

Thank you!
I managed to import it and play with it! It’s really great, kudos for the effort!

I have one problem though: if noticed that using increasingly higher rotation values tends to distort the map drawings.
I am using rotation in conjunction with offsets. It is barely visible on small values (-10 +10) but it starts to be quite evident once you go higher (+270 for instance).
I will try to post some pictures later when I can run roomba without the neighbour killing me :smile:
Is it normal?

PS: is there a way to make the image.php recalculate the map+drawing using an existing vacuum.log while the roomba is not cleaning?

unfortunately it is a little special… :expressionless: just requires some experimental to get it right
id like to fix it at some stage to be smoother, just haven’t had the time to spend on it unfortunately

yes, you just need to delete the latest.png file in the vacuum directory - then it will re-draw the map each time you reload the file. if there is a latest.png file in the folder - it will just load this one (to not waste resources)

First, thank you for creating this! After spending most of the day yesterday, I was finally able to get my S9+ up and running. I’ve run into a couple issues if you wouldn’t mind helping me please.

  1. I can empty the bin and run a clean all cycle. However, when trying to run a selective rooms option, I am getting an message from the robot that says see the app for help. The app is telling me that the room cannot be found.

Here is my keys in secrets.

vacuum_state: http://10.0.0.173:3000/api/local/info/state 
vacuum_action: http://10.0.0.173:3000/api/local/action/ 
vacuum_verify_ssl: false 
vacuum_map: http://10.0.0.173:3001/image.php 
vacuum_log: /config/vacuum/vacuum.log 
vacuum_dir: /config/vacuum 
vacuum_kitchen: '{"region_id": "14"}' 
vacuum_office: '{"region_id": "15"}' 
vacuum_living_room: '{"region_id": "2"}' 
vacuum_closet: '{"region_id": "16"}' 
vacuum_bathroom: '{"region_id": "17"}' 
vacuum_dining_room: '{"region_id": "6"}' 
vacuum_master_bedroom: '{"region_id": "1"}' 

Looking at previous posts, it looks like I need to include map ids so I modified my code below using pmap_id for floorplan and user_pmapv_id for. user_floorplan

vacuum_state: http://10.0.0.173:3000/api/local/info/state 
vacuum_action: http://10.0.0.173:3000/api/local/action/ 
vacuum_verify_ssl: false 
vacuum_map: http://10.0.0.173:3001/image.php 
vacuum_log: /config/vacuum/vacuum.log 
vacuum_dir: /config/vacuum 
vacuum_floorplan: pxLLqu3WS9mWyVWWcRhw_A 
vacuum_user_floorplan: 200426T015813 
vacuum_kitchen: '{"region_id":"14","region_name":"Kitchen","region_type":"kitchen"}' 
vacuum_office: '{"region_id":"15","region_name":"Office","region_type":"office"}' 
vacuum_living_room: '{"region_id":"2","region_name":"Living Room","region_type":"living_room"}' 
vacuum_closet: '{"region_id":"16","region_name":"Closet","region_type":"closet"}' 
vacuum_bathroom: '{"region_id":"17","region_name":"Bathroom","region_type":"bathroom"}' 
vacuum_dining_room: '{"region_id":"6","region_name":"Dining Room","region_type":"dining_room"}' 
vacuum_master_bedroom:'{"region_id":"1","region_name":"MasterBedroom","region_type":"master_bedroom"}' 

Do I need to update any code in the vacuum.yaml to use these added ids? I still cannot get selective room cleaning to work.

  1. The map is generating and showing on my dashboard. I took a screenshot of the floorplan from my app and loaded it into the vacuum directory as floor.png. However, the map that produces is just the black background with the green line. It is not using the floorplan as the background. I did delete “latest” and ran another run but same result.

Hi!
How did you change to get the Braava Image?
I have a Roomba S9+ and a Braava m6 and I managed to get them both integrated into HA.

Next thing, the maintenance parts for the Roomba for brushes etc. It would be nice to be able to get info on filling the tank for Braava and also when to replace the dry and wet pad. Also have an indication if the dry or wet pad is mounted.

In the roomba vacuum card you have to update the vaccum.png file with one that you create with the M6 robot. I’ve created one that you can use if you’d like. Wasnt able to perfectly get the white background imaged removed but it still looks nice. M6 Pic

Question for you, can you walk me thru the basics of what you did to get the M6 added? I have the rest980_2 docker running to capture the data from the m6 and a second ngnix running both on different ports than my set up for the S9.

  • I went through and created a new folder in config called mop and updated the image.php file to include the updated ports for the M6.
  • Since i couldnt download a second custom robot card in lovelace, i copied the folder and created a custom mop card file with the same documents.
  • I created a mop.yaml file and did find replace in the entire script for vacuum and replaced with mop.
  • I then added the region ids and relevant information to secrets.yaml to include the mop references.
  • In the entities I can see the second sensors and automation for mop. But i am getting an error on the custom mop card as it is saying the card doesnt exist. I did ensure to call the added card in the resources section.

Im at a dead end and was planning to go through and delete all mop files and start the process over again. If you could help me in covering what you did so that I can review when redoing the process. Wondering if I need to update anything in the Mop files/scripts to call rest980_2 vs rest980 (which is for the S9)

Hi!
Thanks for the picture :slight_smile:
I first created a second folder called vacuum2 and specfied that in the ngix 2.

Then all the entries i changed the rest980 to rest980_2. Then I created a mop instead of vacuum in secrets.

The in all sensors end input etc I cahnged vacuum to mop and rest980 to rest980_2

Hope that helps.

This was removed from being hardcoded as it can get obtained dynamically

I’ve seen this before where the id listed on the URL dosent actually match the value used my the app. If you run a selective clean, check the URL user last command section and double check these map values match what is shown under sensor.vacuum

The fix in this last case was to update the map from the app (renamed a room or add a no-go section, etc) and that brought the values back in line.[quote=“Sw674954, post:401, topic:161175”]
The map is generating and showing on my dashboard. I took a screenshot of the floorplan from my app and loaded it into the vacuum directory as floor.png
[/quote]

Does the image.php correctly specify this file in the top parameters? Tried in private window/cleared cache?
Can you load the file directly via its URL?

You can just specify the card multiple times, and use different attributes for each

I don’t have one so will be hard to confirm :disappointed: I know there is a semi-active PR pair sitting on the dorita980/rest980 GH pages… but it’s not merged.

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