iRobot Roomba i7+ Configuration using Rest980

in /packages:

vacuum.yaml: #################################### iRobot Vacuum Package################## - Pastebin.com
vacuum2.yaml: #################################### iRobot Vacuum2 Package################# - Pastebin.com

in /vacuum:

image.php: <?php//error_reporting(E_ALL);//ini_set('display_errors', 1);// ADJUST T - Pastebin.com
image2.php: <?php//error_reporting(E_ALL);//ini_set('display_errors', 1);// ADJUST T - Pastebin.com

secrets.yaml (in config foldder just outside the 2 other folders): #################################### Secrets################################ - Pastebin.com

do everything look ok? i still need to upload the floorplan for each bot and adjust offset and get room info

the dashboard… the vertical stack card: type: vertical-stackcards: - entity: sensor.vacuum2 type: custom:roomb - Pastebin.com

  - input_boolean.vacuum_clean_bedroom
  - input_boolean.vacuum_clean_office

should i replace all .vacuum with .vacuum2 ?

instead create a folder called packages in your config folder, move the vacuum.yaml file into this packages folder and replace with this

Thanks a lot, man, that was it! Now I see it.

1 Like

yes, so I have a vacuum.yaml and mop.yaml for each of the robots

yep, i realised that in my vaccum directory on the repo, i didnt include the mop.php files, but essrntially its a duplication of the image.php will the paramters changed (you will likely need to change the offsets also, etc - dependant on how the robot tracks the data - once we have it again in the firmware!)

yes, in my example, the vacuum.yaml automations write to vacuum.log and mop.yaml writes to mop.log (as listed in the secrets.yaml)

at a high level glance, it seems ok - are you seeing any errors ? other than the map not populating.

this list will need to reflect the rooms you have which are listed in the vacuum2.yaml file (and the names need to be unique from rooms in vacuum.yaml

also - make sure that the group.vacuum_rooms is duplicated and contains only the relevant rooms for each of the robots, as this is used to control the lock/unlock mechanism on the lovelace card

does this make sense?

yes, just me that are insecure on things, but if you upload (when time allows) the mop files i can compare to those and i hope the last bits of the puzzle in my head falls in place

nope no errors, and yes only the maps are missing as i need to generate them

I see that the built-in schedule somehow takes into account vacation. How does that work? How can I tell the system when my vacation is? Maybe I would like to change it to something like nobody’s at home - clean, otherwise don’t clean. And base it on the HA presence detection of people in HA. Would that be possible?

I have an input_boolean on my system which enables/disables vacation mode :wink: nothing fancy unfortunately

yes you can, I use the HA Companion mode app to detect presence of people and you can simply have an automation condition or trigger to execute when, for example, everyone is out

1 Like

Another problem with the map… Where am I supposed to see the map? On the lovelace dashboard provided by you via the lovelace.yaml file? I don’t see it there. But anyway if I open 192.168.89.241:3001/image.php manually, I see just an error message

No Coordinates found in file, is it reachable and populated? Log file - http://192.168.89.241:3001/vacuum.log?

If I download the log, it is empty (and even in the vacuum directory the file has 0 kB).

I suppose that the error message refers to the coordinates that we get in the step 5 and fill to the secrets.yaml file in the step 6. I did that. But I used the default (“global”) secrets.yaml file that I use also for other secerts in HA in general that is stored in /home/secrets.yaml. I simply copied the the first part of your secrets file (because I don’t have a mop) and placed it to my /home/secrets.yaml like this

# Vacuum
vacuum_state: http://192.168.89.241:3000/api/local/info/state
vacuum_action: http://192.168.89.241:3000/api/local/action/
vacuum_verify_ssl: false
vacuum_notify: notify.mobile_app_lukas_iphone # You can also use a notify group here
vacuum_map: http://192.168.89.241:3001/image.php
vacuum_log: /config/vacuum/vacuum.log
vacuum_dir: /config/vacuum
vacuum_kitchen: '{"region_id":"10","type":"rid"}'
vacuum_entry: '{"region_id":"9","type":"rid"}'
vacuum_hall: '{"region_id":"4","type":"rid"}'
vacuum_living_room: '{"region_id":"6","type":"rid"}'
vacuum_bedroom: '{"region_id":"12","type":"rid"}'
vacuum_bathroom: '{"region_id":"8","type":"rid"}'
vacuum_master_bedroom: '{"region_id":"11","type":"rid"}'

Should it be somewhere else? Or is the error message referring to something completely different?

Thank you for the help. After going through the configuration documentation I noticed that I had forgotten to update the secret.yaml since I had listed the IP address for the Roomba and not for Home Assistant. After updating the IP address I am now able to see the sensor.rest980 and sensor.vacuum and there’s information populating on the lovelace GUI.

I am running my first full clean now that the sensor is available. As of now the location sensor is not providing any information besides “n-a”, I’m unable to access http://IP-HA:rest980-Port/apli/local/action and there’s no log being created yet but I’ll wait and see if it populates once the full clean is completed.

I just got the same error. it looks like the rest URL → http://192.168.2.30:3001/api/local/info/state
returning the json object is missing 1 json attribute “pose” (underneath this is what gives us the coordinates)

I’ve had this happen in the past, restarting a clean cycle fixed it in the past, no luck today.
restarted HA no luck, then I even re-downloaded and restarted the docker image koalazak/rest980:latest no luck. viewed the URL http://192.168.2.30:3001/api/local/info/state
in firefox to format json, still not there.

this could be related to a software update that now doesn’t expose x,y,theta data, or we have to soft reboot the iroomba necessary after software update. I have to find which button combinations that was again to reboot it but not reset it. it does look like Roomba software was updated on 11/10/21 to version 3.20.7 in the iphone app.

in the URL the softwareVer json attribute has this as version “lewis+3.20.7+lewis-release-rt421+11”

edit

soft reboot of roomba didn’t work,
and it looks like this issue was mentioned earlier in this thread

probably roomba didn’t push the firmware to everybody at the same time.
we’ll have to wait for a fix if possible to be implemented in dorita980 that the rest980 is based on.

@Syrius

need some more help to get it all going

the 2 bot’s report fine on state… ie http://192.168.0.9:3002/api/local/info/state and http://192.168.0.9:3000/api/local/info/state

but when i click action i get “Not Found” ie on http://192.168.0.9:3000/api/local/action/ and http://192.168.0.9:3002/api/local/action/

when i visit the map link http://192.168.0.9:3003/image.php or http://192.168.0.9:3003/image2.php i get this error

Warning: Undefined variable $robot_log in /config/vacuum/image.php on line 56

Warning: file_get_contents(?v=1638291823): Failed to open stream: No such file or directory in /config/vacuum/image.php on line 56

Warning: Undefined variable $robot_log in /config/vacuum/image.php on line 62
No Coordinates found in file, is it reachable and populated? Log file - ?

there are 2 log files, one is empty and one only have a stuck line in it

Home Assistant notifications (Log started: 2021-11-30T15:48:50.182892+00:00)

Stuck

maintenance also works fine in the dashboard and the 2 bot’s do report different status and their statistics also match up

secrects.yaml: #################################### Secrets################################ - Pastebin.com
image.php: <?php//error_reporting(E_ALL);//ini_set('display_errors', 1);// ADJUST T - Pastebin.com
image2.php: <?php//error_reporting(E_ALL);//ini_set('display_errors', 1);// ADJUST T - Pastebin.com
vacuum.yaml: #################################### iRobot Vacuum Package################## - Pastebin.com
vacuum2.yaml: #################################### iRobot Vacuum2 Package################# - Pastebin.com

@Syrius

Greetings Syrius.

For a while, everything was fine and it worked reliably. Then came something that partially shattered integration. My Roomba i7 doesn’t show me the map right now.
I read this topic, where some have the same problem, but for me the solution did not help me to correct and display the map.
I have add-ons installed
php-nginx Docker Image (3001)
and
rest980 Docker Image (3000)
Roomba i7 does its job normally, Selective room cleaning works flawlessly.
He just doesn’t draw the map.
Sending localized files:
package
image.php
secrets
Could you please check why I don’t have a map?
Thank you very much.

image.php
secrets.yaml
vacuum.yaml

map is broken right now → ref

map is broken right now → ref

map is broken right now → ref

in lovelace? you need to add the robot_action attribute to the camera card to point at the right one

looks like your image.php file is inconsistent - line 6 is $vacuum_log and line 56 is looking for $robot_log

note - the map still isnt working lol

no on this link: http://192.168.0.9:3000/api/local/action/ and this one http://192.168.0.9:3002/api/local/action/

must have been when i copied over old settings

the logs are not being filled, so what could be wrong there? did a full clean from the dashboard just to check, but its the same if i do a clean from the app

could this be why the log is not filled? if so do you have some dummy data we can use to test that things are working/setup correctly?

Hi.

How do I turn ordered cleaning? I found this in FAQ

  • Turn on Input Boolean (e.g. input_boolean.vacuum_clean_kitchen)

But honestly I have no idea how to do that :slight_smile: Can I please get the steps in a “newbie form”? :slight_smile: I want to simply clean all rooms, but in a defined order. Because now my Roomba i7 cleans the rooms in a weird random order and travels unnecessarily from one side of the house to the other.

I have this in the vacuum.yaml file.

  # Add Rooms for Ordered Cleaning
  - alias: Vacuum Add Rooms for Cleaning
    initial_state: true
    trigger:
      platform: state
      entity_id: [
        'input_boolean.vacuum_clean_bedroom',
        'input_boolean.vacuum_clean_bathroom',
        'input_boolean.vacuum_clean_hall',
        'input_boolean.vacuum_clean_entry',
        'input_boolean.vacuum_clean_living_room',
        'input_boolean.vacuum_clean_kitchen',
        'input_boolean.vacuum_clean_master_bedroom'
      ]
      to: 'on'
    action:
      service: input_text.set_value
      data_template:
        entity_id: input_text.vacuum_rooms
        value: |
          {% set room = trigger.entity_id %}
          {% set room = room.replace("input_boolean.vacuum_clean_","") %}
          {% if ((states('input_text.vacuum_rooms') == "unknown") or (states('input_text.vacuum_rooms') == "")) %}
            {{ room }},
          {% else %}
            {{ states('input_text.vacuum_rooms') }}{{ room }},
          {% endif %}

So I assume the order is defined. But how to execute it? If I just click the “Full clean” button, it does not follow the order of rooms and selects rooms somehow randomly.
image

And just found one more issue. I suppose that when the i7 is stuck, it should send a notification with a picture from the camera. It sends notification to my iPhone, it does not send the picture though. First I get just the notification saying stuck, then after 5 seconds I get another notification saying Robot is stuck. But the second notification should be with a photo, correct? because if I open the second notification, there is no picture and moreover I see failed login attempt in HA notifications. Which is weird. Any idea why and how to fix it?

a live feed from the camera would be nice, @Syrius is that even possible?

due to a recent roomba firmware update now x,y,theta positional data is not exposed anymore, without it the map has no data to draw, so the notification is not going to show you where the vacuum got stuck. We’ll have to wait for someone to figure out where to get the positional data again or roomba exposes the data again in a future firmware update.

hence i asked if we could have some dummy data to test that our setup is ok and its just the missing data that prevents everything from working as it should

Hello @Syrius ,

I have an iRobot Roomba j7+ and followed your configuration guide but I can’t manage to have sensor.vacuum working. Below steps, I followed and errors I’m getting:

1 - Installed all required cards
2 - My j7+ doesn’t have a home button, so I used following python script to retrieve credentials:

!/usr/bin/env python3

import random
import requests
import time

apikey = "3_rWtvxmUKwgOzu3AUPTMLnM46lj-LxURGflmu5PcE_sGptTbD-wMeshVbLvYpq01K"

data = {"apiKey": apikey,
        "targetenv": "mobile",
        "loginID": "<MY_LOGIN>",
        "password": "<MY_PASWORD>",
        "format": "json",
        "targetEnv": "mobile",
        }

r = requests.post("https://accounts.us1.gigya.com/accounts.login", data=data)

response = r.json()

data = {"timestamp": int(time.time()),
        "nonce": "%d_%d" % (int(time.time()), random.randint(0, 2147483647)),
        "oauth_token": response['sessionInfo']['sessionToken'],
        "targetEnv": "mobile"}

uid = response['UID']
uidSig = response['UIDSignature']
sigTime = response['signatureTimestamp']

data = {
    "app_id": "ANDROID-C7FB240E-DF34-42D7-AE4E-A8C17079A294",
    "assume_robot_ownership": "0",
    "gigya": {
        "signature": uidSig,
        "timestamp": sigTime,
        "uid": uid,
    }
}

r = requests.post("https://unauth2.prod.iot.irobotapi.com/v2/login", json=data)

response = r.json()
for robot in response['robots']:
    print("BLID:", robot, "Password:", response['robots'][robot]['password'])

That provided me following output:

BLID: <BLID_VALUE> Password: <PASSWORD_VALUE>

3 - Created Vacuum Map Directory as required
4 - Installed, configured and startted HA Addons.
5 - Query to /api/local/info/state returns

{}

Query to /api/local/action/ gives me following error on logs:

GET /api/local/action/ 404 3.841 ms - 136
Error: Endpoint not found.
    at /usr/src/app/app.js:63:13
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)
    at /usr/src/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at /usr/src/app/node_modules/express/lib/router/index.js:635:15
    at next (/usr/src/app/node_modules/express/lib/router/index.js:260:14)
    at Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3)
    at router (/usr/src/app/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)
    at /usr/src/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at /usr/src/app/node_modules/express/lib/router/index.js:635:15
    at next (/usr/src/app/node_modules/express/lib/router/index.js:260:14)
    at jsonParser (/usr/src/app/node_modules/body-parser/lib/types/json.js:110:7)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)
    at /usr/src/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)

6 - Completed without a problem
7 - Skipped for now
8 - Completed but card shows empty because sensor.vacuum is UNKNOWN.
8 - 10 - Skipped
12 - Completed without a problem.

Now for some reason I can’t get sensor.vacuum to work. I used to have built-in integration but removed and rebooted HA after reading this post but that didn’t fix the issue.

Any assistance would be highly appreciated.

Thanks

Have you also installed the official integration, or do you use other smarthome hubs with your roomba? This would be a problem.