I have been told that you can use the play_media command to run an Alexa routine, but I can’t get it to work.
I have a routine called “Set lights for cooking”. When I say “Alexa, set lights for cooking” a dozen lights change. I want to do this with Home Assistant. Some of the light switches are not supported by Home Assistant, so I’m trying to get Alexa to do it. If I run the automation manually in HA, Alexa responds, but not correctly. Here is the HA Automation:
- id: ‘1631463603596’
alias: Set lights for cooking
description: ‘’
trigger:- type: opened
platform: device
device_id: e6c1eafc991f6541636fe436160c795c
entity_id: binary_sensor.shelly_shdw_2_e8db84d3d0c4_door_window
domain: binary_sensor
condition: []
action: - service: media_player.play_media
target:
device_id: 4913de717a9eaf24e90cf79fd768378c
data:
media_content_id: Alexa, Set lights for cooking
media_content_type: custom
mode: single
- type: opened
In the Automation, I’m trying to use a Shelly Door/Window sensor, but that is not important. If I run it manually, I get the same result. The device_id is for an Echo Flex, but I tried different Echo devices.
In my cell phone Alexa App under → Activity → Voice History I see the following:
This is the same message that Alexa gives me if I make a mistake on the command. For example, if I make a mistake and add the word kitchen and say Set kitchen lights for cooking, it replies You have Smart Life enabled…
I think I am close to correct, or what I am trying to do is impossible.
Any help would be appreciated. I searched through the posts but could not find the answer, although I suspect this question has been answered.
Cheers