Run HA Scenes / Scripts from Alexa without Nabu Casa

I have Alexa connected to HA the manual way, via AWS, not using Nabu Casa (I am using Cloudflare for external access)
I have actionable notifications running, but what I cannot see is how to trigger a HA scene or script from a custom Alexa command.
In my first potential used case, I have Alexa asking if lights / aircon are required when motion is detected in our small gym room.
What I would like to do is have the ability to, for example, say “Alexa, I am done” when the occupant is finished (don’t really want to rely on a motion sensor for this), and have a HA scene turn off those same devices.
Can this be done ?
Ok I am pretty sure the answer will be that it can, so my question should be how to do it ?

You can call scripts from alexa. So, inside your routine, you can trigger a script to do some stuff as long as script entity is exposed to alexa.

Sorry bit more help required.
I can’t see how to expose scripts to Alexa.
Can you advise, as I cannot see them in the Alexa app

Following the initial link, you can configure your Alexa integration to expose everything or individual entities. I have exposed script.test using configuration and i can see it as a scene inside alexa app.

I actually do not have the Alexa integration. Because I didn’t use the Nabu Casa Cloud, as far as I can tell, the Alexa integration is not an option, so I went down the AWS linking route for the Alexa media players. Which works fine for actionable notifications - at least it would if I could sort out the code correctly.
My Alexa app does show a large number of devices from the home, but I guess not via HA. And no scripts, automations or anything else.
The Home Assistant skill is not enabled in the app, and if I try to enable, it just goes off looking for devices and cannot find anything.
Am I missing something obvious ? (I usually am).

Forget about the alexa integration, it allows you to control echo devices from home assistant, not vice versa.

Check the initial link I posted, there are 2 options there.

  1. (paid) nabu casa option - very east to setup
  2. (free) self service AWS skill - requires lots of hops to do it, but you can if you try :slight_smile:

Following option 2, you can do what you want.

Another option is to use the Emulated Hue integration. It will expose entities as switches to Alexa. A scene or a script can be triggered this way. It does not involve any cloud integration/path. You would set up Alexa to understand “Good night” to turn on switch ‘Good night scene’. (Needs HA’s port 80 to be visible to your Echo.)

1 Like

Really appreciate you trying to help. Please forgive this dumb*ss for not being able to follow.
I did set up via AWS, but have I potentially missed something which allows HA to be properly exposed ? As mentioned previously, I can use the AWS route to get actionable notifications working, but when I look in the Alexa app, although I have many devices in the house exposed, there is nothing, as far as I can tell, which is from HA.
You mention that you exposed script.test using configuration, but if I understand you, that was inside the Alexa integration. Without that integration, do I need to do something else within AWS ? I know that maybe an impossible question, given that you don’t know what I did with the AWS skill (actually I followed the Mark Watt Tech YT video if that helps at all), but in general, do you know whether, having got actionable notifications working, I should be able to then expose HA entities to Alexa ? Right now, within the Alexa app, the “Alexa Notifications with Actions” is enabled, however there is then a “HomeAssistant” skill. When I try to enable this, it goes off searching for devices to connect, but comes back with “couldn’t find a new device to connect”, then asks whether I can control the device using the manufacturers app. If I say yes, it still can’t find anything new. The app then still says I have to enable to use the HomeAssistant skill.

Again, summarizing here;

  • there is alexa media player custom integration which allows you to send notifications to alexa devices from home assistant. This doesn’t use aws skill, it is using unofficial amazon apis. This will expose some echo based lights and plugs into home assistant to control them from home assistant but let’s skip this part as of now.

  • there is alexa integration which requires you to have either nabu casa or aws custom skill so you can expose and control your home assistant devices from echo devices or alexa app. This is where you set your configuration to expose entities to alexa world.

If you want actionable notifications, you need both so you can send a notification to alexa devices using custom integration (1) and react on responses inside alexa ecosystem to turn on/off using alexa aws skill. (2)

I am asking you to read the first link I shared, please.

Rory
Thanks for kicking in.
Tried adding Emulated Hue.
Config is:

# Emulated Hue integration to allow Alexa to talk to HA
emulated_hue:
  host_ip: 192.168.68.127
  listen_port: 80
  expose_by_default: false
  exposed_domains:
    - light
    - switch
    - group
    - scene
    - script

Using: http://<HA IP Address>:80/description.xml as per the HA instructions works I think, although the content is

<root>
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.68.127:80/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>Home Assistant Bridge (192.168.68.127)</friendlyName>
<manufacturer>Royal Philips Electronics</manufacturer>
<manufacturerURL>http://www.philips.com</manufacturerURL>
<modelDescription>Philips hue Personal Wireless Lighting</modelDescription>
<modelName>Philips hue bridge 2015</modelName>
<modelNumber>BSB002</modelNumber>
<modelURL>http://www.meethue.com</modelURL>
<serialNumber>001788FFFE23BFC2</serialNumber>
<UDN>uuid:2f402f80-da50-11e1-9b23-001788255acc</UDN>
</device>
</root>

with a message:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

If I try http://<HA IP Address>:80/api/v2/lights (or groups), it does not show any devices. If I try the same with scene (or scenes) or script / scripts or switch / switches / switchs, I get an error 404

Any idea where I am going wrong ?

Sorry I think I got there in the end. My bad for not realizing, despite you being quite clear about it, that there was a second Alexa integration.
So today went through the process, and everything appeared to go ok. The test in the AWS website did seem to pick up scripts etc.
The problem was, that when I asked Alexa to discover devices after the account linking was done, nothing new came through - no scenes, scripts, groups… anything.
I then tried to limit the domains in the HA config, in case I was overloading the link, but it has made no difference.
I could be looking in the wrong place, or maybe it just needs time.
If nothing comes through overnight, I will have to revisit the set up and maybe try a different server location.
Otherwise, very stuck again.

When you are setting up AWS lambda, there is a testing step, which was supposed to list of exposed entities? What happened there?

This time, you will get a list of your devices in the response. 🎉

The test appeared to work
I got back a huge return, which appeared to include scripts and other things.
There are in excess of 100 physical sensors in the house - I know this could be going outside the scope of a HA discussion, but do you think it is possible I overloaded the system ?

Nope, it won’t and if you want to limit exposed entities, just use alexa integration configuration through yaml and restrict to these entities.

So, going back to previous problem, i suggest you to try with different endpoints (regions).

Hi there,

I am currently experiencing the same issue. In the Lambda debug I can see the exposed script but it’s not visible in the Alexa User GUI.

I am currently using the EU-WEST ARN, do I need to change it? Locale is de-DE btw.

It’s really a bit frustrating, hope that Amazon this not change any to this?

Dan

Scripts are not visible on alexa ui, they are triggered via voice commands.

Locale is one dimension but your digital marketplace actually matters.