Home Assistant Automation

Already combining Todoist with Alexa for a shopping list. We needed a quick way to add items from the Lovelace interface.

To do this a text helper was added with a script to add the item to the shopping list when ever the value was entered.

alias: Add to Shopping List
description: ''
  - platform: state
    entity_id: input_text.add_list_item
condition: []
  - service: script.send_to_shopping_list
    data: {}
  - service: input_text.set_value
      value: ''
    entity_id: input_text.add_list_item
mode: single

The called script adds the item to the todoist list and forces an entity update

alias: Send to shopping list
  - service: todoist.new_task
      content: '{{ states(''input_text.add_list_item'') }}'
      project: Alexa Shopping List
  - service: homeassistant.update_entity
    entity_id: calendar.alexa_shopping_list
mode: single
icon: 'mdi:basket'

Finally a lovelace template card shows the information. With an input box below text-input-row is a HACS download called “Lovelace Text Input Row”.

type: vertical-stack
  - type: markdown
    title: Shopping List
    content: >-
      {%- for item in states.calendar.alexa_shopping_list.attributes.all_tasks
          {{item}}{{" \n    "}}
          {%- endfor -%}
  - type: entities
      - entity: input_text.add_list_item
        type: 'custom:text-input-row'