Getting a Roomba J7+ to stop auto-emptying into the vacuum base

I’m trying to do something that is, I feel, fairly simple: Change a setting on my Roomba (evacAllowed) to false. That’s it.

I’ve already got my Roomba set up on my HA and can control it through that. But I’m trying to get the Python API to work and I am at an utter loss. I know that the HA integration is based on Dorita980-Python, and under that Github docs it has the method stub set_preference(preference, setting) right next to set_command(command).

I’ve been following along with a blog post I found about cleaning specific rooms with Roomba, and modeling my code off of his, I’ve tried a few things (such as)

 payload = {
          'entity_id': 'vacuum.name',
          'params': {
               'preference': 'evacAllowed',
               'setting': False
         }
    }
    
hass.services.call('vacuum', 'set_preference', payload, False)

But I get an error:

Error executing script: Unable to find service vacuum.set_preference

Now, I’m almost certainly reading the docs wrong. But the thing is the docs are blank. Like there is genuinely no documentation for this stuff. If I go to the hass object docs page and then click on any of the “See Available Methods” urls, I get a blank documentation page. No methods. No docs. Nada. So I’m really at a loss, anyone who could point me in the right direction would be an immense help.

with hass.services.call you’re invoking an home assistant service and there is no vacuum.set_preference service. You can check the available services from the Developer Tools > Services. You’ll notice that under vacuum.* you don’t have a set_preference, but you have a send_command. Most probably what you need to do is to check which command you should send setting the preference via the iRobot mobile app then checking the history of your robot with dorita980 (robot.getRobotState(['lastCommand'])), then using the vacuum.send_command just like you are doing for cleaning specific rooms.

Has anyone found a solution? Just received my Roomba, but the auto-emptying prevents me from using the Roomba at night…
I’m surprised that this does not seem to annoy many users!

Not sure if it’s needed anymore, but the following solution has been working well for me. I have placed a motion sensor inside the cat litter tray, and whenever my cat uses it, the Roomba automatically cleans the area around it. The primary challenge with this idea was nighttime cleaning, as the Roomba can be quite loud, especially when you live in a building with other people. After discovering how to set evacAllowed to false, I scheduled it to empty itself every day at 7 pm, ensuring it doesn’t get full.

callService:

this.hass.callService('vacuum', 'send_command', {
    props:{
        entity_id: entity_id,
        command:'delta',
        params: {
            state: {
                evacAllowed: true
            }
        },
    },
})

or in automation yaml:

alias: Vacuum send emptying command
description: ""
trigger: []
condition: []
action:
  - service: vacuum.send_command
    data:
      command: delta
      params:
        state:
          evacAllowed: false
    target:
      entity_id: entity_id
mode: single

I thought I’d add this for anyone who may stumble on this thread in the future. I have spent a ton of time trying to control the bin empty on my J6 (basically a J7) as I control it solely through homeassistant automations. I can say with some pretty good certainly that it is not possible to prevent the bin empty process through homeassistant alone.

That said, I did find a work around that works great with my use case. Basically, you schedule a do not disturb schedule through the roomba app that covers the entire day (basically, you’re always in do not disturb). This has no effect on the HA automations sending commands to the roomba, but does prevent the roomba from emtpying its bin automatically when it docks. You do still have the ability to send a “return to dock” command when the roomba is already docked, this triggers it to empty the bin.

Using this approach, I simply set up an if block at the end of my automation that will trigger this “manual” bin empty on certain times (or controlled via a helper toggle switch).