Automation for pushing shopping list when at the grocery store

I just wanna share this two automations, since I struggled some to get it working and cause I think its a valuable idea/automation!

Disclaimer: I do not, in any way, claim to be the first one automating this. Many may also be able to to this in their sleep, I do not claim it is complicated in any way. I just wanted to share, in case someone else would like to to it as well.

So, based on three stores/zones, you get a push notification with the items in the Shopping list integration as a list. You can either accept notifications, or you can dismiss is, depending on if you really are going shopping or just happens to be there for any other reason. If you accept it, the grocery list items becomes checked, so you don’t get the same ones next time you are there. That’s it.

If you want to, you could add a delay to the second automation, clearing the list, in case you want to see it in the companion app while shopping, and check things off yourself.

- id: '1723202774149'
  alias: Push Shopping List
  description: ''
  trigger:
  - platform: zone
    entity_id: person.XXX
    zone: zone.XXX_1
    event: enter
  - platform: zone
    entity_id: person.XXX
    zone: zone.XXX_2
    event: enter
  - platform: zone
    entity_id: person.XXX
    zone: zone.XXX_3
    event: enter
  condition: []
  action:
  - service: todo.get_items
    metadata: {}
    data:
      status: needs_action
    target:
      entity_id: todo.shopping_list
    response_variable: getGroceryList
  - service: notify.mobile_app_XXXXXX
    data:
      message: "{% for item in getGroceryList['todo.shopping_list']['items'] %}\n
        \ {{ item.summary }}\n{% endfor %}\n"
      title: 'Please buy:'
      data:
        actions:
        - action: grocery_ok
          title: Ok
        - action: grocery_no
          title: Not now
  mode: single

- id: '1723206679953'
  alias: iOS - Complete Shopping List
  description: ''
  trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: grocery_ok
  condition: []
  action:
  - service: shopping_list.complete_all
    metadata: {}
    data: {}
  mode: single
2 Likes