Created
October 2, 2019 18:53
-
-
Save oischinger/7483bc937dc36765a747a4c3cea42a40 to your computer and use it in GitHub Desktop.
Vacuum zones script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script: | |
vacuum_zones_erdgeschoss: | |
alias: "Erdgeschoss Zonen saugen" | |
sequence: | |
- service: vacuum.send_command | |
data_template: | |
entity_id: 'vacuum.rockrobo' | |
command: 'zoned_cleanup' | |
params: | |
'zone_ids': | |
- "{%- if states('input_boolean.flur_vacuum_zone') == 'on' %}flur{% endif %}" | |
- "{%- if states('input_boolean.kueche_vacuum_zone') == 'on' %}kueche{% endif %}" | |
- "{%- if states('input_boolean.essbereich_vacuum_zone') == 'on' %}essbereich{% endif %}" | |
- "{%- if states('input_boolean.sofa_vacuum_zone') == 'on' %}sofa{% endif %}" | |
- "{%- if states('input_boolean.wohnzimmerwand_vacuum_zone') == 'on' %}wohnzimmerwand{% endif %}" | |
- "{%- if states('input_boolean.wintergarten_vacuum_zone') == 'on' %}wintergarten{% endif %}" | |
No worries. My lovelace card is a vertical stack card in a card composed from an entities card (which only has a single script entity) and the picture-elements card which you already have.
So just add an independent entities card like this:
type: entities
entities:
- entity: script.vacuum_zone_pulizia
name: Zoned cleanup
I suggest to read this https://www.home-assistant.io/lovelace/vertical-stack/ if you then want to combine those two cards in one.
Finally it works, thanks for support!
I was helped here too. https://community.home-assistant.io/t/data-templates-input-boolean-in-scripts-i-cant-solve-this/142568/6
You are advised to replace
states('input_boolean.floor1camera_vacuum_zone') == 'on'
with:
is_state('input_boolean.floor1camera_vacuum_zone', 'on')
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry if I'm boring you. I use the raw unit editor, where and how should I insert the script? I tried in the map card but it still doesn't work. Could you send me your configuration as example?