Ah, ok. As far as I know, you need an Alexa device with an integrated hub.
I have an Echo if that’s what you mean.
This is entirely dependent on the skill you are using. For example, I use Haaska and Alexa will not trigger routines off of Smarthome entities, even though the state of a sensor is visible in the Alexa app. If I remember correctly this is related to the Alexa Proactive Events.
So, currently the flow is:
“Alexa, turn on the amp” > Alexa runs Routine Z, which sends command to Blitzwolf > Blitzwolf sends IR signal > Amp turns on…?
You want:
Entity X turns on > HA tells Alexa to run Routine Z…
If that is the case, just process the logic in an HA automation and use Alexa Media Player to trigger Routine Z.
alias: Alexa - Routine Z
description: >-
Tell Alexa to run Routine Z when Entity X turns on
trigger:
- platform: state
entity_id: input_boolean.entity_x
from: 'off'
to: 'on'
condition: []
action:
- service: media_player.play_media
data:
media_content_id: Routine Z
media_content_type: routine
target:
entity_id: media_player.den_echo_dot
Type matters. If your Echo has no integrated Zigbee hub (e.g. Echo 4. Gen, Echo Studio), it night be the easiest to go the way Didgeridrew suggested above.
I do run Haaska. Frustrated that it doesn’t mention this at the very top of the post (unless I missed it).
I will try the media route, but that means HACS I guess. I’ll have a look.
Thanks
From what I understand it is possible to modify the Haaska lambda to enable proactive events (The Haaska Super Thread - #279 by wmaker and https://gist.github.com/matt2005/744b5ef548cc13d88d0569eea65f5e5b).
I can’t really offer any guidance on setting it up because I never bothered doing it… I started out using AMP before I setup Haaska, so it was already my normal workflow (and I would rather get kicked in the shin than spend extra time using the Alexa app).
Thanks for giving this some thought. I had a look and my Alexa Developer console and it is already configured to “Send Alexa Events”. I think that just keeps Alexa updated with current states, but doesn’t do anything to enable HA triggering Alexa Routines.
I’m just about to install HACS and then the media player! Scary stuff.
Drew - Thanks for your input.
I’ve now installed an SSH terminal, HACS and Alexa Media Player and now have a platform: ping entity that detects when my television is on or off and an automation that turns my Amp on or off in step.
As it happens, my Amp can be turned off directly over the LAN as it appears as a media player within HA with a number of controls including the off switch. But, to turn it on, I have to use the Alexa routine to send the On command to the Blitzwolf IR transmitter.
One day everything will come with MQTT capability and that will make life so much simpler.
I’ve been trying to get Alexa routines to trigger in Home Assistant.
With a bit of help I came up with a motion sensor template that that Alexa can see.
Alexa can see the sensor and can also see if movement is detected or not but when I try to use it in a routine I get “this device is not currently supported”.
Any ideas?
Many thanks
Hey all - putting this out there in case anyone is still looking for how to do Alexa routines from HA.
Use the Media Player component which now also lets you trigger routines. No need to make Alexa scan and check for devices.
Thank you, just what I have been looking to do.
Hi all!
I am trying to get a sensor in to Alexa to trigger a routine, have defined as follows:
binary_sensor:
- platform: template
sensors:
amazon_smart_plug_1:
friendly_name: "Hall Lamp - HA Binary Sensor"
device_class: 'door'
value_template: '{{ is_state("input_boolean.amazon_smart_plug_1", "on") }}'
It appears in Alexa fine, and when I toggle my input boolean it changes state in Alexa, but there is no option to add to a routine and it does not show in the available Smart Home devices as a trigger.
Within Alexa it shows as a ‘Contact Sensor’ which I believe is correct?
Any advice really appreciated! Have tried adding / removing / restarting / changing device_class so many times, but nothing seems to work
Thanks!
in the release notes of release 2022.07 it says that triggering Alexa Routines is now possible via input_booleans, input_buttons etc
input boolean work fine for me but I can’t get buttons to work. I get an Error in the Alexa App that says that this device is not supported.
I am trying to get this to work, but am a little bit confused. I get the basic idea of exposing a binary value to alexa that can trigger a routine, I have created a template device as follows.
binary_sensor:
- platform: template
sensors:
master_curtain_sensor:
friendly_name: "MasterCurtain"
value_template:
device_class: 'door'
The problem I am confused by is what I need to put into value_template
, I don’t have a an actual device in HA to track the actual state of the scene. such as a light within the scene. The curtains can’t be connect to the HA., which is why I am trying to use Alexa routine.
What should I put into value_template
here?
Is an input_boolean what I want?
This seems to work.
binary_sensor:
- platform: template
sensors:
sun_up:
friendly_name: "Sun is up"
value_template: "{{ is_state('input_boolean.curtain_master', 'on') }}"
@Jeffrey_Ellin
Are you able to see the device in the Alexa app, and also trigger a routine based on the device’s state?
Are you using Nabu Casa?
For me (not using nabu casa), I can add the input_boolean and binary_sensor to the alexa app, but I don’t see any device listed as a trigger when I tried to go “When this happens” → “Smart Home”.
So I have worked around based on voice command sent by the Alexa Media Player. I described my workaround in my post here.
thanks
I’ve read though most of the posts in this thread trying to figure out where I’m going wrong. I’m using the Alexa Skill rather than Nabu Casa and have had the skill successfully linked for a while now. I have only recently needed to create a routine where I want it to toggle a binary sensor.
I have added the required entries into configuration.yaml - there are no errors in the logs relating to this so I assume everything is setup correctly. I’ve also restarted HA and relinked the skill.
I have created a door sensor from a template and it shows up in the Alexa device list after a rescan. The only issue I have is that when create the route and I try to select the binary sensor under devices, it is displayed right at the bottom of the list under the unsupported section.
Essentially you need three things to make this work:
-
You need a helper in Home Assistant: a Toggle helper
-
You need a way for things in Home Assistant to be visible to Alexa: the simplest solution is a Nabu Casa subscription and the Home Assistant Alexa Skill. You will then need to expose the toggle helper to Alexa.
-
A Routine in your Alexa app: This will respond to the change in state of the helper toggle and do whatever you set the routine to do.
I should have mentioned that I’ve tried this with a toggle helper as well. The strange thing there is that running the routing from the Alexa app on my phone via voice control works perfectly. If I ask any of my echo’s the same thing, I just get a ‘dum dum’ like response and it doesn’t work.
This did prompt me to do some more testing today though and I’ve found that for whatever reason, the voice command I was using just wouldn’t work. I tried changing it to something else that is similarly worded and it works without any issue!
I can use some help… I want to have an Automation whereby a TIME Trigger and a CALENDAR Condition runs a Alexa Routine. How do I do that ? I am not very familiar with Yaml and by far prefer the Visual Editor. Thanks !!!