Simple way to get Amazon Echo 4th generation ultrasound motion/presence sensors into Home Assistant

I came up with a fairly simple way of getting the Echo 4th generation ultrasound motion detector into HA using Nabu Casa. I thought others may be interested in to use this technique:

  1. Create a template switch for each Echo device you want a motion sensor for. I tried this with virtual switches but it didn’t seem to work correctly (the routine didn’t seem to turn on/off the switch), so I just used a template that calls an empty script (create this empty script too, obviously), like this:
 - platform: template
   switches:
     sofa_dot_left_motion:
       friendly_name: "Sofa dot left motion"
       turn_on:
         service: script.turn_on
         data:
           entity_id: script.null
       turn_off:
         service: script.turn_on
         data:
           entity_id: script.null
  1. Make sure your new switch(es) are exposed to Alexa in Nabu Casa.

  2. In the Alexa app, create two routines: one to turn on your switch when motion is detected, and one to turn off your switch on absence of motion. See here if you need assistance with this: Create motion-triggered routines on a newer Amazon Echo or Echo Dot | TechHive

  3. Create a binary sensor for each echo device (not strictly required, but looks neater than leaving the raw switch and prevents anyone from turning our virtual motion sensor on and off):

- platform: template
  sensors:
    sofa_dot_left_motion:
      friendly_name: "Sofa dot left motion"
      device_class: motion
      value_template: "{{ is_state('switch.sofa_dot_left_motion', 'on') }}"
  1. Either use the binary sensor directly for motion sensor automations, or create a per-room group of all of your real and virtual echo motion switches in each room. I do the latter as I combine the echo motion sensors with real motion sensor so any of the echos and/or the real motion sensor trigger the motion sensor group. Using groups also has the advantage of not breaking the interface if the sensor is unavailable (as it sometimes is for my Shelly motion sensors) and you can also click on the group to see which motion sensors have triggered the group motion event.

  2. Use the motion group as a trigger for your motion automations.

Seems to work ok so far. I need to try it for a while and see how long Alexa keeps these virtual sensors on for before turning them off - if it doesn’t work reliably, I will instead create a script to turn off the motion sensor switch after x minutes of turning on (instead of the Alexa routine turning it off).

8 Likes

Is this still working for you?

It works, but it’s not very reliable… I have two pairs of echo dots in each of the living room and bedroom… sometimes only one of them triggers and quite often they take a long time to turn off. Sometimes they trigger falsely (I think from motion outside the window). I use a node red rule to provide for different treatment for the true motion sensor versus the echo one. Not ideal but better than nothing.

2 Likes

I’d be very interested in finding a good way to make this work.

I tried your solution and “ported” it to the newest HA-Version (2022.10.1). My config looks like this:

switch:
  - platform: template
    switches:
      kitchen_dot_ultrasound_motion:
        friendly_name: "Kitchen Dot Ultrasound Motion"
        turn_on:
          service: script.turn_on
          data:
            entity_id: script.null
        turn_off:
          service: script.turn_on
          data:
            entity_id: script.null
# ...
template:
  - binary_sensor:
      - name: "Kitchen Dot Ultrasound Motion"
        state: "{{ is_state('switch.kitchen_dot_ultrasound_motion', 'on') }}"
        device_class: motion

Just expose the switch to alexa and create a Routine.

4 Likes

thanks. really nice solution.
Do you know how much time do you have to wait until the detector change to nobody in the room?
I have seen that there is a lapse configuration in Alexa app, but I don’t know which time lapse would be best

Thanks NickC and JayReturns for sharing your solutions.
I implemented Jay’s and it worked right away.
Now I gotta learn Echo’s quirks for motion detection, lol

1 Like

Hi. I just setup these, including the routines in the Alexa app. When I manually trigger them from the app, the sensors properly update in HA. However, I can’t get the sensors to trigger on 2 different Echo Dot Gen4s via Motion. I even setup a separate routine on one of them where Motion turns on a light. The “Show activity” option in the app also indicates the routine has not been executed.

I have enabled ultrasonic motion detection on both devices in the Alexa app.

Any advice on getting the motion activity to be recognized on the device?
Thanks,
Neil

I’m in the same boat here. I followed the template steps listed above and while all of the entities appear the Echo’s themselves never seem to fire any events that HA can see. Maybe Amazon turned something off to save costs?

Hi, I just set it up.
You have to chose “Smart Home”, then your Echo’s name, and then presence.

EDIT: I guess i misunderstood.
Having the same Problem now as you, tho it worked perfect for once.

HI, does this still work? I’m using @JayReturns method above for the YAML code, which appears to work manually but nothing appears to be triggered from the Gen4 Echo dot.

How can we expose the Motion detection on the Echo Dot 5th gen? I can only expose temp sensor and media control, but nothing else.

what should be the result in the alexa app when motion is detected: “alexa will” ?

I am new to home assistant and alexa app. But I think the template is somehow always returning false.

In the configuration.yaml, I need to use {{ states('switch.kitchen_echo_ultrasound_motion') == 'on' }} instead for checking the sensor. Then I do the normal “expose entity” to alexa and add the device there and create the routine when echo detect motion then turn on/off that switch exposed.

Finally create the automation in the home-assistant for that switch to trigger on/off the light :smiley:

The section I added in my configuration.yaml

switch:
  - platform: template
    switches:
      office_echo_ultrasound_motion:
        unique_id: switch.office_echo_ultrasound_motion
        friendly_name: "Office Echo Ultrasound Motion"
        turn_on:
          service: script.turn_on
          data:
            entity_id: script.null
        turn_off:
          service: script.turn_on
          data:
            entity_id: script.null
      kitchen_echo_ultrasound_motion:
        unique_id: switch.kitchen_echo_ultrasound_motion
        friendly_name: "Kitchen Echo Ultrasound Motion"
        turn_on:
          service: script.turn_on
          data:
            entity_id: script.null
        turn_off:
          service: script.turn_on
          data:
            entity_id: script.null
          
template:
  - binary_sensor:
    - name: "Office Dot Ultrasound Motion"
      unique_id: binary_sensor.office_dot_ultrasound_motion
      state: "{{ states('switch.office_echo_ultrasound_motion') == 'on' }}"
      device_class: motion
  - binary_sensor:
    - name: "Kitchen Dot Ultrasound Motion"
      unique_id: binary_sensor.kitchen_dot_ultrasound_motion
      state: "{{ states('switch.kitchen_echo_ultrasound_motion') == 'on' }}"
      device_class: motion
1 Like

Hi there,

First off, thanks to everyone who has figured this out and shared it before - very much appreciated.

I am struggling to get the first part done, i.e. creating the switch and having that exposed. My config in the configuration file is as below:

# to get echo motion to HA
switch:
  - platform: template
    switches:
      bedroom_dot_ultrasound_motion:
        friendly_name: "Bedroom Echo Ultrasound Motion"
        turn_on:
          service: script.turn_on
          data:
            entity_id: script.null
        turn_off:
          service: script.turn_on
          data:
            entity_id: script.null

The script exists, but I cannot for the life of me figure out why it will not create and expose the switch, currently running on Home Assistant 2023.10.3 and have restarted a number of times, but not seeing any errors on the logs, nor am I seeing the switch in the entities list of the server. Anyone have any ideas on what I am doing wrong?

Thanks in advance!

I managed to get around this by simply ignoring the template switches and using a boolean helper exposed to Alexa, that I could then turn on based on the motion detection using a routine. For the record this works on the 5th gen echo.

To try and get around some of the other issues raised by others on this thread, I’ve also done the following:

  • on the Alexa routine set the trigger for motion detection to be reset every minute.
  • on the HA automation, switch off the input_boolean that is triggered by the routine.

Is there a way to set up home assistant to change what the “Tap Detection” does on the echo when you press it? I want a way to turn off my alarm by slapping my echo but currently that only snoozes the alarm. Thanks

@WaffleMaster22 This kind of question deserves its own thread if there isn’t one already.
Have you tried looking at the Echo entities in Developer Tools and seeing what changes when you press the snooze button?