Wyze Robot Vacuum - My Setup

Goal

Integrate the Wyze Robot Vacuum into Home Assistant.

Why?

Because everything should integrate into Home Asistant!

Why Wyze Vac and not something with Valteudo?

While Valetudo is an awesome project, I am not someone who has enough patience to find a vacuum that can use it then install Valetudo. I’m okay using the Wyze Vac knowing that it uses an unofficial API that may one day not work and never work again. If that does happen I’ll be happy with the time we had together but not be upset because I went in with my eyes wide open.

If that sounds like you, then join me in making our homes a bit cleaner.

Parts List

Wyze Robot Vacuum (kind of essential for this guide)
Blueprint: Robot Vacuum Auto Status Update (Wyze Robot Vac) I made this for the occasion.
HACS Integration: Simple Wyze Vac Also has you install Robot Vacuum Card
HACS Integration: Scheduler Component Also has you install Scheduler Card.

My Dashboard

Card 1 - Vacuum Card
Nothing special here. I just followed the great instructions for HACS Integration: Simple Wyze Vac.
It does not have a map integration, but do you need that in Home Assistant?

Card 2 - Vacuum Schedule
This was created using the HACS Integration: Scheduler Component and Scheduler Card (install instructions on Scheduler Component page.

The reason I used the Scheduler Card (as opposed to HA’s Automation) is that it is much easier for other household users to manage this. And, you can use the Scheduler Card’s tag functionality to only show the automation relevant to the vacuum here. So if you have a Scheduler Card on another dashboard that automation won’t show here and vice-versa. All in all, a better user experience.

Another benefit to scheduling the cleaning in Home Assistant is that it automatically updates the status of the vacuum and nicely triggers the status auto-update blueprint. Using the Wyze app doesn’t do that. :sweat_smile:

Here is my Scheduler Card automation:
image


“Start” just started a whole home vacuum.


I have a “Vacation Mode” input_boolean that I use in various automation for the stated purpose.

Card 3 - Status & Scripts
"Is Vacuum Running?"
This is a boolean template sensor that is true when the vacuum is moving. I use this to prevent the motion sensors from tripping the alarm when the house alarm is armed so that the vacuum can run while we are away.

sensor:
  - platform: template
    sensors:
      vacuum_state:
        friendly_name: "Is Vacuum Running?"
        value_template: >-
          {{ is_state('vacuum.jarvis', 'cleaning') or is_state('vacuum.jarvis', 'returning') }}
        icon_template: >-
          {%- if is_state('vacuum.jarvis', 'cleaning') or is_state('vacuum.jarvis', 'returning') -%}
            mdi:broom
          {% else %}
            mdi:sleep
          {% endif %}

Replace “jarvis” with the name of your vacuum.

“Vacuum Main Rooms” and “Vacuum Bedrooms” are scripts written the same as the examples on HACS Integration: Simple Wyze Vac.

service: vacuum.send_command
data:
  command: sweep_rooms
  params:
    rooms:
      - Hallway
      - Kitchen
      - Living Room
      - Bathroom
target:
  entity_id: vacuum.jarvis

Improvements

  • I still want to figure out how to set a reminder after a certain number of minutes cleaning to empty the dust bin.
  • I want a notification (from Home Assistant and not the Wyze app) for when the Vacuum gets stuck. Maybe a trigger for when it goes from ‘cleaning’ to 'paused status for x minutes. Haven’t tried yet.
    • The reason I don’t want a notification from Wyze is that the Wyze app doesn’t currently allow you to choose notifications you want. It is all or nothing, and I don’t want notifications for everything, just the problems.

What have you done to integrate the Wyze Vac?

Updates August 2022

At one point there was an issue with the authentication token, but the Simple Wyze Vac has been fixed. During that time I was using a zigbee open/close detector to detect if the vacuum was away from the base.
Now it is working well!

I no longer use the scheduler component for scheduling. I actually have the Wyze <> Alexa integration and us the Alexa hunch to run the vacuum whenever Alexa guard mode is on. Alexa guard mode is set by Home Assistant. :slight_smile:

What have you done with your Wyze vac?

4 Likes

Very nice. Going to try and implement this. Need to follow up and understand more on the template sensor. If only one option that is always true? If I add another option the second is always false?

I’m not sure what you mean. The template has 2 options “cleaning” and “returning” that make the sensor TRUE.

I chose “cleaning” and “returning” because those are the two that mean the vacuum is moving.

I installed this today and it works pretty well!

In github you added some code to allow a map toggle, but it doesn’t seem to be working for me. Did something change in HA lately that would break this?

Figured this out. Had to add two conditional cards. One has the map and is visible when not docked, and the other doesn’t have the map and is visible when it is docked. The same concept applies to the boolean toggle.

The positioning of the cards is something I still need to figure out since they are moving around a lot in my current test dashboard.

1 Like

Not sure if you were able to figure out your card positioning issue, but you may want to do what I did and make your card a vertical-stack card with your conditions like so:

cards:
  - type: conditional
    conditions:
      - entity: input_boolean.map_toggle
        state: 'on'
    card:
      type: custom:vacuum-card
      entity: vacuum.wyze_vac
      map: camera.wyze_vac_camera
      show_toolbar: true
      show_status: true
      show_name: true
      compact_view: false
      stats:
        default:
          - attribute: filter
            unit: hours
            subtitle: Filter
          - attribute: side_brush
            unit: hours
            subtitle: Side Brush
          - attribute: main_brush
            unit: hours
            subtitle: Main Brush
      shortcuts:
        - name: Toggle Map
          service: input_boolean.toggle
          service_data:
            entity_id: input_boolean.map_toggle
          icon: mdi:map
      view_layout:
        position: sidebar
    view_layout:
      position: sidebar
  - type: conditional
    conditions:
      - entity: input_boolean.map_toggle
        state: 'off'
    card:
      type: custom:vacuum-card
      entity: vacuum.wyze_vac
      image: default
      show_toolbar: true
      show_status: true
      show_name: true
      compact_view: false
      stats:
        default:
          - attribute: filter
            unit: hours
            subtitle: Filter
          - attribute: side_brush
            unit: hours
            subtitle: Side Brush
          - attribute: main_brush
            unit: hours
            subtitle: Main Brush
      shortcuts:
        - name: Toggle Map
          service: input_boolean.toggle
          service_data:
            entity_id: input_boolean.map_toggle
          icon: mdi:map
      view_layout:
        position: sidebar
    view_layout:
      position: sidebar
type: vertical-stack

Thank you!

I played with it for a few minutes and quit when I realized the updates weren’t real time. I’m good just using the wyze app for that.

You’re welcome.

Did you try enabling polling to see if that made a difference? Only thing I can think of…

@Noblewolf Need your help. I just followed these instructions: GitHub - romedtino/simple-wyze-vac: Home Assistant Custom Component for Wyze Vacuum, but when I go to the enter username and password, then the TOTP, could not log in. I followed the instructions to remove 2FA from the wyze app. Then setup 2FA in wyze app, copied the secret code…went back to the HA Simple Wyze, and put in the user name, password, TOTP code…still would not allow me to sign in.

Thoughts?

@Noblewolf I can get the vacuum to clean the whole floor (all rooms, etc), but when selecting a room - it does not move.

alias: iRobot Cleans
description: ""
trigger:
  - platform: time
    at: "20:37:00"
condition: []
action:
  - type: turn_off
    device_id: 9be48041be2a372ca0d69ed1327843ff
    entity_id: switch.swv_room_10
    domain: switch
mode: single

your help pls.

Based on your deleted comments it looks like you found the line about the integration not working with 2FA: GitHub - romedtino/simple-wyze-vac: Home Assistant Custom Component for Wyze Vacuum.

You need to rewrite your action based on the documentation provided by the integration creator documented here: GitHub - romedtino/simple-wyze-vac: Home Assistant Custom Component for Wyze Vacuum

There is a lot of good examples including your use case.

@Noblewolf Actually - I misspoke in my deleted comment. I had TOTP set up on my primary wyze account (via Google Authenticator), but could not get the integration/Wyze to accept the code (Not the 6-digit code), but the secret code when setting up 2FA/TOTP using Google Authenticator.

So I set up a second account shared my robot vac and signed into the integration/wyze via my second non-2FA account.

Am I missing something here? Doing something wrong?

@Noblewolf Well - this newbie is confused. So do I understand, I can not create this automation:

And the vacuum will run? Apparently not - as this automation does not work.

So - you recommend re-writing this - but honestly, I do not understand or know how. I am currently very UI driven when doing anything in HA.

If you could help me get one room to vacuum I can replicate and experiment after that. Kind of a crawl, walk, run, process. I am very much in the crawl - follow instruction mode.

Your help please.

@Noblewolf WOW - if you follow the directions - precisely (!), things work!!

I finally created the following:

And the vac is currently cleaning that room - most excellent!

This issue of solved! Thanks for the help!!

Now - some help with the TOTP pls (and I think I am following the directions precisely!)

@Noblewolf Just tested the new automation - worked perfectly - Many Thanks ! :+1: :+1:

1 Like