Control Alexa device with Home Assistant

I have signed up for Home Assistant Cloud. How can I control my Alexa devices using Home Assistant please? (Note that I know how to do it the other way around, i.e. controlling HA devices using Alexa. It’s using HA to control Alexa devices that I am interested in!)

[Edit: is short, (I need some of) my Alexa devices (namely devices discovered by Alexa) to show up as devices in HA.]

alexa doesn’t expose a lot of interfaces to be controlled. and i don’t believe it exposes anything really to control the devices it sees (ie, controling devices through alexa).

to do most of what you can, you should use the hacs alexa_media_player as well as the alexa integration:

1 Like

Alexa does recognise input_booleans as triggers for routines.

1 Like

ah good point. once you have alexa installed with the integration link i posted above, you can invoke routines, which in term of course can control devices in alexa. here’s how you’d do a routine:

service: media_player.play_media
target:
  entity_id: media_player.study_2
data: 
  media_content_id: close study blinds
  media_content_type: routine

@Stiltjack, i’m not sure what you mean about input_booleans directly triggering routines? certainly an input_boolean can trigger the play_media above which runs the routine, but you’re talking about something more direct?

I guess I could settle for exposing my HA button (a Tradfri Shortcut button) to Alexa, but guess what: Alexa does not like it (“not supported”)!

could you explain what you’re trying to accomplish?

you were asking how to control alexa devices from home assistant. to have alexa devices show up in home assistant. how does exposing a home assistant button to alexa replace that?

if you want the full device to show up, and show state and everything, i don’t know of a way to do that. but you can direct them optimistically via routines as described above. but i dunno how exposing ha to alexa helps you.

I got one of them adjustable beds that can be controlled via Alexa. I also have a bunch of Zigbee buttons, and I am hoping that I can control my bed using my buttons. Apparently this is a tall order!

Ideally, I’d like to see the bed in HA via Alexa, but apparently that can’t happen, unless using complicated hacks or whatever. The other way would be acceptable too: make the button show up in Alexa, so I can control the bed using Alexa routines triggered by the Zigbee button. Like I said, apparently Alexa does not support the button.

you can trick alexa to see the zigbee button. especially if it’s a simple push button where pushing it invokes a simple alexa command. lots of ways to accomplish that.

the harder thing to do is if push and hold on the button raises until you release the button… there would be a latency there that would probably be really annoying. but if it’s a simple push, you can get that to work

1 Like

When you write a routine in the Alexa app, not many Home Assistant entities can be used in the “When this happens” field that triggers the routine. Originally it was only devices with device class door, but that was extended to input_booleans (although the app continued to refer to them as contact sensors which could be “open” or “closed”). I think this may have been further extended to all binary sensors - at least, switches now seem to work too.

In any case, you can write a routine in the Alexa app beginning with “When contact sensor [your_input_boolean] changes to open” which then launches an Alexa skill. I don’t have any Alexa controlled devices, but I imagine they could be managed in the same way. I think that was what the OP was asking about.

He won’t be able to have his Alexa-controlled devices show up as such in HA, but he might be able to represent them as input_booleans. His Zigbee buttons could toggle those on and off.