Syncing Alexa/Google with the Shopping List

Hi dbrunt, the way it works is that IFTTT is doing the magic. Within IFTTT, you create a trigger that says: “If a new item is added to my Alexa shopping list [requires to link your IFTTT account with Amazon Alexa, native Alexa object in IFTTT], then add this item to Home Assistant [webhook in IFTTT]”.

I’ve followed the instructions from SMRThome and it works like a charm. However, my lovelace shopping card is not automatically refreshed. I’ve searched for several solutions and only found a way to achieve this using browser_mod.lovelace_reload, which requires the installation of the community integration of browser_mod. Isn’t there a native way to call a service within the automation, to force the shopping card to refresh when the shopping list is updated? Thx for your help.

I have both Add and Completed working from Alexa now.

Required

Configuration

IFTTT My Applets:
Create:

  • If Item added to your shopping list
  • Then Make a web request
  • URL:
  • Method: POST
  • Content Type : application/json
  • Body: { “action”: “call_service”, “service”: “shopping_list.add_item”, “name”: “{{AddedItem}}”}

Create:

  • If Item completed on your shopping list
  • Then Make a web request
  • URL:
  • Method: POST
  • Content Type : application/json
  • Body: { “action”: “call_service”, “service”: “shopping_list.complete_item”, “name”: “{{CompletedItem}}”}

Home Assistant Automation

alias: Webhook Recieved
description: ''
trigger:
  - platform: event
    event_type: ifttt_webhook_received
    event_data:
      action: call_service
condition: []
action:
  - service: '{{ trigger.event.data.service }}'
    data_template:
      name: '{{ trigger.event.data.name }}'
  - service: shopping_list.clear_completed_items
mode: single

The Lovelace panel seems to need a browser refresh/reload to display the new/modified shopping list…

2 Likes

Thanks for this discussion, I now have my Alexa Shopping List copying over to my Home Assistant shopping list. Has anyone managed to get it working in the other direction? As in when you update Home Assistant’s shopping list it updates Alexa?

@mlw05 I ended up going with the todolist plugin (Amazon Alexa support only) and it works surprisingly well! It allows me (and my wife) to add items via voice prompts as well as directly typing them in on the HA dashboard. You can cross off items by either asking Alexa to remove XYZ from the shopping list or deleting it off the card. I even built in some custom scripts to have it text the shopping list to either my wife or my cell phone when executed.

Hello,
I didn’t find a way to sync from HA to Alexa, so instead, I decided to clear the Alexa shopping list every week, just after a reminder is set.
If that could be useful to anyone, I do it as follows:
I call the service media_player.play_media on my Alexa dot, with the following data

{
   "media_content_type": "custom",
   "media_content_id": "clear the shopping list"
}

Then put a 5s wait node, and call the same service again with

{
   "media_content_type": "custom",
   "media_content_id": "yes"
}

(because Alexa asks to confirm if I want to clear my shopping list - the above confirms the action)