Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roborock statuses not being reported correctly in Home Assistant #141306

Closed
adamf83 opened this issue Mar 24, 2025 · 3 comments
Closed

Roborock statuses not being reported correctly in Home Assistant #141306

adamf83 opened this issue Mar 24, 2025 · 3 comments
Assignees

Comments

@adamf83
Copy link

adamf83 commented Mar 24, 2025

The problem

I have an automation that relies on getting the status of my roborock vacuum, in particular, determining when it transitions from "Returning to dock" to "docked". I have a wait for trigger step that waits for this and then runs subsequent actions when it triggers. This seems to have stopped working or is intermittent at best.

I created a similar automation to try and debug this by running similar actions and when the vacuum returns to the dock print the status of the it in a loop. What I am seeing is that when the vacuum is returning to the dock, the status is still being reported as "cleaning" and even when docked it takes some time before "docked" is reported, but it will on more than one occassion skip over "returning to dock". This was working in the custom integration before I switch to using the core integration and may have been working perfectly fine in the core integration up until recently (I only noticed today).

What version of Home Assistant Core has the issue?

core-2025.3.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Roborock

Link to integration documentation on our website

https://www.home-assistant.io/integrations/roborock/

Diagnostics information

roborock_debug.txt

config_entry-roborock-01JNPAE74XK2AGS0E27G595H1N.json

Example YAML snippet

alias: Vacuum Debug
description: ""
triggers: []
conditions: []
actions:
  - action: system_log.write
    metadata: {}
    data:
      level: info
      message: Starting Roborock Trigger Debug
  - action: input_boolean.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: input_boolean.kitchen_presence_override
  - data: {}
    action: script.set_vacuum_to_max_mop_off
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - target:
      device_id: 02edfd7f3c36bb2c9913f9fe11c08c65
    data:
      params:
        - segments:
            - 19
      command: app_segment_clean
    action: vacuum.send_command
  - target:
      device_id: 02edfd7f3c36bb2c9913f9fe11c08c65
    data:
      segments: 19
      repeats: 2
    action: roborock.vacuum_clean_segment
    enabled: false
  - delay:
      hours: 0
      minutes: 0
      seconds: 45
      milliseconds: 0
  - action: vacuum.return_to_base
    metadata: {}
    data: {}
    target:
      device_id: 02edfd7f3c36bb2c9913f9fe11c08c65
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - repeat:
      sequence:
        - delay:
            hours: 0
            minutes: 0
            seconds: 2
            milliseconds: 0
        - action: system_log.write
          metadata: {}
          data:
            level: info
            message: "{{ states('vacuum.roborock_s7_maxv') }}"
      count: 35
  - wait_for_trigger:
      - entity_id:
          - vacuum.roborock_s7_maxv
        from: returning
        to: docked
        trigger: state
    timeout:
      hours: 2
      minutes: 0
      seconds: 0
      milliseconds: 0
    continue_on_timeout: false
  - action: input_boolean.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: input_boolean.kitchen_presence_override
mode: single

Anything in the logs that might be useful for us?

Additional information

For some additional testing, maybe the calls to get the status of the vacuum don't happen often enough and it's possible for a vacuum to move from "cleaning" to "docked" from an HA perspective, I'm not sure.

@home-assistant
Copy link

Hey there @Lash-L, @allenporter, mind taking a look at this issue as it has been labeled with an integration (roborock) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of roborock can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign roborock Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


roborock documentation
roborock source
(message by IssueLinks)

@allenporter
Copy link
Contributor

Hi, let's avoid brining the automation and custom components into the discussion and focus on this:

  • in developer tools you can view the vacuum state
  • you can enable debug more for the integration and see the internal log messages
  • figure out what you expect the state to be at a particular time and what the state actually is at that time and we have associated log messages to see what is happening.

Can you provide that detail? We won't be able to debug a complex automation but we can make sure the device is in the right states it should be.

@allenporter
Copy link
Contributor

The vaccuum state is updated every minute:

2025-03-24 16:21:41.748 DEBUG (MainThread) [homeassistant.components.roborock.coordinator] Finished fetching roborock data in 0.164 seconds (success: True)
2025-03-24 16:22:40.905 INFO (MainThread) [homeassistant.components.system_log.external] cleaning
....
2025-03-24 16:22:41.748 DEBUG (MainThread) [homeassistant.components.roborock.coordinator] Finished fetching roborock data in 0.121 seconds (success: True)
2025-03-24 16:22:42.907 INFO (MainThread) [homeassistant.components.system_log.external] docked

So if it went to cleaning to returning to docked within that refresh interval then it won't be noticed. I think everything is working as expected and you need to make your automation more resiliant.

The next release does have some polling interval changes specifically for the local APIs to allow increased frequency, but the same issue can still happen so the point still remains.

Closing since everything is working as intended/implemented here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants