iceman73 / simple-wyze-vac

Home Assistant Custom Component for Wyze Vacuum

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Wyze Vacuum for Home Assistant

NOTE As of 8/20/2021

Wyze has recently implemented a rate limit on accessing their private APIs. Due to this change, I cannot recommend installing this integration in HA until this all gets sorted out. I might resort to adding a "send_command" that maybe you can use to query Wyze servers. This way it's more event based and it will be on you to make sure you don't hit the rate limits. I have disabled polling on this integration.

To update the state of the device, you can do a vacuum.send_command with command update which will update the state of the vacuum. See vacuum-card example for an implementation.

General

Simple implementation of the Wyze Vacuum right into Home Assistant.

Prerequisites

  • Home Assistant 😅
  • HACS Installed in Home Assistant
  • Wyze Account without 2FA - Tip: Create a new account that you share just the vacuum with that doesn't have 2FA enabled.

Installation

  1. On Home Assistant go to HACS -> Integration
  2. Click menu on the top right
  3. Click on custom repositories
  4. Add https://github.com/romedtino/simple-wyze-vac as an Integration
  5. Install/Add simple-wyze-vac
  6. Restart Home Assistant
  7. Edit your configuration.yaml and add
simple_wyze_vac:
  username: your_wyze_email@email.com
  password: your_wyze_password
  1. Verify your configuration file is valid
  2. Restart Home Assistant

If it all worked out, you should now have Wyze vacuum entity(ies)

Supported Features

  • Start
  • Stop / Pause
  • Return to Base
  • Room Clean (Must use serivce call) Example: image
service: vacuum.send_command
data:
  command: sweep_rooms
  params:
    rooms:
      - Hallway
      - Kitchen
target:
  entity_id: vacuum.theovac
  • Fan Speed control - quiet standard strong Example: image
service: vacuum.set_fan_speed
data:
  fan_speed: quiet
target:
  entity_id: vacuum.your_vac
  • Battery Level
  • Update status - Since the integration no longer polls, you can query the status of the vacuum by sending a custom command update
service: vacuum.send_command
data:
  command: update
target:
  entity_id: vacuum.theovac
  • Refresh Login Token - You can also refresh the login token if it has been awhile since you queried status and your login token has expired
service: vacuum.send_command
data:
  command: refresh_token
target:
  entity_id: vacuum.theovac

Misc

  • Location is not supported but it is considered "supported" by HA so the button doesn't crash the component when using vacuum-card if you use it.

Implementing vacuum-card

There's a lovely Lovelace vacuum-card here in which you can implement your vacuum like so: image

Here is my YAML configuration of the card

type: custom:vacuum-card
entity: vacuum.theovac
image: default
show_toolbar: true
show_status: true
show_name: true
compact_view: false
shortcuts:
  - name: Clean living room
    service: script.vacuum_room_clean
    icon: mdi:sofa
    service_data:
      rooms:
        - Living Room
  - name: Update
    service: script.vacuum_update_state
    icon: mdi:update

and the contents of the scripts it invokes

alias: Vacuum Room Clean
variables:
  rooms:
    - Living Room
sequence:
  - service: vacuum.send_command
    data:
      command: sweep_rooms
      params:
        rooms: ' {{ rooms }} '
    target:
      entity_id: vacuum.theovac
mode: single
alias: Vacuum Update State
sequence:
  - service: vacuum.send_command
    data:
      command: update
    target:
      entity_id: vacuum.theovac
mode: single

TODO / Maybe in the Future

  • In theory everything from wyze-sdk should be possible?

Shoutouts

About

Home Assistant Custom Component for Wyze Vacuum


Languages

Language:Python 100.0%