1
0

Update vacuum automations/scripts

This commit is contained in:
Przemek Grondek 2022-04-29 19:55:03 +02:00
parent 8b8a6f07aa
commit c973bd7b16
5 changed files with 75 additions and 98 deletions

View File

@ -6,6 +6,8 @@ counter:
dhcp: dhcp:
energy: energy:
frontend: frontend:
homeassistant:
customize: !include customize.yaml
history: history:
http: http:
use_x_forwarded_for: true use_x_forwarded_for: true
@ -22,6 +24,27 @@ input_boolean:
3d_printer_timelapse: 3d_printer_timelapse:
name: "3D printer timelapse" name: "3D printer timelapse"
icon: "mdi:camera-burst" icon: "mdi:camera-burst"
vacuum_office:
name: "Vacuum Office"
icon: "mdi:chair-rolling"
vacuum_living_room:
name: "Vacuum Living room"
icon: "mdi:sofa"
vacuum_table_area:
name: "Vacuum Table area"
icon: "mdi:table-furniture"
vacuum_kitchen:
name: "Vacuum Kitchen"
icon: "mdi:pot-mix"
vacuum_hallway:
name: "Vacuum Hallway"
icon: "mdi:foot-print"
vacuum_bedroom:
name: "Vacuum Bedroom"
icon: "mdi:bed-empty"
vacuum_bathroom:
name: "Vacuum Bathroom"
icon: "mdi:shower"
input_datetime: input_datetime:
input_number: input_number:
input_select: input_select:
@ -117,14 +140,6 @@ ios:
color: "#ffffff" color: "#ffffff"
camera: camera:
- platform: xiaomi_cloud_map_extractor
host: 192.168.60.7
token: !secret xiaomi_vacuum_token
username: xiaomi@nerull7.info
password: !secret xiaomi_cloud_password
draw: [ 'all' ]
attributes:
- calibration_points
- platform: generic - platform: generic
name: '3D Printer Camera' name: '3D Printer Camera'
still_image_url: https://192.168.110.11:8554/currentpic.cgi still_image_url: https://192.168.110.11:8554/currentpic.cgi

View File

@ -0,0 +1,14 @@
input_boolean.vacuum_office:
room_id: 18
input_boolean.vacuum_living_room:
room_id: 20
input_boolean.vacuum_table_area:
room_id: 17
input_boolean.vacuum_kitchen:
room_id: 21
input_boolean.vacuum_hallway:
room_id: 19
input_boolean.vacuum_bedroom:
room_id: 16
input_boolean.vacuum_bathroom:
room_id: 22

View File

@ -0,0 +1,10 @@
vacuum_rooms:
name: "Vacuum Rooms"
entities:
- input_boolean.vacuum_office
- input_boolean.vacuum_living_room
- input_boolean.vacuum_table_area
- input_boolean.vacuum_kitchen
- input_boolean.vacuum_hallway
- input_boolean.vacuum_bedroom
- input_boolean.vacuum_bathroom

View File

@ -49,6 +49,10 @@
copy: copy:
src: configuration/configuration.yaml src: configuration/configuration.yaml
dest: '{{ pwd_config }}/configuration.yaml' dest: '{{ pwd_config }}/configuration.yaml'
- name: Copy customize
copy:
src: configuration/customize.yaml
dest: '{{ pwd_config }}/customize.yaml'
- name: Copy secrets - name: Copy secrets
copy: copy:
src: configuration/secrets.yaml src: configuration/secrets.yaml

View File

@ -1,89 +1,3 @@
vacuum_clean_room:
alias: Vacuum clean room
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_select.vacuum_room_cleaning
state: 'Hallway'
sequence:
- service: xiaomi_miio.vacuum_clean_segment
target:
entity_id: vacuum.valetudo_valetudos5
data:
segments: 16
- conditions:
- condition: state
entity_id: input_select.vacuum_room_cleaning
state: 'Bathroom'
sequence:
- service: xiaomi_miio.vacuum_clean_segment
target:
entity_id: vacuum.valetudo_valetudos5
data:
segments: 17
- conditions:
- condition: state
entity_id: input_select.vacuum_room_cleaning
state: 'Living Room/Dining'
sequence:
- service: xiaomi_miio.vacuum_clean_segment
target:
entity_id: vacuum.valetudo_valetudos5
data:
segments: 18
- conditions:
- condition: state
entity_id: input_select.vacuum_room_cleaning
state: 'Kitchen'
sequence:
- service: xiaomi_miio.vacuum_clean_segment
target:
entity_id: vacuum.valetudo_valetudos5
data:
segments: 19
- conditions:
- condition: state
entity_id: input_select.vacuum_room_cleaning
state: 'Living Room/TV'
sequence:
- service: xiaomi_miio.vacuum_clean_segment
target:
entity_id: vacuum.valetudo_valetudos5
data:
segments: 20
- conditions:
- condition: state
entity_id: input_select.vacuum_room_cleaning
state: 'Bedroom'
sequence:
- service: xiaomi_miio.vacuum_clean_segment
target:
entity_id: vacuum.valetudo_valetudos5
data:
segments: 21
- conditions:
- condition: state
entity_id: input_select.vacuum_room_cleaning
state: 'Cave'
sequence:
- service: xiaomi_miio.vacuum_clean_segment
target:
entity_id: vacuum.valetudo_valetudos5
data:
segments: 22
- conditions:
- condition: state
entity_id: input_select.vacuum_room_cleaning
state: 'Kitchen/Hallway'
sequence:
- service: xiaomi_miio.vacuum_clean_segment
target:
entity_id: vacuum.valetudo_valetudos5
data:
segments: 23
mode: single
vacuum_today: vacuum_today:
alias: Vacuum only once alias: Vacuum only once
sequence: sequence:
@ -112,9 +26,29 @@ vacuum_today:
vacuum_goto_bin: vacuum_goto_bin:
alias: Vacuum go to bin alias: Vacuum go to bin
sequence: sequence:
- service: xiaomi_miio.vacuum_goto - service: mqtt.publish
data: data:
x_coord: '23000' topic: valetudo/ValetudoS5/GoToLocationCapability/go/set
y_coord: '26000' payload: 55609b09-2d32-4f52-b939-94363172256d
vacuum_clean_segments:
alias: Vacuum clean segments
sequence:
- service: script.turn_on
target: target:
entity_id: vacuum.valetudo_valetudos5 entity_id: script.vacuum_clean_segments_message
data:
variables:
segments: '{{expand("group.vacuum_rooms") | selectattr("state","eq","on")
| map(attribute="attributes.room_id") | list | to_json}}'
mode: single
icon: mdi:arrow-right
vacuum_clean_segments_message:
alias: Vacuum clean segments message
sequence:
- service: mqtt.publish
data:
topic: valetudo/ValetudoS5/MapSegmentationCapability/clean/set
payload_template: '{"segment_ids": {{segments}}}'
mode: single