I don’t believe you can suppress or change her default response that is defined in the functions.py when invoking the skill. You can edit the OKAY=“OKAY” to always say something different.
So, the sequence becomes…
Alexa Routine: When I say “Alexa, it’s hot in here”
Alexa Action: turn on a scene which is your script in HA.
Your script then invokes an actionable notification…
Alexa Ask: I understand you think it’s too hot in here. I’m fine with this temperature but would you like me to turn on the A/C for you?
Your Response: Yes
Alexa Response: Okay
This then triggers next actionable notification if ResponseYes:
Alexa Ask: What temperature would you like?
ResponseNumeric: 72
Alexa Says: Okay, I’ve set the temperature to 72 degrees.
As for Node Red, I’ve only used HA up until now but have recently started exploring AAN (Alexa Actionable Notifications) in NR. As I understand, it the interaction of the actionable skill in Amazon still occurs through HA. NR is simply tied into the HA event bus and can be actioned on by NR rather than HA automations…I think!
I am really on track and learning the many options and uses. You have one that if you could share a few extra details, it would be helpful. I am “assuming” you are using an “Alexa Routine” to trigger HA. How are you linking it to HA? (I am new to this and have only previously used a routine(s) as a timer to turn outside Christmas Lights On/Off.) So many options… Building a new routine, with intent to trigger HA… like “Alexa, I bought coffee filters” …
Steps to create:
In the Amazon app, name the routine.
When this happens (?) [Choices: Voice, Schedule, Smart Home, Location, Alarms, Echo Button, Sound Detection, Guard). Scrolling the options, it appears to add additional conditions and not Actions…
How to you send a detectable *trigger to an HA Automation? Pondering this, the only thing that comes to mind is have it toggle a switch without a device and in HA detect the Switch State changing…
I am pretty sure there is a simple thing I am missing to trigger a sequence from Alexa to HA… Can you help?
I may be misunderstanding your comment, but you do not need a physical switch without a device. You can activate an Input boolean or button helper .
But I believe Daniel is calling his HA scripts directly in the Alexa routine. Your HA script can be found under Smart Home > Control scene action in the Alexa routine editor.
1st, you need Actionable Notifications via Media Player custom skill set up & working. You know it’s working when you say Alexa, open custom actions and she responds with the default text from the primary input boolean you created in HA when setting up the skill:
Same here!!! Did you fix it? I have tried the whole process several times but always the freaking positive actions grrrrrr
NEVERMIND!!! I changed the language to english UK and now it works… (I´m from Spain and the setup was for both English and Spanish but it seems that alexa didn´t like it so…)
Yes, she is very picky about the language settings!
I’ve spent several hours (feels like dozens) troubleshooting my issue and the replacement echo still was problematic. I originally started out with them registered to amazon.com (which would be en-us) so I could use Alexa Guard (and something else that I can’t remember) but ended up moving them all to amazon.ca so I could utilize Telus Home Assistant which is only available in Canada. After I moved them all back to amazon.com, and rebooting everything, they all started working with this custom skill. I have not tried yet to bring them back to .ca to see what happens…
Does anyone have an idea about how to add an error-trap routine to detect attempting to send a number larger that the max set in the input_number configuration? Currently, it completes the automation without making any changes.
My input_number and (Dynamic Timer):
alias: alexa_basement_lights_initial
trigger:
- platform: numeric_state
entity_id: input_number.timer_basement
above: '0'
below: '3'
condition: []
action:
- service: script.activate_alexa_actionable_notification
data:
text: The basement lights are preparing to turn off. Since you are still down here, I can reset the timer. How many minutes longer?
event_id: basement_lights
alexa_device: media_player.basement
mode: single
Option 1:
Condition: NumericResponse is less than or equal to stateattr("input_number.timer.basement", "Max") or stateattr("input_number.timer.basement", "Min") <= NumericResponse <= stateattr("input_number.timer.basement", "Max")
Sequence:
(your existing actions go here)
Default:
(applies to outside acceptable range)
Sequence: Fire a new actionable notification: “{{ NumericResponse }} is outside the permitted range of {{ stateattr(“input_number.timer_basement”, “Min”) }} to {{ stateattr(“input_number.timer_basement”, “Max”) }}. Please specify a number in the allowable range”
Choose: is a great If…Then…Else… addition to HA!
The above is just pseudo code but I think you can figure it out!
Happy to assist and troubleshoot…
@dbrunt,
Again, thanks for your response. I think I am missing something… I set up the script, much like your example…
The Amazon routine is looking for the scene like your example.
My question… Do you have an example scene? Can you attach YAML code?
I looked for examples and cant find any that are not controlling entities in a script like function.
I also tried the UI
and I am really lost missing how to link a script to a scene so that the routine can identify what to do.
And even tried placing the script in the scene.yaml and get the error:
If the extra condition is added to trap duration no matter what, even if the value given is one minute it is passed to default. Being so strange and illogical, added the working trap and anyone asking for more than one hour in duration is in the dark
Thought for the day, sometimes you have to take your victories if you one ½ the battle.
Now back to learning the syntax of sequence.
You can’t link a script to a scene. Scenes are only for defining a state you want for devices and entities when you activate the scene. But a script or automation can activate a scene.
The Event Listener is your best friend here to see what Alexa is returning.
To re-trigger the last actionable notification just ask Alexa, open custom actions.
I just tried on mine and if I answer with 3 hours I get 10800, which is seconds
whereas 4 and a half minutes returned 270, which is minutes. 1 minute looks like this:
Not mine. Just in case I am off the path, as I have never been here before… Here are the steps I am using to attempt linking to a HA Script (In the Amazon Alexa App):
Open App.
At the bottom, select more icon.
In the list, select routines
At the top, (+)
Enter Routine Name (+), Coffee Filters, At the top, Next.
When This Happens (+), In the list, select Voice, “I brought coffee filters”, At the top, Next.
Add Action (+), In the list select “Smart Home”. Options are:
All Devices; Lights; Control Group.
All Devices: About 100 devices linked directly into Echo, all are Switches and Lights.
Lights: (This brings up a link that opens a list of Lights, Noting some are duplicated.
Control Group: This list is previous routines controlling lights created directly in this convention before I started learning HA.
Am I doing this right? I do not see any of the scripts in HA.
Yes, those are the correct steps. When I do those, I see All Devices, Lights, Control group, Control scene. How did you add the Alexa integration to HA? Are you using Nabu Casa or did you follow the manual setup steps?
As I mentioned earlier, I followed all the steps explicitly adding the custom skill (It took two weeks of starting over because I had a typo in one step , and the HACS Alexa Media Player, which enabled the integration Alexa Media Player.
Meanwhile, I thought about what you said. And beyond by better judgement I deleted the integration and added it back in. Painful! with the same results and a side affect. My devices got renamed slightly. At first I thought I broke it good; fortunately I just have to edit YAML.
Still seeking this awesome method you enlightened me to. I am planning to pursue an alternate method using an input helper as mentioned by @Didgeridrew until I can learn more. Another clue I have is the log book. I have posted this awhile back, but no one responded.
Trying to make sense of the log(s) is challenging when you take on new ground by trial and error with the help of savior’s like yourself. I wish there was a book out there, the internet is riddled with documentation, but some of it is super vague. My experience tells me the information source most likely has some additional configuration or YAML that is not included.
Anyhow… If you think of anything, let me know.
I originally started with manual setup then tried HA Cloud for a while, and liked the ease by which you can add/remove what’s presented to Alexa discovery without having to edit yaml and restart HA but I am now back to the manual setup. I am using Duck DNS and Nginx Proxy Manager add-ons with 443 forwarded to HA but now have my own domain name with dynamic DNS updating so I no longer need Duck DNS. I currently do not have the error you refer to so OAuth is working for me.
If you delete all HA discovered entities from Alexa and rediscover, does she still discover everything except scenes/scripts? If the websocket is not connecting she should discover nothing, If it is then everything in your smart_home: section should be discovered. What is in your smart_home: yaml for Alexa??