Add support for irobot roomba clean specific room

Hi,

[update] Solved on my own- I indeed use the wrong container. Using “-it homeassistant” worked fine.

I am struggling in getting the credentials in step 1 (BLID and password).

I checked the referenced link where it says to start the following command for Home Assistant Container.

docker exec -it CONTAINER_NAME_OR_ID python -c 'import roombapy.entry_points; roombapy.entry_points.password()' ROOMBA_IP

Unfortunately I am getting this back:

Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'roombapy'

I am pretty sure I used the correct container. I have installed my HA as HassIO image as a virtual machine.
To find the correct ID I logged in to the console (with “login”) and check the available containers (sorry, just as screendump picture). Should I have to use a different container?

Thanks for all your further ideas!

/KNEBB

Unfortunately I have to state step 1 is still not working.

I press the Home button on my Roomba S9+ and wait until the sound appears. Immediately after I start the command on HOASS.

But whatever I do I am getting “Connection refused”.

And yes, it is the correct IP of my Roomba:

<inside of the container> 
python -c 'import roombapy.entry_points; roombapy.entry_points.password()' 192.168.22.50

Any ideas what is wrong here?

Thanks!

/KNEBB

Is there a way to do this without providing the user_pmapv_id? It seems that after each run the roomba continues to learn and the user_pmapv_id changes to the time the map updated causing my previous scripts to not work anymore.

Hi,

Is there any way for it to work without installing docker? I have installed HA flashing the image with
Balena Etcher, not installing the container and now I don’t know how to proceed everytime someone writes about installing something with docker…

Thank you,

5 Likes

HassOS is installed using docker. you can possibly access port 2222 in order to access the host. I caution when you’re using this as you can royally screw up your system if you dont know what you’re doing. you can run docker commands there.

Whilst not using the native solution, I did write some instructions for achieving this using rest980 as a HA Addon/Docker Container.

I’m getting an ‘access denied’ response when clicking on your link. Unsure if its something I’m doing.

Sorry I messed up the link, fixed now

Thank you very much!! I had seen your solution but I thought it was necessary to use docker too. I’m a Windows boy and, for now, Linux is something very strange for me. I’m working on it …

I have been able to install your add-on and it works very well. Now I’m trying to do my own configuration.

1 Like

See step by step tutorial and script for queuing room/zones in home assistant here: Home Assistant Roomba S9 Integration With Room Selection

1 Like

This is infuriatingly complicated. I would love to get this to work, but cannot justify the many hours and days it will take. What a shame it isn’t easier to achieve.

2 Likes

I just did this today with no issues. Worked exactly as described.

For anyone who stumbles onto this frustrated that the link by posted on January 24th by Joshua Hess doesn’t work when you get to the docker commands, if you have a Roomba J7+ you need to add one more environment variable to the command: ROBOT_CIPHERS='TLS_AES_256_GCM_SHA384'

2 Likes

I am super excited about this. Once the battery charges back up, I am running that command and creating an automation that counts the motions in each room (plus each room gets one motion per day to make sure under-utilized rooms get some attention) to automatically vacuum the most accumulated used room every day when I am at work. Prevents bins from getting full and failing on the whole job.

1 Like

This is difficult but BRILLIANT!! Thank you for posting.

I found a way easier way to find the rooms than using docker/node. Thanks to bradymholt for figuring out the service commands. The integration has all the information you need, but it is not exposed! This will preserve your old configuration. I perhaps will try a PR to the built-in integration, but this give you all the information you need:

Download the the homeassistant core from github (click Code Button, Download Zip):
https://github.com/home-assistant/core

Unzip the core-dev.zip core-dev/homeassistant/componets/roomba folder to
config/custom_components/roomba

edit the manifest.json to add this line above the dhcp line:
"version": "1.0",

edit the irobot_base.py file around line 178:

old line:
state_attrs = {ATTR_SOFTWARE_VERSION: software_version}
replace with
state_attrs = {ATTR_SOFTWARE_VERSION: software_version,"RAW_STATE": state}

save and restart homeassistant. The roomba state will now have the entire state available in the attributes. Seach for the lastCommand line.

You could also make a specfic lastcommand (or anyother state) state if you want to:
state_attrs = {ATTR_SOFTWARE_VERSION: software_version,"lastCommand": state.get("lastCommand"),"RAW_STATE": state}

There is a ton of information in the raw state.
edit: seems the irobot_base.py is only called when docked. If want live you need to add the command into either roomba.py, brava.py (also for the j7Combo), etc. Eg if have brava.py add a line at 134 which has:
state_attrs["raw_state_2"] = state

6 Likes

I can get the BLID and PASSWORD but am unable to get the pmap_id, regions, and user_pmapv_id

When running the command in Step 5 I am displayed with the following:

npm notice npm notice New major version of npm available! 8.5.5 -> 9.1.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.1.2 npm notice Run npm install -g [email protected] to update! npm notice

Then nothing happens. I tried to update but apparently, npm isn’t a valid command on my HA.

Hi guy’s … you did an amazing investigation job on the iRobot…

I have been struggle myself for a little while trying to make something to work on mine without succeeding anything brillant. With everything mentioned above I’m still having two questions based on my HA installation.

Rapsberrypi 4 I think
Running HASSIO

  1. Docker: When you mentioned to make sure Docker is installed & running, does that statement apply to HASSIO 2022.12 version ?
  2. iRobot: You are underlying the i7, i9 … does that solution can also be apply to the iRobot i4+

I got the first part working and I see the extended state. But I don’t understand the edit: what is the dictionary key ‘raw_state_2’, where is it coming from? And why do I set it to state, where is that variable coming from? I don’t see it in the roomba.py extra_state_attributes() function. Thanks.

Ah, I see in braava.py that state comes from self.vacuum_state, so I changed that. Still don’t know what the key " raw_state_2" means. Can I just set it and that works?