Wow! Just thought I let you know that I could set up the custom component without any problems (using HACS). TTS with the new notification component works too. Great work. Thanks a lot!
The fastest way for me to test TTS through noticiations was the Services tab in the HA developer tools.
I chose notify.alexa_media_echo_dot_kuche as service (which is the Alexa service for my Echo Dot) and used this service data:
Hi guys. Hoping for some help as I haven’t gotten this component working.
Component has been installed (captcha code entered).
My two echo dots appear fine but I cant get a notification to work.
I’m on version 0.102.0.dev20191028 installed via docker.
Have I put the service data in correctly? (I call the service but there is no response).
Does anyone know if some Alexa devices will accept sending an Announce and others only TTS? I have one device that will allow the data to be sent as a type Announce and others nothing happens and nothing in the logs. However if I switch to type of TTS it talks. Other devices either works.
If I wanted to have all my Echo’s announce something how would one do that? I have a simple automation to state when the dryer is done with a sensor on the the dryer. I have experimented with this a few times but cannot get it work.
Hi all,
I have this implementation of TTS working but I have a usage scenario that I can’t work out. Is there a way for the message text to refer to another source instead of hard coding the message text as per the above examples? I’d like to use the feature dynamically e.g. have alexa read the current status of a device or sensor. Specifically, I have a component that tells me the current service status of a train line. I’d like to be able to get the alexa to speak this. Possible?
OK, I’ll answer my own question and also the question above from gdreelin.
This is all assuming you are using the alexa media player integration here:
To make a TTS message pull some of the message from another entity e.g. a sensor, just use a data template for the action instead of a normal data command. Below is an example of a TTS announcement that pulls info from two sensors I have that monitor train service status and uses them as part of the TTS message (the hyphens in the message are just to add a slight pause, making it sound more natural).
- id: '123456767'
alias: Train service status announcements (working days only)
description: ''
trigger:
- at: '07:15:00'
platform: time
condition:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
action:
- data_template:
data:
type: tts
message: central line status is - {{ states('sensor.central') }} . Tea-Eff-Ell rail status is - {{ states('sensor.tfl_rail)') }}
service: notify.alexa_media_andy_s_echo_dot
Also, to answer gdreelin’s query above, you can use the TTS function of this integration and send the message to multiple Alexa devices at once. I don’t think using the ‘notify.alexa_media’ service works in your example coding above, at least not on my system. You have to use the notify service for a specific device. So, how to message more than one? I haven’t tried gdreelin’s approach above but there are two methods that I know work. The first and most laborious method is to add multiple duplicate actions to the automation, with the same message but just entering a different notify.alexa_media_xxxx for each one. But, there is a better way: create a notify group.
Placing something like the below in your config.yaml file, listing all the devices for the notify group, and it creates a notify service that can be used as the single service target for your TTS message:
notify: # makes a notify group to allow TTS messaging of multiple Alexas at once
- name: alexa_media_andy_and_alison
platform: group
services:
- service: alexa_media_andy_s_echo_dot
- service: alexa_media_alison_s_echo_spot
The above creates a service called “notify.alexa_media_andy_and_alison” which you can call with a single TTS message and it goes to both devices. Create other groups and then you can reference any of them in your automations.
I am following https://github.com/custom-components/alexa_media_player to setup echo dot. setup seems fine. This may seems dumb but I didn’t find documents on how to use it Anyone can share documentation how to use it? For example, I want to setup a card in UI that I can type in some text and my echo dot will say it. Or how to send song to echo dot?
You need to create a notify group of media devices and then send the TTS to the group name rather than listing individual devices. I also use the Alexa Media Player integration to carry out TTS tasks. For example, in your configuration.yaml, place something like this:
Thanks, that the only way I managed to make it work (outside of node red).
sorry if my question is stupid (I’m new to Home Assistant"
but how can you call this script in an automation with a custom “message” ?
if you had a example that would be brilliant otherwise no worries I’m sure I’ll figure out.
Thanks again
You don’t have to actually do it this way, its more, create a script, if you want to call it from multiple automations.
You can just create this as a action in an automation. Use the GUI first, then fresh it out with extra media players ext when you get the hang of how it works.
If you do want to create a script, its call service as the action.