Advertisement
raidolo

Untitled

Dec 7th, 2023
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.86 KB | Source Code | 0 0
  1. alias: Notifica Lista Spesa
  2. description: ""
  3. trigger:
  4.   - platform: state
  5.     entity_id:
  6.      - todo.alexa_shopping_list
  7. condition:
  8.   - condition: template
  9.     value_template: >-
  10.       {{ (trigger.from_state.state|int(0) < trigger.to_state.state|int(0)) and
  11.       (trigger.from_state.state != 'unavailable' and trigger.to_state.state !=
  12.       'none') and (trigger.to_state.state != 'unavailable' and
  13.       trigger.from_state.state != 'none') }}
  14. action:
  15.   - service: todo.get_items
  16.     target:
  17.       entity_id: todo.alexa_shopping_list
  18.     data:
  19.       status: needs_action
  20.     response_variable: shoppinglist
  21.   - service: notify.casa
  22.     data:
  23.       message: >
  24.         Lista Spesa aggiornata: {{'🛒'}} {%- for item in
  25.         shoppinglist['todo.alexa_shopping_list']['items'] %}
  26.          - {{ item.summary }}
  27.         {%- endfor %}
  28.          
  29. mode: single
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement