romedtino / simple-wyze-vac

Home Assistant Custom Component for Wyze Vacuum
48 stars 8 forks source link

Switches don't persist state on reboot #40

Closed Bottleface closed 1 year ago

Bottleface commented 2 years ago

I am not sure if this is possible or not, but the room switches don't persist their state on restart of Home Assistant. I have my vacuums run every night and there is always a room I leave unvacuumed. Whenever I restart Home Assistant for any reason all room switches are "on", so I have to remember to go disable that room.

Is it possible to have the switches maintain their state prior to rebooting?

romedtino commented 2 years ago

Hm, it's a bit tricky since the concept of the rooms as switches are not really part of Wyze itself and are just Home Assistant variables. It would mean doing some persistent storage for the custom component. I can take a look into it.

Though for now, if it's always the same rooms you want to clean, perhaps running an automation that just calls the vacuum to sweep those rooms by name every night would be a better approach?

service: vacuum.send_command
data:
  command: sweep_rooms
  params:
    rooms:
      - Hallway
      - Kitchen
target:
  entity_id: vacuum.theovac