-
-
Save davosian/de4ec1a1299fa3348b08af4cd1e75d28 to your computer and use it in GitHub Desktop.
Home Assistant - Add unique to-do item
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
alias: Add unique to-do | |
mode: single | |
icon: mdi:clipboard-list | |
sequence: | |
- service: todo.get_items | |
target: | |
entity_id: "{{ list }}" | |
data: | |
status: needs_action | |
response_variable: mylist | |
- if: | |
- condition: template | |
value_template: >- | |
{{ | |
mylist[list]['items']|selectattr('summary','search',item)|list|count | |
== 0 }} | |
then: | |
- service: todo.add_item | |
metadata: {} | |
data: | |
item: "{{ item }}" | |
target: | |
entity_id: "{{ list }}" | |
fields: | |
item: | |
selector: | |
text: null | |
name: Item | |
description: The to-do item to add | |
required: true | |
list: | |
selector: | |
entity: | |
filter: | |
- domain: todo | |
name: List | |
required: true | |
description: The to-do list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment