Add support for irobot roomba clean specific room

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

7 Likes