Sync Alexa Shopping list one way to bring

Note: It is only suitable for English and German languages! (Otherwise, please adjust it yourself.)

Hello everyone,

This Automation sync your Alexa Shoppinglist one way to Home Assistant integration like bring etc.
Its a simple way that we can use again “Alexa, put Peanuts to my shoppinglist” instead of “Alexa, open Bring and put Peanuts to my Shoppinglist”.

Since summer 2024, Amazon has restricted third-party skills from accessing data processing related to the shopping list. While there are some cool approaches from other users, these often rely on additional cloud services or require complex installation processes.

To bypass Amazon’s restrictions, I wrote this blueprint.

It requires the Alexa Media Player integration for Echo devices and a shopping list, either directly from Home Assistant or another integration, such as Bring.

The first automation handles querying and processing the Echo devices, filtering the voice input for specific keywords. The filtered input is then passed to the shopping list of your choice.

The second automation is for the Alexa Media Player integration. It triggers the update service of Alexa Media Player every 6 seconds to process voice input in a timely manner.

The change in the configuration.yaml will prevent your logfile for flooding.

Automation 1:

alias: Alexa Shoppinglist Crawler
description: |+
  Fügt Artikel aus der Alexa Einkaufsliste zur Bring Einkaufsliste hinzu.

  Add items from the Alexa shopping list to the Bring shopping list.

triggers:
  - entity_id:
      - media_player.echo_wohnzimmer
      - media_player.echo_badezimmer
      - media_player.echo_garage
      - media_player.echo_schlafzimmer
      - media_player.echo_gastezimmer
    attribute: last_called_summary
    trigger: state
conditions:
  - condition: template
 value_template: |2-
        {{ 'einkaufsliste' in trigger.to_state.attributes.last_called_summary.lower() or
           'liste' in trigger.to_state.attributes.last_called_summary.lower() or
           'shopping list' in trigger.to_state.attributes.last_called_summary.lower() or
           'shoppinglist' in trigger.to_state.attributes.last_called_summary.lower() or
           'shopping cart' in trigger.to_state.attributes.last_called_summary.lower() }}
actions:
  - variables:
      phrase: "{{ trigger.to_state.attributes.last_called_summary.lower() }}"
      ignored_words:
        - einkaufsliste
        - shoppinglist
        - shopping cart
        - list
        - liste
        - throw
        - toss
        - add
        - dump
        - shove
        - slap
        - stick
        - include
        - bag
        - tote
        - some
        - do
        - to
        - "on"
        - the
        - make
        - take
        - put
        - setz
        - setze
        - pack
        - packe
        - mach
        - tu
        - füge
        - füg
        - hinzu
        - zu
        - auf
        - die
        - zur
        - stück
        - stücke
        - mal
      words: >-
        {{ phrase.split() | reject('in', ignored_words) | join(' ') | capitalize
        }}
  - action: todo.add_item
    metadata: {}
    data:
      item: "{{ words }}"
    target:
      entity_id: todo.bring
mode: queued
max: 3

Automation 2:

description: ""
triggers:
  - trigger: time_pattern
    seconds: /6
conditions: []
actions:
  - action: alexa_media.update_last_called
    data: {}
mode: single

configuration.yaml:

logbook:
  exclude:
    entities:
      - automation.alexa_shoppinglist_update_media_player

With kind regards,

Mathias Harmening

1 Like