Roomba and Home Assistant Setup
These instructions assume that you have Docker installed and running.
I looked at a few different instructions, but used the method shown here:
https://blog.hessindustria.com/home-assistant-roomba-s9-integration/
You need to get a special password to add your Roomba to HA.
This is how I got the password and BLID from my Roomba I8. I tried a couple other methods, where you have to push the home button on the Roomba for 20 secs until it makes a noise, but they didn't work.
This method doesn't require you to push a button, you just run the following. Roomba user name and password in the following are what I used to log into my Roomba account.
But you do need docker installed on the Pi running HA.
I started a ssh connection with my HA PI using terminal (Mac) and entered this:
docker run -it node sh -c "npm install -g dorita980 && get-roomba-password-cloud Roomba_UserName Roomba_Password"
It will take a while because it needs to install some stuff to run this program.
Response:
Found 1 robot(s)!
Robot "Roomba" (sku: i855020 SoftwareVer: lewis+22.21.1+2022-06-02-570490a425b+Firmware-Build+1339):
BLID=> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Should be 32 chars long I think
Password=> :1:1640219538:xxxxxxxxxxxxxxxx <= Yes, all this string. Should be 30 chars
Now in Home Assistant, go to Settings, Devices & Services, find Roomba (or add integration and add it), Configure and then use the above for the Password. It might try to get the password automatically, that didn't work for me but you can let it try, just takes a minute and no harm.
After you enter the password, it should find and connect to your Roomba
If you click on "1 Device" in the Roomba square, you will get the above.
Add Controls and Sensors to your dashboard.
I made a Roomba page.
Clicking on Roomba I8 at bottom of first box shows this.
https://community.home-assistant.io/t/add-support-for-irobot-roomba-clean-specific-room/260650/4
and https://blog.hessindustria.com/home-assistant-roomba-s9-integration/
Close the iRobot mobile app and temporarily turn off the “Continuous” setting for the iRobot integration in Home Assistant. This will ensure nothing is connecting locally to the Roomba.
Open the iRobot mobile app and start a clean job for a specific room.
Replacing <BLID> , <PW>, and <IP> with your own values, run the following:
sudo docker run -e BLID='<BLID>' -e PASSWORD='<PW>' -e ROBOT_IP='<IP>' -it -w /root node sh -c "npm install --silent --no-progress dorita980 && node -e \"var dorita980 = require('dorita980'); var robot = new dorita980.Local(process.env.BLID, process.env.PASSWORD, process.env.ROBOT_IP); robot.getRobotState(['lastCommand']).then((st)=> { console.log(st.lastCommand); process.exit(0); });\""
Pi will sit for a few minutes, then show something like this:
{
command: 'start',
initiator: 'localApp',
time: 1664639748,
pmap_id: 'your pmap id',
regions: [ { params: [Object], region_id: '1', type: 'rid' } ],
favorite_id: 'long number, not sure what it means',
ordered: 1,
robot_id: 'robot id is the BLID',
user_pmapv_id: '220929T141846',
params: null
}
If you ask to clean two rooms, regions looks like this
regions: [
{ params: [Object], region_id: '3', type: 'rid' },
{ params: [Object], region_id: '15', type: 'rid' }
],
You will need to use pmap_id, region_id and type
Note pmap_id, regions and user_pmapv_id in the output. The regions object will correspond to the room you started the vacuum job for in step #2 above.
Turn back on the “Continuous” setting for the iRobot integration in Home Assistant.
Create Cards to Clean a Room
To add a button card, you may need to
Go to HACS and Frontend and "+ EXPLORE & DOWNLOAD REPOSITORIES" (lower right)
Select + EXPLORE and search for button-card. Add it.
button-card (RomRider)
Now to add a button card, I went to my Roomba Lovelace page, Edit Dashboard
Add a Button Card, Show Code Editor, delete what it shows and insert:
type: button
tap_action:
action: call-service
service: vacuum.send_command
service_data:
entity_id: vacuum.roomba_i8
command: start
params:
pmap_id: 'your pmap id'
regions:
- region_id: '5'
type: 'rid'
name: Clean Kitchen
icon: mdi:robot-vacuum
Entity ID can be found in HA States page in Developer Tools
pmap_id, region_id and type are from previous step
Name is button label
Need Python, so need to enable it in HA
Edit configuration.yaml and add this
# Python Scripts Enable:
python_script:
Restart HA or Pi to enable Python
Go to HACS and Frontend and "+ EXPLORE & DOWNLOAD REPOSITORIES" (lower right)
Need to push + EXPLORE button for every one
roomba-vacuum-card (jeremywillans)
card-mod (custom cards)
check-button-card (thomasloven)
lovelace-fold-entity-row (thomasloven)
text-divider-row (iantrich)
button-card (RomRider)
lovelace-state-switch (thomasloven)
select-list-card (mattieha)
https://community.home-assistant.io/t/add-support-for-irobot-roomba-clean-specific-room/260650/4
and https://blog.hessindustria.com/home-assistant-roomba-s9-integration/
Open the iRobot mobile app and start a clean job for a specific room.
Close the iRobot mobile app and temporarily turn off the “Continuous” setting for the iRobot integration in Home Assistant. This will ensure nothing is connecting locally to the Roomba.
Replacing BLID , PASSWORD, and ROBOT_IP with your own values, run the following:
docker run -e BLID='1B166A0FNOTREALA9B1FA' -e PASSWORD=':1:1706623241:NOTREALUmdqQ' -e ROBOT_IP='192.168.1.78' -it -w /root node sh -c "npm install --silent --no-progress dorita980 && node -e \"var dorita980 = require('dorita980'); var robot = new dorita980.Local(process.env.BLID, process.env.PASSWORD, process.env.ROBOT_IP); robot.getRobotState(['lastCommand']).then((st)=> { console.log(st.lastCommand); process.exit(0); });\""
Note pmap_id, regions and user_pmapv_id in the output. The regions object will correspond to the room you started the vacuum job for in step #2 above.
Turn back on the “Continuous” setting for the iRobot integration in Home Assistant.
Call the vacuum.send_command in Home Assistant using the following format:
service: vacuum.send_command
data:
entity_id: vacuum.roombie
command: start
params:
pmap_id: ohG_V5NOTREALRnAvsFkqw
regions:
- region_id: '27'
type: rid
user_pmapv_id: 1105NOTREAL07
Download zip file from
https://github.com/jeremywillans/ha-rest980-roomba
You need to select the green Code button, then Download Zip at the bottom of the popup.
Unzip. This made a ha-rest980-roomba-master folder. Copy the contents of the Vacuum directory into a different folder. I copied to the home assistant configuration folder (where the configuration.yaml file is located). So you should have a Vacuum subdirectory in your HA folder.
Run Docker Compose
I renamed docker-compose.yaml to docker-compose-vacuum.yaml in the ha-rest980-roomba-master folder from the unzip above.
Copied to where Docker is setup.
Edit this file, and fill in password, BLID (from above) and ip address
Change line after Volumes to point to vacuum directory
volumes:
- /<HA CONFIG PATH>/vacuum:/app
HA card info
Clean Randy Room
pmap_id: f_2Ct2KTSnu49aiIbP__3w
regions:
- region_id: "5"
type: rid
Clean Jane,Dining,Living, Entry
pmap_id: f_2Ct2KTSnu49aiIbP__3w
regions:
- region_id: "4"
type: rid
- region_id: "19"
type: rid
- region_id: "18"
type: rid
- region_id: "1"
type: rid
Clean Kitchen, Family
pmap_id: f_2Ct2KTSnu49aiIbP__3w
regions:
- region_id: "3"
type: rid
- region_id: "15"
type: rid