Robot Vacuum Auto Status Update (Wyze Robot Vac)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
Purpose

This blueprint auto-updates the status of your Wyze Robot Vacuum (and probably vacuums).

Picture of the Vacuum. Check to confirm you have this one.

Why

The Wyze Robot Vacuum can be integrated into Home Assistant with the GitHub - romedtino/simple-wyze-vac: Home Assistant Custom Component for Wyze Vacuum. Thank you @romedtino for your work. But due to abuse/overuse of the undocumented API the developers of the various Wyze integrations had to remove the auto-polling mechanisms (allows you to see current state in Home Assistant). See here if you want to read more. Because of this we as a community using the unofficial API must be careful about over using the status update polling.

This Blueprint allows you to enable auto-polling but in a more courteous manner by limiting the status updates to only as often as you need. I’ve included suggested default times, if you think a different default would be better please let me know.

Blueprint

Pre-requisite: You must have the Wyze Robot Vacuum integration installed. I only tested this with GitHub - romedtino/simple-wyze-vac: Home Assistant Custom Component for Wyze Vacuum

blueprint:
  name: 'Wyze Robot Vacuum State Sync'
  author: noblewolf
  description: Update the state of the Wyze Robot Vacuum periodically with the option of less frequent updates while it is not running.
  domain: automation
  input:
    vacuum_name:
      name: Your Wyze Robot Vacuum
      description: Choose one Wyze Robot Vacuum per blueprint.
      selector:
        entity:
          domain: vacuum
    refresh_time_not_docked:
      name: How often should status be refreshed when running and charging?
      description: "Choose in minutes. Suggestion is 2 minutes. This will update the status periodically while the vacuum is not docked and charge is less than 100%."
      default: 2
      selector:
        number:
          min: 1
          max: 60
          step: 1
          unit_of_measurement: "minute(s)"
          mode: slider
    refresh_when_docked:
      name: Should the status update when docked and fully charged?
      description: Turn this on if you plan to also use the Wyze app to control your vacuum. Otherwise leave off.
      default: false
      selector:
        boolean:
    refresh_time_docked:
      name: How often should status be refreshed when docked? (optional)
      description: Choose in minutes. Suggestion is 10 minutes. Please update as only as often as you think necessary to avoid Wyze blocking your IP address.
      default: 10
      selector:
        number:
          min: 1
          max: 60
          step: 1
          unit_of_measurement: "minute(s)"
          mode: slider
trigger:
  - platform: state
    entity_id: !input vacuum_name
  - platform: homeassistant
    event: start
variables:
  refresh_docked_bool: !input refresh_when_docked
action:
  - service: vacuum.send_command
    data:
      command: update
    target:
      entity_id: !input vacuum_name
  - choose:
    - conditions:
        - condition: and
          conditions:
            - condition: state
              entity_id: !input vacuum_name
              state: docked
            - condition: template
              value_template: '{{ refresh_docked_bool }}'
      sequence:
        - repeat:
            while:
              - condition: state
                entity_id: !input vacuum_name
                state: docked
            sequence:
              - delay:
                  hours: 0
                  minutes: !input refresh_time_docked
                  seconds: 0
                  milliseconds: 0
              - service: vacuum.send_command
                data:
                  command: update
                target:
                  entity_id: !input vacuum_name
    default:
      - repeat:
          until:
            - condition: and
              conditions:
                - condition: state
                  entity_id: !input vacuum_name
                  state: docked
                - condition: state
                  entity_id: !input vacuum_name
                  state: '100'
                  attribute: battery_level
          sequence:
            - delay:
                hours: 0
                minutes: !input refresh_time_not_docked
                seconds: 0
                milliseconds: 0
            - service: vacuum.send_command
              data:
                command: update
              target:
                entity_id: !input vacuum_name
mode: restart

After you add this Blueprint

After you import and set up this Blueprint I suggest you click “Run Actions” on the automation to start the automation running.

Check out my setup

Here is how I set up my Wyze Robot Vacuum: Wyze Robot Vacuum - My Setup

Changelog

2021, Nov 20

Initial commit.

6 Likes

Thanks so much for putting this together, I just deployed it in my instance and seems to work great!

1 Like

Is anyone else having any issues with the Wyze Vac state not updating? The integration seems to be working fine with HA, but this Blueprint hasn’t captured it as running for the past 2 weeks for me. Just wondering if it’s something on my end or not. Thanks!

The blueprint is supposed to start checking on Home Assistant startup. Maybe that didn’t happen? I think that may be the cause when the state wasn’t updating for me a few weeks ago. You might try running the automation manually and see if it starts working then.

Let me know what happens.

Have you updated to Simple Wyze Vac v1.7? I haven’t and won’t be able to for a week or so. It says they’ve fixed the status updating service Release Config Flow! 2FA/TOTP support! Sweep Room Service! · romedtino/simple-wyze-vac · GitHub

Let me know if it works for you. :slight_smile:

Thanks Josh…I did upgrade and the last time I used the vac it worked…It happens sporadically so I’ll keep an eye on it over the next week or so and see if it improves. Appreciate it!

I also just updated to v1.7, switched to UI configuration, and enabled polling every 00:01:00 according to the instructions GitHub - romedtino/simple-wyze-vac: Home Assistant Custom Component for Wyze Vacuum. I’ll updated in a week or two to see if I have any problems and if no issues I’ll update the original post noting that this blueprint is no longer necessary.

Mine has failed this week, I’m investigating but has anyone else had an issue this week?

Mine is currently working.

thanks for the reply! Hopefully mine will fix itself with another reboot or something :slight_smile: