Send Commands to Alexa

Cant this be done with tts? I use tts with speech from amazon polly to f.ex tell me when someone trigger the motion detector outside the front entrance

This is not anything like TTS. You’re not getting Alexa to talk to you… it’s the exact opposite: You’re able to “speak” to alexa (look at my example). You are not giving Alexa things to say, you’re actually sending commands.

For example, If you want to make Alexa start playing music from home assistant (my use case), this is the only way to do it.

no thats not true.

you can start music on 2 other ways.

  1. with the (custom) alexa mediaplayer component
  2. with a sh script thats also on the forum (thats what i use)

with that script you also can

  1. start routines created in alexa
  2. ask for the weather
  3. ask for traffic
  4. ask for daily updates
  5. let her speak (TTS)
  6. create groups
  7. delete groups
  8. find out which alexa was used last
  9. change volume
    or anything else that can be done from the alexa app.

You can’t select the media you want to play with Media Player - it will display what is playing and allow you to skip fwd/back, pause, etc. But you can’t pick a song and start to play it.

Please point me to this, as i would be interested as well…

I think you misunderstand. I have a trigger in HA that fire when my wife turn in to our driveway. Now my BLT speaker tells me that Y is on the driveway, but if I had Alexa and the voice said Alexa turn on the front porch light instead I am sure that Alexa would do that. Or what is it I dont understand?

you can use services to play music.
so you can create scripts or an input select with an automation.

the script you can find in this topic

as well as lots of info how to use it and set it up.

@Yuran why do you want to tell alexa to turn on the front porch light? just turn it on in the script or automation.

I guess it might be a little confusing… there is no audio involved at all. You send a text string to the Alexa service. Alexa processes that string of text as though you spoke it. It’s a way to send commands to Alexa by text rather than speech.

That was just an example. If I had Alexa I could tell it to do whatever you want using TTS. That was what I meant. I dont use it, I just use TTS to tell me when f.ex dishwaher is ready wife comes home garage door is open 22.03 etc. And all local. no need to leave your credentials to third person

OK point taken. But to me it seems a unnecessary long way to go

Alexa to play some music, how do you do it? You use a TTS and get a speaker to play it out loud so Alexa can hear it?

thanks for sharing!
the rest_command didn’t work for me, so i made it a shell_command which works great:

shell_command:
  ask_alexa: >-
      /usr/bin/curl -X PUT -G 'https://virtual-device.bespoken.io/process' --data-urlencode 'message={{message}}' --data-urlencode user_id=<your-validation-token> --data-urlencode language_code=de-DE -H 'content-length: 0' -o /Users/ix/.homeassistant/scripts/alexa_response.json

i use it mainly to manage my bring shopping list via snips. since bring does not care to publish a public API, i can emulate an API using their alexa skill. actually by using this it’s possible to use almost any alexa skill out there with snips (if you don’t mind the lag).

Thanks for this - I took a look and set it up - I run in docker, so I need to use the *_plain.sh variant of the script, but it works. It’s certainly way more involved. It will be interesting to see how it holds up long-term as it seems pretty fragile (needing to export cookies, store them in the /tmp dir, etc.). Could be lots of care-and-feeding to keep it operational.

However, as you mentioned, it does cut out the middleman, so there’s that. And it has TTS capability, which I don’t think you can do with Bespoken

To get the tts I use the tts component and POLLY platform.
I used this tutorial

All texts I need is created ones on the Polly cloud änd then reused

its nice to use TTS in that way. i used something simular.
but it has 1 disadvantage, its on 1 place only.

i already got 7(and it will grow up to 16) times alexa around the house. so with alexa TTS i get to use TTS on 7 different locations.

@ha_steve yeah it is a hack, so its always the question how long it holds. but i got it working without a problem for a long time now.

you can do the TTS with bespoken too. its actually nothing more then the simon says functionality.
even if you cant do it directly you could do it by creating a routine and start the routine with bespoken.

but this is way more direct. and indeed without a middleman (and i have a hard time trusting someone, when i cant find name, place, location, etc. etc. and they use an io website)

Its one sentence yeas but I have 3 BLT speakers paired so I hear the same speech in 3 different places in the house. And as I said I have no interest in Alexa or GA, I need the exercise as retired.Just had a look at the script and because each speaker has an entity ID it would probably be possible to control where the speech is sent out. But it is the wrong day to day to investigate

Hey, i am all new at this home assistant , so my question , with the above would i be able to create a switch button on hadassboard to be enable to control a switch wich works with alexa , but not yet with hassio?
I have these livolo switches wich are connected with their on zigbee gateway and their own app , but i would like to build a dashboard with all my stuff in it , so i don’t need to switch between apps. Now livolo isn’t supported by hassio yet but it is by Alexa… So maybe this could be my solution?

yeah it is possible to create a routine in the alexa app for a switch, and then you can create a switch that triggers the routine. and that switch can be put on the dashboard.

its possible, but not easy.

I have an echo plus and since getting this I am no longer able to use HA to turn my lights on and off as they are ZigBee connected to the echo. Would this allow me to configure it somehow to enable it so use my lights again? I’m not looking for status of the lights just a way to turn them on or off through HA

why cant you connect your zigbee to HA directly?

but like i said everything you can control with alexa you also can control with HA by creating routines and starting these routines from HA.

i would advise the local script to do this though.

Thats what i tought… I am new at this so i think it will still take me a while…and some numbers off trying… I cant connect the zigbee switches directly with hassio because zigbee isn’t compatibel for now… And i also would like to kerp using their app so i have to use their gateway… Now i have been trying to set up this bespoken.io connection with Alexa , and in the bespoken app i can switch the light on , but in hassio i didnt manage yet… I tried with the example of setting a timer but didnt work… I guess you mean another way off connecting with Alexa in stead of bespoken.io?