Lost and Found - Find my analogue items

Hey all. This is something I’ve been looking in to for a little while. I’ve recently moved from the Google home model to use Amazon Echos around the house. One thing that I was interested in were the “find my” services for your dumb devices.

I read a few reviews though and didn’t think much of them and thought I would have a go at making something with HA knowing that Home Assistant was moving towards voice (and quickly so).

The idea is fairly simple - you make a list of things and where they are stored in a todo list. When your son or wife or a visitor doesn’t know where something is they can ask the smart speaker “where are the tea bags” and the assistant should reply “The tea bags are in the cupboard above the sink”… or whatever.

I haven’t tried this with voice assistant yet but will be very shortly. For now, I have a script that takes the input from an input_text helper, looks for a corresponding item on a todo list and outputs the description into another input_text helper.

Input what you’re looking for in the first field, press the button and it’ll give the description in the output field:

Here is the script for anyone interested:

alias: Find My
  - service: todo.get_items
    metadata: {}
      status: needs_action
      entity_id: todo.find_my
    response_variable: todo
  - variables:
      thing_to_find: |
        {{ states('input_text.find_input') }}
      found_things: >
        {{ todo['todo.find_my']['items']| selectattr('summary','search',
        thing_to_find) | list }}
      location: >
        {% if thing_to_find in todo['todo.find_my']['items'] |
        map(attribute='summary') | list %}
          {{ found_things[0]['description'] }}
        {% else %}
          Not Found
        {% endif %}
  - service: input_text.set_value
    metadata: {}
      value: |
        {{ location }}
      entity_id: input_text.find_output
mode: single
icon: mdi:home-search

One thing to note - I don’t think the status of the todo is necessary as I believe the default is to return all items, completed or not.

I look forward to trying this with voice assistant. Especially interested in being able to dynamically add items to the list.

If anyone has a go, let me know how you get on.