Alexa Announce Feature - Text to Speach via Alexa now a possability?

For the record: the HA docker container does not come with jq, so you need to use the alexa_remote_control_plain.sh instead (or build your own custom docker image).

Otherwise you’ll see the same (misleading) error message as Bobby_Noble above.

Sebastian

@sebk-666 where can I download this alexa_remote_control_plain.sh?
Now I am getting:
pi@hassbian:/home/homeassistant/.homeassistant/thinker $ sudo sh alexa_remote_control.sh -a
cookie does not exist. logging in …
device list does not exist. downloading …
the following devices exist in your account:
alexa_remote_control.sh: 467: alexa_remote_control.sh: jq: not found

The _plain.sh script is also available at loetzimmer.de:

https://loetzimmer.de/patches/alexa_remote_control_plain.sh

Here’s the original documentation (in German):

The “plain” script has some restrictions, though: apparently it doesn’t support the “-i, -p, -P and -S” switches, using the ALL device name or radio station names.

Sebastian

PS: but since you seem to run on hassbian - can’t you just do an apt-get install jq?
I’m just guessing - I have never used hassbian…

2 Likes

Have installed your script but am getting stuck before it even tries to run. I sure I’ve probably just missed something simple but would appreciate an opinion.

This is my config…

notify:
  - platform: command_line
    name: 'Kitchen Dot'
    command: "/config/alexa_wrapper -d 'Kitchen'"

This is the script…

alexa_speak:
  alias: Alexa speak
  sequence:
  - service: notify.kitchen_dot
    data:
      message: "Hello everybody"

When executing it I get this error…

WARNING (MainThread) [homeassistant.core] Unable to find service notify/kitchen_dot

The original wrapper script is called alexa_wrapper.sh - you left out the .sh extension.
If you named the file without the .sh extension, that’s fine too.

Anyway, a wrong file name should not cause the service to be ignored, it would still be callable and then fail.
Did you run a config test (python -m homeassistant --config /config --script check_config)?

Sebastian

2 Likes

@badgerhome What tmp files did you delete. I get the script working but it just wont speak. I have used uk setting but am located in sweden with amazon account using an us address. Maybe thats why?

that’s not my script, i just posted a link to it.

Lol, did wonder why the .sh was missing in walthowd’s docs but didn’t try adding it as I don’t understand these things and assumed it was deliberate, works perfectly now :grin:

Anyone else having problems, the docs should read…

notify:
  - platform: command_line
    name: 'My Dot Name'
    command: "/home/homeassistant/.homeassistant/alexa_wrapper.sh -d 'My Dot Name'"

notify:
  - platform: command_line
    name: 'All Alexas'
    command: "/home/homeassistant/.homeassistant/alexa_wrapper.sh -d 'ALL'"

…and for hassio users the command would be…

    command: "/config/alexa_wrapper.sh -d 'ALL'"

Apart from that the install is identical.

Apologies, will amend the one I just posted.

Thanks @sebk-666, _plan.sh is running now.
Same situation as @planet4, using the uk settings for us account, echo-dot won’t speak.

pi@hassbian:/home/homeassistant/.homeassistant/thinker $ sudo sh alexa_remote_control_plain.sh -d ‘Kitchen_Echo’ -e weather
cookie does not exist. logging in …
device list does not exist. downloading …
sending cmd:weather to dev:Kitchen_Echo type:[commented out] serial:[commented out] customerid:[commented out]
Sequence command: Alexa.Weather.Play

1 Like

Loetzimmer’s notes say you can use multiroom groups as a device. I’ve tried making a group with two Dots in it but they don’t work and aren’t seen when you enter “/config/alexa_remote_control.sh -a”

Anyone had any success?

I’m getting this error but login and pass are ok and it’s not asking for captcha on login screen. :confused:

 Try logging in to https://alexa.amazon.com with your browser. In your browser
 make sure to have all Amazon related cookies deleted and Javascript disabled!

 (For more information have a look at /tmp/.alexa.login)
core-ssh:/config# ./alexa_remote_control.sh -d "Bedroom Echo Dot" -e speak:This_is_a_test!
cookie does not exist. logging in ...
ERROR: Amazon Login was unsuccessful. Possibly you get a captcha login screen.
 Try logging in to https://alexa.amazon.com with your browser. In your browser
 make sure to have all Amazon related cookies deleted and Javascript disabled!

SOLVED!

This works for me:

I logged in to alexa.amazon.com with Chome and used the cookies.txt extension to export my amazon cookies to /tmp/.alexa.cookie

I simply used this as my wrapper script (replace LR Dot with your device name)

/config/alexa_remote_control.sh -d ‘LR Dot’ -e speak:$(cat)

Seems to work OK.

Guys:

Its working using SHH

./alexa_remote_control.sh -d "Bedroom Echo Dot" -e speak:Test!

It’s not working using service call:

{ "message": "Test"}

Any idea?

see my above post. create another script say alexa_notify.sh

/config/alexa_remote_control.sh -d ‘LR Dot’ -e speak:$(cat)

save it . chmod +x alexa_notify.sh

create notify in yaml

- name: Alexa-LR
    platform: command_line
    command: "/config/alexa_notify.sh"
2 Likes

Using ha-alexa-tts, I’m adding things to my automations like this…

  - service: notify.kitchen_dot
    data:
      message: "Hello Ben, welcome home"
  - service: notify.lounge_dot
    data:
      message: "Ben's home"

Can you give me an example of how you’d do it your way?

Lol, think we overlapped. That seems much simpler… I think.

just crude no error checking, but simple :slight_smile:

Need to create a separate wrapper script for each dot , not very smart with bash scripts

Surprised this hasn’t picked up more traction, people have been begging for Alexa TTS for ages and it’s so simple…or it is using code others have probably pulled hair over :slight_smile:

Not lucky here :frowning:

2018-06-21 19:28:08 ERROR (SyncWorker_11) [homeassistant.components.notify.command_line] Command failed: /config/alexa_notify.sh