Works a treat
Does this shopping list sync still work with 2023.11? Iām a bit hesitant to update to .11, because I donāt want to break my shopping list sync, that I really use every day.
Works ānativelyā in 2023.11. I installed it this morning, just having the todoist skill in Alexa and the integration in HA
it didnāt appear to be working after I upgraded, but itās quite easy to switch over to the new system-
- disable the
pyscript
addon (if you donāt have any other pyscripts) - disable your
update-shopping-list
automation - remove the
command line/shopping_list_sensor
from yourconfiguration.yaml
- add the
todoist
integration (use the API from yourshopping_list_sync.py
) - make revisions to your scripts/automations that reference the old shopping list entities
Notes:
- I donāt see a way to use webhook for the
todoist
integration, so it can take 30 seconds or so for it to update from that direction, but changes to your HA list are pretty much immediately propogated back to todoist -
todo.alexa_shopping_list
contains the count of items on your shopping list -
calendar.alexa_shopping_list
attributeall_items
contains the list of items
For example, here is my revised automation that notifies anyone when entering a predefined shopping area (edit in your list of mobile device entities and grocery location entities)
alias: notify-shopping-list
description: ""
trigger:
- platform: zone
entity_id: device_tracker.first_phone,device_tracker.second_phone
zone: zone.grocery_1
event: enter
- platform: zone
entity_id: device_tracker.first_phone,device_tracker.second_phone
zone: zone.grocery_2
event: enter
condition:
- condition: numeric_state
entity_id: todo.alexa_shopping_list
above: 0
action:
- service: notify.mobile_app_{{ states[trigger.to_state.entity_id].object_id }}
data:
title: Grocery List ({{ states('todo.alexa_shopping_list') }} Items)
message: >-
{{ state_attr('calendar.alexa_shopping_list','all_tasks') | join(',\n')
}}
data:
tag: grocery-list
notification_icon: mdi:food-apple
clickAction: /shopping-list
url: /shopping-list
Hi @fenty17,
When an item is completed in the Shopping List (HA) is removed since the todoist API does not return the completed
tasks or items.
I modified the script to fetch the completed items and combine with the active items.
def get_completed_tasks():
get_tasks_url =f"https://api.todoist.com/sync/v9/completed/get_all?project_id={TODOIST_PROJECT_ID}"
headers = {"Authorization" : f"Bearer {TODOIST_TOKEN}"}
status_code = 500
while status_code is not 200:
response = task.executor(requests.get, get_tasks_url, headers = headers)
status_code = response.status_code
task.sleep(1)
json = response.json()
json = json['items']
tasks = []
for item in json:
item['is_completed'] = True
item['content'] = item['content'].replace(" @Alexa", "")
tasks.append(item)
return tasks
def get_tasks():
get_tasks_url =f"https://api.todoist.com/rest/v2/tasks?project_id={TODOIST_PROJECT_ID}"
headers = {"Authorization" : f"Bearer {TODOIST_TOKEN}"}
status_code = 500
while status_code is not 200:
response = task.executor(requests.get, get_tasks_url, headers = headers)
status_code = response.status_code
task.sleep(1)
json = response.json()
completed_tasks = get_completed_tasks()
return json + completed_tasks
Itās working fine for me.
I can submit a pull request if you want.
Thanks in advance.
Hey Team,
may someone can support me here. I installed everything liked descripted but I can not start the pyscript.sync_shopping_list via services.
I just doesnt show up. The picture shows where I put the files. May there is a issue.
Thank you
I think a lot of us have probably moved to using the native HA to do lists with Todoist integration. Thatās what I did and it works better than this script did.
Hey, everyone, I see that Todoist are soon to stop support for the Alexa integration as stated on The Verge. I guess this is going to mean a lot of changes to make this as convenient as it has been
Following this thread, because I have the same concern. While I can always use the Alexa app to pull up my shopping list, it was nice having them syncād.
Hi, Does someone found a solution to replace this tool? Thanks!
Iām using this scraper: https://community.home-assistant.io/t/alexa-list-api-to-be-deprecated-july-1st-2024/735626/12
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 based on another project that was created by @Jon_White and improved by @emilypeek
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
Hello everyone
Thanks to @thiagobruch for the inspiration, this is my Python version of a scraper and add-on.
The scraper itself supports adding, updating, removing and marking complete but the HA integration still needs work to support updates. If anyone more knowledgeable is reading then please help out!
Updates from HA to Alexa are handled by automations via the list events and the Alexa to HA sync runs every minute within the add-on itself.