Vacuum Schedule

Tags: #<Tag:0x00007fc3fa3914d8> #<Tag:0x00007fc3fa391410>

This is a simple blueprint for scheduling vacuum clean ups for the week.

You must keep seconds at 00 in time inputs for this to work

Blueprint

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

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

Or import this Blueprint by using the forum topic URL:

blueprint:
  name: Vacuum Schedule
  description: >
    Vacuum clean ups schedule for the week
  domain: automation
  input:
    target_vacuum:
      name: Vacuum
      description: The vacuum used for clean ups
      selector:
        entity:
          domain: vacuum
    monday_enabled:
      name: Monday
      default: true
      selector:
        boolean:
    monday_time:
      name: ' '
      default: "15:00:00"
      selector:
        time:
    tuesday_enabled:
      name: Tuesday
      default: true
      selector:
        boolean:
    tuesday_time:
      name: ' '
      default: "15:00:00"
      selector:
        time: 
    wednesday_enabled:
      name: Wednesday
      default: true
      selector:
        boolean:
    wednesday_time:
      name: ' '
      default: "15:00:00"
      selector:
        time: 
    thursday_enabled:
      name: Thursday
      default: true
      selector:
        boolean:
    thursday_time:
      name: ' '
      default: "15:00:00"
      selector:
        time: 
    friday_enabled:
      name: Friday
      default: true
      selector:
        boolean:
    friday_time:
      name: ' '
      default: "15:00:00"
      selector:
        time: 
    saturday_enabled:
      name: Saturday
      default: true
      selector:
        boolean:
    saturday_time:
      name: ' '
      default: "15:00:00"
      selector:
        time: 
    sunday_enabled:
      name: Sunday
      default: true
      selector:
        boolean:
    sunday_time:
      name: ' '
      default: "15:00:00"
      selector:
        time: 

variables:
  monday_enabled: !input monday_enabled
  monday_time: !input monday_time
  tuesday_enabled: !input tuesday_enabled
  tuesday_time: !input tuesday_time
  wednesday_enabled: !input wednesday_enabled
  wednesday_time: !input wednesday_time
  thursday_enabled: !input thursday_enabled
  thursday_time: !input thursday_time
  friday_enabled: !input friday_enabled
  friday_time: !input friday_time
  saturday_enabled: !input saturday_enabled
  saturday_time: !input saturday_time
  sunday_enabled: !input sunday_enabled
  sunday_time: !input sunday_time
  current_day: '{{ now().weekday() | int }}'
  current_time: '{{ now().strftime("%H:%M:%S") }}'

trigger:
  platform: time_pattern
  minutes: "*"

condition:
  condition: template
  value_template: >
    {{ 
      (current_day == 0 and monday_enabled and monday_time == current_time)
      or (current_day == 1 and tuesday_enabled and tuesday_time == current_time)
      or (current_day == 2 and wednesday_enabled and wednesday_time == current_time)
      or (current_day == 3 and thursday_enabled and thursday_time == current_time)
      or (current_day == 4 and friday_enabled and friday_time == current_time)
      or (current_day == 5 and saturday_enabled and saturday_time == current_time)
      or (current_day == 6 and sunday_enabled and sunday_time == current_time)
    }}

action:
  service: vacuum.start
  entity_id: !input target_vacuum

5 Likes

This is pretty handy but the enable/disable slider doesn’t save. To test it I just turned on Monday and turned off all other days of the week, then saved it and when I opened it back up again all days are active. I tried this several times, same result.

The automations.yaml file is correct, but that doesn’t reflect in the UI.

Indeed, this seems to be a problem with the blueprint module.

I’ll have a look to check if I missed something, thanks for the feedback!

Hi - thanks for sharing this. I like how you coded the days - and used your structure as inspiration for a blueprint that I created here: MQTT Automation to update all Shelly/Shellies to the latest firmware

In my blueprint, I didn’t see the same issue as CO_4X4 reported - this may be due to setting the days_binary variables to false as default; or it may be something else.