I’ve found a way to log the roomba commands to the home assistant log without needing to modify the roomba python files and add them to the custom_components folder.
Its possible to enable Debug logging for the existing roomba component using the Home Assistant logger
https://www.home-assistant.io/integrations/logger/
I added the following code to my configuration.yaml
# Logger:
logger:
default: info
logs:
homeassistant.components.roomba: debug
This will now log out debug information when the roomba integration interacts with the robot. It will log out the IP address(es) of the robot(s) and all commands sent to the robot(s)
Restart Home Assistant.
Trigger a clean for the roomba via the Roomba app
Check the Home Assistant logs
2024-01-02 15:17:05.899 DEBUG (Thread-3 (_thread_main)) [homeassistant.components.roomba.irobot_base] Got new state from the vacuum: {‘state’: {‘reported’: {‘lastCommand’: {‘command’: ‘start’, ‘favorite_id’: None, ‘initiator’: ‘rmtApp’, ‘ordered’: 1, ‘params’: None, ‘pmap_id’: ‘TlX_nz0ZR1111111111111’, ‘regions’: [{‘params’: {‘noAutoPasses’: True, ‘twoPass’: False}, ‘region_id’: ‘6’, ‘type’: ‘rid’}], ‘time’: 1704208626, ‘user_pmapv_id’: ‘236573T123456’}}}}
The lastCommand object is logged out each time a new command is issued to the robot. E.g. start, pause, cancel etc.
This should work for both Roomba and Braava mops.
Once you have the id’s of all the rooms, then the logging level can be set back to default level to avoid filling the logs with unneeded log messages.
NOTE - if you have edited the python code for the roomba component and added the files to the custom_components folder, then you will need to delete this folder so that the default roomba component bundled with Home Assistant is used.