Hi all,
With the improvements to the shopping list ( now To-do list) I wanted demonstrate to other newbies how you can automate off items added or removed, in my case, I send seperate notifications on items added or removed and I notify the person who has entered a zone (aka shops).
choose:
- conditions:
- condition: trigger
id:
- zone_pc
- zone_sc
- zone_wsc
- condition: numeric_state
entity_id: todo.shopping_list
above: 0
sequence:
- variables:
target: >
{% set x = trigger.to_state.attributes.source %} {{
states[x].object_id }}
- service: notify.mobile_app_{{ target }}
data:
title: Shopping items are needed!
message: >-
{{ trigger.to_state.attributes.friendly_name }}, please review items
that are needing purchase. Check them off when done.
- conditions:
- condition: template
value_template: "{{ trigger.to_state.state | int > trigger.from_state.state | int }}"
sequence:
- service: notify.notify
data:
title: Shopping List Updated - Item Added
message: An item has been added to the shopping list.
- conditions:
- condition: template
value_template: "{{ trigger.to_state.state | int < trigger.from_state.state | int }}"
sequence:
- service: notify.notify
data:
title: Shopping List Updated - Item Removed
message: An item has been removed from the shopping list.