I am running hass.io with Nabu Casa which works very well. I created a few scripts which I would like to execute via Alexa. What would be the right syntax to call up a script via Alexa?
Does this answer your question?
Well, the setup with Alexa is through Nabu Casa which is really super easy and most devices work fine. Now I just have to figure out how to voice activate scripts.
Is that not what is described in the page I referred you to?
Alexa cloud treats scripts as scenes. Therefore the simplest way is to say Alexa turn on âscript nameâ. Sometimes that works well enough depending on the script name and what it does. If it doesnât achieve what you want you can use the routines in the Alexa app to customize your phrase and response.
For example I have a script that turns off everything on my whole ground floor. To activate it natively via Alexa I would have to say âAlexa turn on everything downstairs offâ which is odd. Using the routine function I can change it to anything I want. I just need to remember the exact phrase. Currently âturn off everything downstairsâ just make sure the actual script name and phrase arenât too similar
There are some other work around abut thatâs the quickest
have a look at this I use dummy bulbs to trigger events
Hmm @nickrout, that looks quite complicated. I was hoping that NabuCasa would take the complexity out of it - just like it works with devices.
For example I have a script that turns off everything on my whole ground floor. To activate it natively via Alexa I would have to say âAlexa turn on everything downstairs offâ which is odd. Using the routine function I can change it to anything I want. I just need to remember the exact phrase. Currently âturn off everything downstairsâ just make sure the actual script name and phrase arenât too similar
This would actually be ideal. However, Scripts do not show up in my Alexa devices. Automations do, interestingly enough, but not Scripts. Any idea how I can get them to show?
Ah, just found them in âvarious settingsâ. However, there doesnât seem to be a way to create a routine with scenes. Am I missing something here?
Success! Itâs not by looking for routines under scenes but for scenes under routines that I found it. Silly me!
So to recap for whoever is looking to do the same thing: get Nabu Casa, create your scripts on HA, go to routines on the Alexa app on your phone and just add a routine and the associated key phrase.
Simple as 1-2-3.
Glad you got it working.
If you plan on adding a number of routines , you may be better off creating a dummy bulb, exposing the bulb to alexa. This will save adding a large number of devices ( HA scripts, input boolean, etc ) to alexa .
You can then create a single automation in HA that can trigger the scripts or anything else in HA using the brightness level of the dummy bulb. This will ensure you only have the devices you need in alexa and you can add and delete scripts on the fly without having to rediscover all the time .
I went from 86 devices in alexa to 35 , as I was using scripts and input boolean to trigger HA from alexa
Good idea, thanks!
@lonebaggie: What is actually the best way to create a dummy switch in connection with Alexa? Anything in particular to observe?
THis will create a bulb in HA which does nothing . Alexa should be able to discover the bulb and you can then add the bulb to your routines in the alexa app. You change the brightness to a different level in each alexa routine . Then create a HA automation that triggers when the dummy bulb is turned on . Then test for the brightness level and trigger whatever you need. One bulb in alexa 99 triggers for HA. Remember to turn the bulb off once you trigger the action in your automation
This how I trigger the Speech parser. All my examples are in Python via Appdaemon. I donât use HA automations scripts, but I will help where I can .
Thank you so much for this!
Another helpful tip for those out there: Under âAlexa Willâ select 'Smart Homeâs and then âScenesâ and you should see your script.