{"id":13310,"date":"2021-04-09T12:03:18","date_gmt":"2021-04-09T12:03:18","guid":{"rendered":"https:\/\/www.rjt.org.uk\/home\/?post_type=home_assistant_tip&#038;p=13310"},"modified":"2021-04-09T13:12:12","modified_gmt":"2021-04-09T13:12:12","slug":"shopping-list-todoist","status":"publish","type":"home_assistant_tip","link":"https:\/\/www.rjt.org.uk\/home\/archives\/home-assistant-tip\/shopping-list-todoist\/","title":{"rendered":"Shopping List &#8211; Todoist"},"content":{"rendered":"\n<p>Already combining Todoist with Alexa for a shopping list.  We needed a quick way to add items from the Lovelace interface.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">alias: Add to Shopping List\ndescription: ''\ntrigger:\n  - platform: state\n    entity_id: input_text.add_list_item\ncondition: []\naction:\n  - service: script.send_to_shopping_list\n    data: {}\n  - service: input_text.set_value\n    data:\n      value: ''\n    entity_id: input_text.add_list_item\nmode: single<\/pre>\n\n\n\n<p>The called script adds the item to the todoist list and forces an entity update<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">alias: Send to shopping list\nsequence:\n  - service: todoist.new_task\n    data:\n      content: '{{ states(''input_text.add_list_item'') }}'\n      project: Alexa Shopping List\n  - service: homeassistant.update_entity\n    entity_id: calendar.alexa_shopping_list\nmode: single\nicon: 'mdi:basket'<\/pre>\n\n\n\n<p>Finally a lovelace template card shows the information.  With an input box below text-input-row is a HACS download called <a href=\"https:\/\/github.com\/gadgetchnnel\/lovelace-text-input-row\">&#8220;Lovelace Text Input Row&#8221;<\/a>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">type: vertical-stack\ncards:\n  - type: markdown\n    title: Shopping List\n    content: >-\n      {%- for item in states.calendar.alexa_shopping_list.attributes.all_tasks\n      -%}\n          {{item}}{{\" \\n    \"}}\n          {%- endfor -%}\n  - type: entities\n    entities:\n      - entity: input_text.add_list_item\n        type: 'custom:text-input-row'\n<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"template":"","class_list":["post-13310","home_assistant_tip","type-home_assistant_tip","status-publish","hentry","comments-off"],"_links":{"self":[{"href":"https:\/\/www.rjt.org.uk\/home\/wp-json\/wp\/v2\/home_assistant_tip\/13310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rjt.org.uk\/home\/wp-json\/wp\/v2\/home_assistant_tip"}],"about":[{"href":"https:\/\/www.rjt.org.uk\/home\/wp-json\/wp\/v2\/types\/home_assistant_tip"}],"wp:attachment":[{"href":"https:\/\/www.rjt.org.uk\/home\/wp-json\/wp\/v2\/media?parent=13310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}