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.