Adding a shopping list item using webhook api HTTP POST...almost there...need help

Hey guys, I have been trying to do something simliar with webhooks. Maybe this helps someone here, whoever finds this thread in the future. But: this will only work if you are subscribed to Nabu Casa Cloud, to have access to webhooks. Maybe there is another way, but I am subscribed so I can only speak for this way of doing it.

Here is the guide:

I was trying to use Alexa to add things to my shopping list in HA, so that may girlfriend and I both have the same shopping list when we open the HA app on our phones. I tried the IFTTT integration but it did not work for me, as I had to restart the service on IFTTT from time to time to get it to work - I don’t know why. Therefore I was looking for an alternative and first used Zapier, but they no longer offer Webhooks on their free plan. That’s why I used Automate.io to use ToDoIst and Webhooks. Step by step guide:

  • First I connected Alexa to ToDoIst. There is a skill on the app where you can “link” both lists. If you add something to your shopping list in alexa (e.g. via voice) it is also added to ToDoIst and vice versa.

  • Now I needed ToDoIst to add that item to my shopping list in HA: first create a new automation in your automations.yaml file with the following code:

  - id: shopping_list_webhook_test
    alias: shopping list webhook test
    trigger:
      platform: webhook
      webhook_id: shopping_list_webhook_test
    action:
      - service: shopping_list.add_item
        data_template:
          name: "{{ trigger.json.name }}"
  • Reload your automations and it should create a new automation. Go to Settings --> Home Assistant Cloud --> Webhooks --> “shopping list webhook test” --> copy the webhook URL

  • Go to the automate website and create a new bot and connect ToDoIst and use “new task” as a trigger & also choose your project --> “Alexa Shopping List” is the name of my list

  • Then choose the action: choose Webhook & “POST DATA” and insert your Webhook URL you copied earlier

  • Choose content type “JSON” and add this for the data field:

{"name":"Task Name"}
  • The field task name can be chosen from the little plus in the top right corner

  • The other fields can stay empty

Now you should be good to go! Add a new task in ToDoIst or on your Alexa Shopping List and then hit save on your bot and try to run it. It should pick up the new task and post the JSON data, which triggers your automation in HA and adds the JSON data to your shopping list!

1 Like