I am slowly migrating from Smartthings to Home Assistant. With community help I have now got Z2M installed and working and adding my Zigbee switches, relays and sockets. I now want to control them with Alexa. I have Alexa devices installed and I believe I need to add something like this
action: alexa_devices.send_text_command
data:
device_id: 037d79c1af96c67ba57ebcae560fb18e
text_command: turn study lights off
But I don’t know where to add this code. Do I create an automation or is it done within the Alexa Devices add in?
All the searches I have done return results on installing various Alexa add-on’s not specific voice command configurations. Please can someone point me in the right direction.
Can you clarify what it is you are asking?
The alexa_devices.send_text_command action emulates a voice command being spoken to an Alexa device. It does not define a trigger phrase you can speak to Alexa; that can be done through routines in the Alexa app, or through a custom skill with custom intents.
Be aware that you will need to expose HA to Alexa in order for any voice commands to control HA devices. This is not handled by the Alexa Devices or Alexa Media Player integrations. The custom skill linked above can do it, but the easiest option is to use HA Cloud. IIRC, newer Alexa devices that support Matter can also connect to HA that way, but you’ll need to do a search for that since I don’t think it’s explicitly documented. None of my Alexa devices are new enough for that, so I don’t have any direct experience.
Thanks @Didgeridrew … I think it is my lack of understanding of how Alexa Devices works. I assumed that as it is linked to my Amazon account an action taken in the Alexa app either manually or through voice commands was replicated in HA. Clearly this is not correct. I tried to watch a lot of YouTube videos and read documentation but to be honest the integration documents are a bit scarce on how it works.
I originally had Alexa Media player installed but removed that for Alexa devices as was told this was easier to use and would do what I wanted.
I am trying to achieve the following:-
-
Turning on and off lights, relays and devices via Alexa voice control e.g. “Alexa Immersion On” would switch a ZigBee relay for 30 mins. or “Alexa Kitchen TV On” would turn on the TV, or change the volume or channel by communicating with my Broadlink IR Blaster. This is currently how I use it in Smartthings with the Alexa skill enabled.
-
The other area is to send announcements to all of my Echo devices. Previously I could send an announcement “Warning Smoke detected in Kitchen” when one of my Heiman smoke detectors was triggered. or “Someone is at the Gate” when a BLE Tag is identified to open the electric gates.
I understand that you have to expose device entities in Alexa but assumed (wrongly) that’s what the integrations did. Its not that I object to a subscription to Nabu Casa but HA is supposedly all about local control and I’ve fallen at the first hurdle.
I don’t feel comfortable creating a custom Alexa skill and troubleshooting if it doesn’t work.
I believe the Philips Hue Emulator might be an option or even Node Red after watching some other videos.
Indeed you have. You assumed that installing HA will magically remove Alexa’s cloud requirement. It doesn’t.
The only thing which might work is to use the matterbridge addon which @Didgeridrew hinted above. If you’ve got a recent Alexa device which supports Matter, then it should* work locally.
*Bear in mind the above suggestion is based on what I vaguely remember reading in these forums. I suggest you do your own research before committing
I must have a fundamental misunderstanding: Alexa gives you full, local control, without cloud access? No? I’m absolutely shocked!
I will have to go and do some more in-depth research, reading the documentation.
Glad you are supporting the optional Nabu Casa to help the HomeAssistant ecosystem.
HomeAssistant is your puppeteer, pulling together all the other ecosystems to work together. Some ecosystems are bypassed altogether, while other ones are integrated.
You already have experience with cobbling together devices using Zigbee, etc at the network level. This is just another layer, higher up. Then you put voice control over the whole lot…