Alexa Shopping list one way sync to HA

UPDATE 08/11:
There is a addon to run a scrapper on Amazon Shopping List (that comes from Alexa) and it can populate Home Assistant Shopping List:

###########################

Me and my wife are constantly asking Alexa to add things to the shopping list. However, when we go shopping, we prefer to use HA Shopping List.
So, I had to find a way to sync from Alexa to HA one way sync only.

In my first setup I had the following:

  • Alexa Shopping List => IFTTT => Home Assistant.
    An item was created in Alexa Shopping list, IFTTT would see that as a trigger and send a webhook to HA and add the item to HA Shopping List
    IFTTT stopped working with Alexa Shopping list, so I had to find a different way.

My second setup was:

  • Alexa Shopping List => Todoist => IFTTT => Home Assistant
    An item was created in Alexa Shopping list, it would automatically sync with Todoist, IFTTT would see that as a trigger and send a webhook to HA and add the item to HA Shopping List
    However, recently, IFTTT change its policy and Webhooks are available only in the paid version (Pro version).
    I had to find another way.
    In a quick search for ITFFF alternatives, I found Zapier (zapier.com)

My current setup that is actually working is:

  • Alexa Shopping List => Todoist => Zapier => Home Assistant
    An item was created in Alexa Shopping list, it would automatically sync with Todoist, Zapier sees that as a trigger and send a webhook to HA and add the item to HA Shopping List

If you want to set that up, follow the instructions below:

In Home Assistant:

1 - Go to Settings, Automations and click on Create Automation
2 - Add a trigger and select Webhook. Once create, click on the copy button on the right. It will copy something similar to:
http://10.0.0.1/api/webhook/-njfnsnfnalsdnaksd
Make sure when you use in Zapier, you use with your external URL:
i.e. https://my_ha_server/api/webhook/-njfnsnfnalsdnaksd
3 - Under Action, select Call Service, switch to YAML Editor and add the following:

service: shopping_list.add_item
data_template:
  name: "{{ trigger.json.name }}"

In Alexa App:

1 - Add Todoist Skill to your Alexa

In Zapier:

1 - Go to Zapier, create an account and create an app.

2 - Click on trigger, select Todoist and choose “New Incomplete Task”.

3 - When you click on Continue, it will ask you to Sign In to Todoist. Do it and click on Continue.

4 - Under Project, select Alexa Shopping List and click on Continue

5 - On the left side, click on Action.

6 - Select “Code by Zapier” and under Event, select “Run Javascript” and click Continue

7 - Under Input Data add the following (as the image below)
Webhook => https://your_ha_page/api/webhook/your_webhook (use the webhook address saved in the step #2 under “In Home Assistant:”
Methodo => POST
item_name => click and select “1. Content:” (it will show the last item in your list)

  • if you need help to create a webhook in HA, please check this page

8 - Under Code, add this:

let Timestamp = new Date().toISOString(); // creates a Timestamp
let Webhook = inputData.Webhook.trim();
let Method = inputData.Method.trim();
let item_name = inputData.item_name.trim();

// creates the JSON Object to send with the key/value pairs
let JSONObject = { "action": "call_service", "service": "shopping_list.add_item", "name": item_name}

// creates the Method, Headers, and Body of the HTTP POST Request
let Options = {
     method: Method,
     headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json'
     },
     body: JSON.stringify(JSONObject)
}
const Request = await fetch(Webhook, Options); // HTTP POST Request
output = {Timestamp}

9 - Click on Continue and click on Test step
The test above should add the item to your HA Shopping list.

10 - Click on Publish.
This last step should activate the App and everything that you add to the Alexa Shopping List will make into your HA Shopping List.

Because this is a one way sync (Alexa => HA), I have an automation to clear my Alexa Shopping List every day and I manage everything from HA only.

1 Like

There is a custom component Todoist Alexa Shopping List you should check out. I had an Iftt webhook set up for years and was looking for alternatives when it became unavailable. This component syncs Alexa - Todoist - Home Assistant almost instant and both ways.

In my case, I needed to sync one way only (from Alexa to HA).
I did not want items cleared from the HA Shopping List to be removed from Todoist and Alexa.

Is this solution still working?
I ve been using Todoist with Alexa but I just received a notification that Alexa - Todoist Sync will be shut down July 1st 2024

2 Likes

Bumping because I’m now in CRISIS because of the deprecation. What will replace it? WHAT DO WE DO!!! I use the Alexa->Todoist tasks/shopping list all the time!

1 Like

Unfortunately, I think the issue here is that Amazon will drop support for the List Management API

1 Like

Same here, I was looking for an alternative but I couldn’t find anything yet. I hope someone finds a workaround… Todoist was perfect and easy to setup :cry:

1 Like

For now you could use the Bring App and HACS bring integration. But you will have to call Alexa open up the Bring Shopping list first and then add something. I have not yet tried it, but it seems like the only option currently :frowning:

1 Like

Following as I’m in the same predicament. Has anyone had any breakthroughs yet?

Hi all,

I created a project that is able to do a one-way sync from Amazon Shopping List to HA using a js scraper.
This is not a “stable” version, so use with caution.
I also added the instructions on how to use it.

Maybe somebody with more knowledge can take this and make a better version of it :slight_smile:

1 Like

Just set this up and it worked perfectly. Thanks!!

This is wonderful! Since Amazon killed all list Apps, I was using Anylist, I am also struggling with this.

I am not so experienced with creating this docker file and how to install this on my Home Assistant, can you help with steps how to install this on a HA Os machine?

I run HA on a dedicated Intel server, but don’t know where to place the files and whether I need to update the scripts that you posted after creating the automation. So I basically get lost after step 10.2 … any guidance is appreciated!

Hi @ajwk,

Unfortunately, the image was created for docker only and not as a Add-On to Home Assistant.
I currently have the Container running in a separate server (using Docker) and the image communicates with my Home Assistant via Webhooks.

In your case, I would suggest the following:
1 - Install the HassOS SSH Configuration
You can install as an Add-On using this repository (GitHub - adamoutler/HassOSConfigurator: A set of Add-Ons to configure HassOS For various platforms and development purposes.)

2 - Access the Home Assistant in the OS Level

3 - Run the Docker Image instructions described at GitHub - thiagobruch/amazon_shopping_list_scrape
(docker pull and rocker run commands)

  • Make sure that when you run the “docker run” command, you put everything in a single line

Hi @ajwk,

I created an Home Assistant Addon.

You can find it here:

4 Likes

Hi, good job…but i didnt understend how to get the OTP_APP_SECRET: after Clicking on “Can’t scan the barcode” and saving the Key (13 sets of 4 characters each), the Amazon web Page ask me for a otp code genereted by the app … Where i can find this?

Hi @corrobor,

Once you click “Can’t scan the barcode” and saved the Key, scan the barcode with an Authenticator App (i.e. Google Authenticator - https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) and answer with the 6 digits code provided in the app.

Ahhhhhh ok!!! Thanks

In my case It doesnt work because I live in Italy and my shopping list is at “amazon.it” instead “amazon.com”.
I’m not able to recompile your container for italian people :frowning:

Hi @corrobor ,

The addon has options to change the sign-in and shopping list URLs.

Go to the Configuration Tab in the Addon and change the URLs to the Italian ones.

@thiagobruch thanks Friends, you are very kind! But i havent hassio. I’m using home assistant core as docker container so i cannot use the addon :frowning: