Valetudo configs

homeassistant:
  customize:
    input_boolean.disable_daily_vacuum:
      icon: mdi:stop-circle-outline
    input_boolean.disable_dustbin_notification:
      icon: mdi:delete-empty
    binary_sensor.vacuum_room:
      custom_ui_state_card: state-card-floorplan
      config: !include ../floorplan_vacuum.yaml

binary_sensor:
  - platform: mqtt
    state_topic: dummy/floorplan/sensor
    name: Vacuum Room

frontend:
  extra_html_url:
    - /local/custom_ui/state-card-floorplan.html

group:
  Robot Vacuum:
    control: hidden
    entities:
      - vacuum.xiaomi_vacuum_cleaner
      - input_boolean.disable_daily_vacuum
  Vacuum a Room:
    control: hidden
    entities:
      - input_select.vacuum_room
      - binary_sensor.vacuum_room

vacuum:
  - platform: xiaomi_miio
    host: !secret xiaomi_vacuum_ip
    token: !secret xiaomi_vacuum_token

input_boolean:
  daily_vacuum_first_run:
    name: Daily Vacuum First Run
    initial: off
  disable_daily_vacuum:
    name: Disable Daily Vacuum Automation
    initial: on
  disable_dustbin_notification:
    name: Disable Dustbin Notification
    initial: off

input_select:
  vacuum_room:
    name: Choose a room to clean
    options:
      - Select Input
      - All Except Bedroom and Ensuite
      - Bedroom
      - Dining Room
      - Ensuite Bathroom
      - Entryway
      - Kitchen
      - Living Room
      - Main Bathroom
      - Mopping Surfaces
      - Projector Room
      - Study
    initial: Select Input

script:
  vacuum_all_except_bedroom_and_ensuite:
        alias: "Vacuum All Except Bedroom and Ensuite"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[16034,19737,26234,29237,1],[19487,29248,26237,32198,1]]
  vacuum_bedroom:
        alias: "Vacuum Bedroom"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[12038,27467,16088,32017,1]]
  vacuum_dining_room:
        alias: "Vacuum Dining Room"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[16079,24984,19679,28134,1]]
  vacuum_ensuite_bathroom:
        alias: "Vacuum Ensuite Bathroom"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[12038,27467,16088,32017,1]]
# Entryway not working correctly
  vacuum_entryway:
        alias: "Vacuum Entryway"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[22948,22862,24798,25062,1]]
  vacuum_kitchen:
        alias: "Vacuum Kitchen"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[19444,24947,21444,27997,1]]
  vacuum_living_room:
        alias: "Vacuum Living Room"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[18266,19661,23016,25061,1]]
  vacuum_main_bathroom:
        alias: "Vacuum Main Bathroom"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[19501,29139,22051,31789,1]]
  vacuum_mopping_surfaces:
        alias: "Vacuum Mopping Surfaces"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[16602,29163,22052,32313,1],[16028,24951,21578,28151,1],[22975,22737,24375,25087,1]]
  vacuum_projector_room:
        alias: "Vacuum Projector Room"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[22058,28711,26208,32061,1]]
  vacuum_study:
        alias: "Vacuum Study"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[23004,25042,26404,28442,1]]
sensor:
  - platform: template
    sensors:
      xiaomi_vacuum_cleaner_status:
        entity_id:
          - vacuum.xiaomi_vacuum_cleaner
        friendly_name: "Xiaomi Vacuum Cleaner Status"
        value_template: "{{ states.vacuum.xiaomi_vacuum_cleaner }}"

###############################################################################
#                               Automations
###############################################################################
automation:
  - alias: Start Daily Vacuum
    trigger:
    - platform: state
      entity_id: group.family_presence
      from: 'home'
      to: 'not_home'
      for:
        minutes: 2
    - platform: time
      at: '7:02:00'
    condition:
      condition: and
      conditions:
      - condition: state
        entity_id: input_boolean.daily_vacuum_first_run
        state: 'off'
      - condition: time
        after: '07:00:00'
        before: '22:00:00'
      - condition: state
        entity_id: group.family_presence
        state: 'not_home'
      - condition: state
        entity_id: input_boolean.disable_daily_vacuum
        state: 'off'
    action:
    - delay: '00:00:30'
    - service: vacuum.turn_on
      entity_id: vacuum.xiaomi_vacuum_cleaner
    - service: homeassistant.turn_on
      entity_id: input_boolean.daily_vacuum_first_run

  - alias: Reset Daily Vacuum First Run state at midnight
    trigger:
    - platform: time
      at: '0:00:00'
    action:
    - service: homeassistant.turn_off
      entity_id: input_boolean.daily_vacuum_first_run

  - alias: Send alert after daily vacuum to empty the dustbin
    trigger:
    - platform: state
      entity_id: group.family_presence
      to: 'home'
      for:
        minutes: 2
    condition:
      condition: and
      conditions:
      - condition: state
        entity_id: input_boolean.daily_vacuum_first_run
        state: 'on'
      - condition: time
        after: '08:30:00'
        before: '22:30:00'
      - condition: template
        value_template: >
          <div data-gb-custom-block data-tag="if"></div>

            

<div data-gb-custom-block data-tag="if" data-0='1800' data-1='1800' data-2='1800' data-3='1800' data-4='1800' data-5='1800' data-6='1800' data-7='1800' data-8='1800' data-9='1800' data-10='1800' data-11='1800' data-12='1800' data-13='1800' data-14='1800' data-15='1800' data-16='1800' data-17='1800' data-18='1800' data-19='1800' data-20='1800' data-21='1800' data-22='1800' data-23='1800' data-24='1800' data-25='1800' data-26='1800' data-27='1800' data-28='1800' data-29='1800' data-30='0'></div> true <div data-gb-custom-block data-tag="else"> false
            </div>

          

<div data-gb-custom-block data-tag="else">

          false
          

</div>

      - condition: state
        entity_id: input_boolean.disable_dustbin_notification
        state: 'off'
    action:
      - service: script.speech_processing
        data_template:
          speech_message: >
           

<div data-gb-custom-block data-tag="if" data-0='person.trent' data-1=', ' data-2=', ' data-3=', ' data-4='home' data-5='person.rachel' data-6='person.rachel' data-7=', '>

             Attention!: the vacuum dustbin needs to be cleared.
           

</div>

      - service_template: >
          

<div data-gb-custom-block data-tag="if" data-0='person.trent' data-1=', ' data-2=', ' data-3=', ' data-4='home' data-5='person.rachel' data-6='person.rachel' data-7=', ' data-8='home'></div>

            notify.trent_and_rachel
          

<div data-gb-custom-block data-tag="elif" data-0='person.trent' data-1=', ' data-2=', ' data-3=', '></div>

            notify.telegram_trent
          

<div data-gb-custom-block data-tag="elif" data-0='person.rachel' data-1=', ' data-2=', ' data-3=', '>

            notify.rachel
          

</div>

        data:
          message: 'Hey, the vacuum dustbin needs to be cleared'
          title: 'Vacuum Dustbin'
  - alias: Start Cleaning Room
    hide_entity: True
    trigger:
    - platform: state
      entity_id: input_select.vacuum_room
      from: 'Select Input'
    action:
    - service: script.turn_on
      data_template:
        entity_id: >
          

<div data-gb-custom-block data-tag="if" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_all_except_bedroom_and_ensuite
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_bedroom
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_dining_room
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_ensuite_bathroom
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_entryway
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_kitchen
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_living_room
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_main_bathroom
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_mopping_surfaces
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_projector_room
          

<div data-gb-custom-block data-tag="elif" data-0='input_select.vacuum_room' data-1=', ' data-2=', ' data-3=', '></div>

            script.vacuum_study
          

<div data-gb-custom-block data-tag="else">

          

</div>
    - service: input_select.select_option
      data:
        entity_id: input_select.vacuum_room
        option: "Select Input"

Last updated