Add Vacuum Scripts
This commit is contained in:
@@ -167,6 +167,52 @@ script:
|
||||
topic: valetudo/furbot/MapSegmentationCapability/clean/set
|
||||
payload: '{"segment_ids": ["2"], "iterations": 2}'
|
||||
|
||||
# Vacuum Selected Segments
|
||||
furbot_clean_segments:
|
||||
alias: "Furbot: Clean Selected Rooms"
|
||||
sequence:
|
||||
- choose:
|
||||
# Pause the robot if it is currently cleaning
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ states('vacuum.valetudo_furbot') == 'cleaning' }}"
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: valetudo/furbot/BasicControlCapability/operation/set
|
||||
payload: 'pause'
|
||||
|
||||
# Resume the robot if it is paused
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ states('vacuum.valetudo_furbot') == 'paused' }}"
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: valetudo/furbot/BasicControlCapability/operation/set
|
||||
payload: 'start'
|
||||
|
||||
# Start a new cleaning if it is docked
|
||||
default:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: "{{ is_state('group.furbot_segments', 'off') }}"
|
||||
then:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: valetudo/furbot/BasicControlCapability/operation/set
|
||||
payload: 'start'
|
||||
else:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: valetudo/furbot/MapSegmentationCapability/clean/set
|
||||
payload: >-
|
||||
{
|
||||
'segment_ids': {{ expand('group.furbot_segments') |
|
||||
selectattr('state','eq','on') |
|
||||
map(attribute='attributes.segment_id') | list | to_json }}
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Vacuum Automations
|
||||
automation:
|
||||
@@ -187,3 +233,14 @@ automation:
|
||||
- service: input_text.reload
|
||||
target:
|
||||
entity_id: input_text.furbot_last_fan_speed
|
||||
|
||||
# Reset the Cleaning Segments when cleaning is complete
|
||||
- alias: "Furbot: Reset Rooms"
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: vacuum.valetudo_furbot
|
||||
to: docked
|
||||
action:
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: group.furbot_segments
|
||||
|
||||
Reference in New Issue
Block a user