Hi, just wondering if you just used the logger code as suggested and roomba returned region ID?
I tried the same but for whatever reason there is no region ID being logged in debug.
Iâve managed to get the debug and last command working, but not sure how to use this to trigger the room specific cleaning? What would i need to put in the command/params box on the actions page to get this working?
I created a script for each room and put them as a button on my dashboard.
For example:
alias: Roomba Flur
sequence:
- target:
entity_id: vacuum.roomba
data:
command: start
params:
pmap_id: jfL4aTvJSzSlBdlDrte44A
regions:
- region_id: "7"
type: rid
user_pmapv_id: 241124T080112
action: vacuum.send_command
mode: single
icon: mdi:rectangle-outline
fields: {}
Be sure to use your own entity_id, pmap_id, region_id and user_pmapv_id from your log.
Thanks!
I was struggling and had almost exactly the same code but it wasnât triggering anything! Ended up using chatGPT and it must have been a formatting error or something as it produced pretty much the same code is written, except the strings were in quotations, and it worked.
Ended up creating 3 helper template buttons that I can add to my dashboard
Glad to hear.
Itâs also important to check the continuous-checkbox of the integration again.
As far as I know it is not possible to log the commands and being able to trigger the scripts at the same time because logging requires the checkbox to be off and the scripts require it to be on.
Hi Hildnero,
This was the best approach for me by far! I have all single room working now, but when I want to add multiple regions the script does nothing.
I have a setup like this
regions:
- region_id: "6"
type: rid
- region_id: "1"
type: rid
But when I run the script nothing happens. For the scripts with only 1 region everything works as it should.
Any ideas how to specify several regions for one script?
Best regards
Hi there, glad it helped!
I did not dive into that yet.
But the best approach would be to trigger the cleaning of your desired rooms in the iRobot app and then check what the log is saying.
I know that the app also passes multiple regions to a single command if you select more than one room. But maybe just in a different way than you are attempting.
Or maybe it passes anything like multiple_regions: true to the command?
Please keep me updated on that if you find a solution!
I am an idiotâŚ
I copy pasted the script for the rooms and forgot to change the entity to my roombas Id. Everthing is working, also multiple rooms ![]()
Best regards
Thank you jaaem, this is excellent.
In my case, 3 years later, I could not find the âirobot_base.pyâ file but found the âoldâ line in in vaccum.py so I went ahead and changed that file instead.
It works and I get the extended state! Next will be to actually use it for something.
Kind regards
heh I was in the same position the other day. I had copied and modified the integration to place the raw attributes in the device attributes quite some time ago and only the other day realized there had been some beneficial upstream changes since then. I pulled in the new code and made the change there so all is well.
I was considering a PR for the same but wanted to reach out to a code owner or someone to see if they felt it would be accepted before I jump through the hoops of becoming a contributor.
Philosophically I think it would be considered better form to create sensors for all the extra attributes weâre interested in but personally all I care about is lastCommand and its region list so I can watch for starts track when each region was last cleaned. I could add a âlast start regionsâ sensor which is a comma-delimited list of region types and numbers but am unsure whether this would be considered too much processing for an integration.
Theoretically it could go much further. Iâm actually tracking not only last region clean times but, for single region missions, also region clean duration. That way for a multi-region mission I can estimate the current region and mark it as successful based on elapsed time. This could all be done in the integration along with sensors for the durations, UI configuration of region/name mappings and actions for initiating missions with multiple regions.
I have a scripts for âclean the region which is the most over its maximum cleaning intervalâ and âclean all regions ordered by how far over their interval they areâ which would be greatly simplified by this.
I managed to bet a button working for a single room, but i would like to select multiple rooms (by clicking a button).
Could anyone point me in the right direction?
If you mean a way to trigger cleaning multiple rooms using only the UI it is possible. You wouldnât have a nice entity picker because rooms arenât entities, but you could create a script that had a boolean field for each room and could build the data for the vacuum start action based on them.
So something along the lines of
fields:
kitchen:
selector:
boolean: {}
name: Kitchen
default: false
living_room:
selector:
boolean: {}
name: Living room
vacuum:
name: Vacuum
description: Vacuum to control
required: true
selector:
entity:
domain: vacuum
sequence:
- variables:
regions: >
{% set ns = namespace(result=[]) %}
{% if kitchen %}
{% set ns.result = ns.result + [{'region_id': '13', 'type': 'region'}] %}
{% endif %}
{% if living_room %}
{% set ns.result = ns.result + [{'region_id': '14', 'type': 'region'}] %}
{% endif %}
{{ ns.result }}
- alias: Start vacuum
target:
entity_id: "{{ vacuum }}"
data_template:
command: start
params:
pmap_id: "YOUR LATEST PMAP HERE"
regions: "{{ regions }}"
The post is a little older but maybe it will still help someone. I have now installed this for myself and use the favorite rooms that I had already created. To use this, the command is as follows.
The other parameters are no longer needed as they are directly included in the favorites. @mehalter
service: vacuum.send_command
data:
entity_id: vacuum.roombie
command: start
params:
favorite: a0cbbe5ed955fc78681b98b8z9e8b214c20
This worked perfectly for me, only exception being the logs reported favorite_id instead of favorite, so I used that in the params sent to the robot.
Combo j5+ btw
Combined with @kb101010101âs tip to enable debug logging, this took less than 5 minutes to set up a script for.
Yea both works. Chatgpt said favorite ![]()
This is my full code now:
type: tile
entity: vacuum.noo_noo
name: Alles reinigen
features_position: bottom
vertical: false
show_entity_picture: false
hide_state: true
tap_action:
action: call-service
service: vacuum.send_command
service_data:
entity_id: vacuum.noo_noo
command: start
params:
favorite: a0cbb876876876876876b8e8b214c20
Wow favourites looks great. Presumably it abstracts floor and room so changing the map doesnât break automations. Looking forward to trying it!
This did the trick for me too. Awesome work guys!
Note that I had to use favorite_id instead of favorite.
- type: tile
entity: vacuum.roomba
name: Posprzataj parter
features_position: bottom
vertical: false
show_entity_picture: false
hide_state: true
tap_action:
action: call-service
service: vacuum.send_command
service_data:
entity_id: vacuum.roomba
command: start
params:
favorite_id: 5c85beaacd98e92f6adccfba2311b1b1
Hereâs a list of steps to retrieve the favorite_id from the HA roomba logs:
- Added the following section to configuration.yaml
logger:
default: warning
logs:
homeassistant.components.roomba: debug
- Enabled debug logging on IRobot integration
- Started Roomba cleaning cycle through the app (and stopped it after a minute)
- Disabled debug logging and located the favorite_id in the home-assistant_roomba log file
Kudos to @kb101010101 for the relatively elegant solution to specific room cleanings, works like a dream!
Iâm trying to now create an automation based on different buttons being pushed and am able to clean any single room when I hard code the region_id, however to clean it up a bit Iâm trying to parameterize it - no matter what I do I canât get the region_id to pass through to the integration with the single-quote which is causing the roomba to not properly receive the command. Is there a way to escape it so it goes through as say â1â instead of 1 or â1â?
alias: Main Floor Room Cleaner
description: Triggers main floor roomba to clean the selected room when a button is pressed.
triggers:
- entity_id:
- input_button.main_kitchen
- input_button.main_diningroom
- input_button.main_bathroom
trigger: state
actions:
- variables:
region_id: |
{% set map = {
'input_button.main_kitchen': '1',
'input_button.main_diningroom': '2',
'input_button.main_bathroom': '3'
} %} {{ map[trigger.entity_id] }}
- target:
device_id: <DEVICE ID REMOVED>
data:
command: start
params:
pmap_id: <HARD CODED PMAP_ID REMOVED>
regions:
- region_id: "{{ region_id }}"
type: rid
user_pmapv_id: <HARD CODED USER_PMAPV_ID REMOVED>
action: vacuum.send_command
enabled: true
- data:
title: Cleaning Started
message: >
Cleaning has started.
action: persistent_notification.create
mode: single

