So happy, been waiting so long for this. Thank you.
Curious if templating works with TTS? Tried a few different ways including:
alexa_tts_test3:
alias: Alexa tts test 3
sequence:
- service: media_player.alexa_tts
data_template:
message: '
{%- if is_state("device_tracker.em_iphone", "home") and
is_state("device_tracker.22", "home") -%}
You are both home, you silly
{%- else -%}
Em is at {{ states("device_tracker.em_iphone") }}
and L is at {{ states("device_tracker.22") }}
{% endif %} '
Alexa doesn’t respond to anything inside if statements, she does however responds to states.
Thanks again
@emnaudin you need to include the entity_id of the meida_player that you want to speak.
alexa_tts_test3:
alias: Alexa tts test 3
sequence:
- service: media_player.alexa_tts
data_template:
entity_id: media_player.my_echo_dot
message: '
{%- if is_state("device_tracker.em_iphone", "home") and
is_state("device_tracker.22", "home") -%}
You are both home, you silly
{%- else -%}
Em is at {{ states("device_tracker.em_iphone") }}
and L is at {{ states("device_tracker.22") }}
{% endif %} '
For those still getting errors logging in @juan11perez, @J.eremy and others. I’m going to release another version that includes selection for bluetooth devices and will also include some more logging so that we can hopefully get to the root cause of your issue.
Trying to install this but receiving the following error on Raspberry Pi 3b with HassIO
[hassio.docker.interface] Can't install keatontaylor/armhf-addon-alexa-api:0.4 -> 404 Client Error: Not Found ("no such image: keatontaylor/armhf-addon-alexa-api:0.4: No such image: keatontaylor/armhf-addon-alexa-api:0.4").
For those having issues such as “no such image” can you please let me know what HASSIO version you’re running? I just installed a fresh version of my Raspberry Pi 3 and it seems to install just fine without issue. Also, just in case after I attempted and it worked I re-uploaded the docker image, so maybe give it another go.
I’d also suggest removing the add-on completely, along with removing my add-on repository from the add-ons page and re-adding it from scratch. Just in case that helps.
You know what, it just occurred to me that I am duplicating the requests for bluetooth connection status for each detected echo device, when it can be fetched in a single request. Which would explain why it might be taking longer than the default update interval. Will get this pushed out as a fix in version 0.6 along with implementing play_media.
@keatontaylor I now suspect there were some legacy calls to the speech script in my code from earlier testing that were triggering the script (quite possibly with an empty message). Sorry for the worry.
I started a couple of months ago trying to copy and paste @CCOSTAN’s speech_engine script into my codebase. I never could get it working reliably so I am going to start with a new script, with a new name and slowly add things to it after I get the previous stuff working first.
On a side-note, I discovered that my alexa_api docker container’s IP address changes every time I reload it. I am going to have to figure out a stable way to reference that container from Home Assistant. Earlier today I was going to test the TTS again, but I was unable because it wasn’t loaded. Of course right before I fall asleep I realize the problem. At least I was able to test my theory and tentatively confirm it was my code, not yours. Hooray for progress!!!
P.S. Tonights test was with 0.5. TTS is working great so far.
I started getting the same errors after multiple reboots of the host OS. ( for something unrelated )
I figured I was hammering the alexa web page too much and got a temp block or mandatory captcha, etc…, I shutdown the container overnight, upgraded and restarted this morning and now it is working fine.
Just curious if you were restarting the script/docker a few times prior to receiving the errors.
@keatontaylor . Thank You very much for your hard work version 0.5 works perfectly on my Pi 3 with UK Amazon. Bluetooth option is perfect
Is it possible you can display the radio stations currently being played as I would like to automate the turning on of my Sony Bluetooth and pairing whenever media is playing on my dot? Currently whenever a radio station is being streamed, media player simply says Standby
This is great! I’m curious once the play_media is implemented if it would be possible to play local files. Would the Echos even allow that? I know you can use the Echo as a bluetooth speaker itself. From what I gather, this component/addon is so far only using music streaming services to play music, is that right?