Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save peyanski/bf98b1b2524d52bd0fbfb5abe0a596da to your computer and use it in GitHub Desktop.

Select an option

Save peyanski/bf98b1b2524d52bd0fbfb5abe0a596da to your computer and use it in GitHub Desktop.
Say 'send me the shopping list' using Assist.
alias: Shopping list — send to Kiril's phone by Assist
description: Say 'send me the shopping list' using Assist.
triggers:
- trigger: conversation
command:
- send me the shopping list
- send the shopping list to my phone
note: >
These exact Assist phrases send the native Shopping List to Kiril's
iPhone.
If you duplicate this automation for another recipient, use a unique
phrase
so both automations do not respond to the same sentence.
actions:
- action: todo.get_items
target:
entity_id: todo.shopping_list
data:
status: needs_action
response_variable: shopping
note: |
Read only unfinished items. For another list, such as todo.hardware,
change this entity ID and the matching response key in the next step.
- variables:
item_names: >-
{{ shopping['todo.shopping_list']['items'] | map(attribute='summary') |
list }}
note: |
Extract item names from the response. If the target becomes todo.hardware,
change the key to shopping['todo.hardware']['items'] here too.
- action: notify.mobile_app_kiril_iphone
data:
title: Shopping list
message: |-
{% if item_names | count > 0 %}
To buy: {{ item_names | join(', ') }}
{% else %}
Nothing to buy.
{% endif %}
data:
tag: kiril-shopping-list
url: /shopping-list
clickAction: /shopping-list
note: >
Send the list snapshot to Kiril's iPhone. For a duplicate, change this
notify action to that person's phone and give the recipient/list a unique
tag.
/shopping-list opens only the native Shopping List. For todo.hardware,
use the real dashboard To-do card path in both url and clickAction.
Tapping the push opens the live list, where items can be checked off.
- set_conversation_response: I've sent the shopping list to your phone.
note: |
Speak this response after the notification action returns. It does not
prove the phone displayed the push, so test delivery on the handset.
mode: queued
max: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment