Alerts with Motion sensor

I have a motion sensor with the binary sensor

binary_sensor.x10_on_off_sensor_x10_a_04.

I cannot figure out how to build an automation to trigger a tone or chime on an Alexa/Echo dot. Should be simple but I can’t seem to make it happen. Any fantastic/wonderful peeps out there that might be able to assist?

thanks in advance.
s

What have you tried so far?
Can you share an automation you have tried and that you can’t get get to work so we can see where you might be going wrong?

- id: '1659882445615'
  alias: Scott Office Motion in Office
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.x10_on_off_sensor_x10_a_02
    from: 'false'
    to: 'true'
  condition: []
  action:
  - service: media_player.volume_set
    data:
      volume_level: 0.5
    target:
      area_id: scott_s_office
  - service: notify.alexa_media_scott_s_office
    data:
      data:
        type: announce
        method: all
      message: .
  mode: single

Are you using ha cloud? How did you integrated Alexa in ha?

Using cloud. Alexa Media Player and Home Assistant Skill

You can use notify service. To test it go to developer tools, services and search for notify. It should give you your alexa device. Test it there if it works just call it in automation.

try changing your trigger:

trigger:
  - platform: state
    entity_id:
    - binary_sensor.x10_on_off_sensor_x10_a_02
    from: 'off'
    to: 'on'

thx. trying now

So this works, kinda…I can only get it to work with announce. I’d like it to use the Alexa sound effect chime.

- id: '1659882445615'
  alias: Scott Office Motion in Office
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.x10_on_off_sensor_x10_a_02
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: media_player.volume_set
    data:
      volume_level: 0
    target:
      area_id: scott_s_office
  - service: notify.alexa_media_scott_s_office
    data:
      message: a
      data:
        type: announce

ie.

{
  "entity_id": "media_player.CHANGE_ME_TO_YOUR_DEVICE",
  "media_content_id": "amzn_sfx_doorbell_chime_01",
  "media_content_type": "sound"      
}

but I’m not sure how to parse this into an automation.yaml. ugggg!

try this:

action:
  - service: media_player.play_media
    data:            
      entity_id: media_player.CHANGE_ME_TO_YOUR_DEVICE
      media_content_id: "amzn_sfx_doorbell_chime_01"
      media_content_type: "sound"

Unfortunately there is NOTHING now…

- id: '1659882445615'
  alias: Scott Office Motion in HALL
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.x10_on_off_sensor_x10_a_02
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: notify.alexa_media_scott_s_office
    data:
      entity_id: media_player.scott_s_office
      media_content_id: amzn_sfx_doorbell_chime_01
      media_content_type: sound

it did work with TTS but not with the doorbell.

whoops … found a type on the service. making good progress.

so the code works with a manual RUN ACTION, but for some reason the trigger is NOT working. Also, I had the wrong sensor listed early…it is correct now _01.