I have a Google Nest Audio speaker that I used to be able to send text messages to and they used to be spoken out loud. This no longer works.
If I try it as a script. I get the error message:
Failed to call service script/test_tts.connection lost
Here is the script:
alias: Test TTS
sequence:
- service: tts.speak
data:
cache: true
media_player_entity_id: media_player.lounge_room_speaker
message: May the force be with you
mode: single
From the log file:
Test TTS: Error executing script. Invalid data for call_service at pos 1: must contain at least one of entity_id, device_id, area_id.
Does anyone have any good ideas why this could be? What am I doing wrong?
service: tts.speak
target: tts.example
media_player_entity_id: lounge_room_speaker
data:
message: "may the force be with you"
The pop-up error message:
Failed to call service tts.speak. expected a dictionary for disctionary value @data[âsequenceâ][0][âtargetâ]. Got âtts.exampleâ extra keys not allowed @ data[âsequenceâ][0][âmedia_player_entity_idâ]. Got lounge_room_speakerâ
From the log file:
[547616368976] Error handling message: must contain at least one of entity_id, device_id, area_id.. Got {'type': 'execute_script', 'sequence': [{'service': 'tts.speak', 'data': {'media_player_entity_id': 'media_player.lounge_room_speaker', 'message': 'May the force be with you'}}], 'id': 148} (invalid_format) Leif from 192.168.1.131 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67)
And also from the log file (I am not certain this is related):
websocket_api script: Error executing script. Invalid data for call_service at pos 1: must contain at least one of entity_id, device_id, area_id.
websocket_api script: Error executing script. Invalid data for call_service at pos 1: not a valid value for dictionary value @ data['media_player_entity_id']
Please help, I am stuck and have nowhere else to turn.
target: tts.example is just an example, itâs not real.
I have no idea where to get the target tts, itâs not very clear in the docs.
What tts, NabuCasa (tts.cloud_say), Google (tts.google_translate_say) services are available to you?
An example could be used:
service: tts.cloud_say
data:
entity_id: media_player.lounge_room_speaker
message: may the force be with you
service: tts.cloud.say
data:
entity_id: media_player.living_room_speaker
message: may the force be with you
No go. No error message and nothing in log file.
When you say âwhat TTS services are available?â - how do find out what is available?
Update: as it turn out, I do appear to have tts.cloud. But I cannot make it play on any of my speakers. When I try and play by clicking Call Service, sometimes I hear a chime but nothing else.
Note sure where to look fo where the disconnect is.
In the developer tools, open the services and look for the ones available to you.
Since I have the NabuCasa tts service, I tried sending a message to different players (GoogleHome, squeezelite-esp32, squeezelite(LMS server) and everything works without a problem.
Here is an example where I played a message on GoogleHome
Than go to settings-devices-and hit + button-search for Google tts-install this.
Now go to your config.yaml and delete your TTS config in here.
Because you gonna use the new (ui devices tts) you just installed)
Your automation is changed. So now it uses: call services - tts.speak. (Select you media.player) type the tekst you wanna hear.
And it works for me now. My old setting also did not work after home assistant update to 2023.7
After this you should be able to use the Google tts service.
The tts cloud service is provided by nabu casa. If you donât have that service then start with Google.
Restarted Home Assistant.
The services available now are:
Text-to-speech (TTS): Clear TTS cache
Text-to-speech (TTS): Say a message with cloud
Text-to-speech (TTS): speak
Still no go for me.
I found this in the log file, not sure if it is relevant?
Logger: homeassistant.components.cast.media_player
Failed to cast media http://homeassistant.local:8123/api/tts_proxy/e46c151a848637835da24765e5e6c8a2881c9f37_en-au_e09b5a0968_cloud.audiooutput.mp3 from internal_url (http://homeassistant.local:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address
Logger: homeassistant.helpers.service
Unable to find referenced entities media_player.living_room_speaker or it is/they are currently not available
I cannot for the life of me understand how I can make this work.
I would so grateful for any help.
Thanks in advance.
Yes! I get that too, no target available.
In a way, I am somewhat glad it is not just me that have the problem. More users with the same problem = more users likely to find a solution.
Modern platforms will create entities under the tts domain, where each entity represents one text-to-speech service provider. These entities may be used as targets for the tts.speak service.
I am assuming that this tts.speak is a new addition as I have used TTS for a long time and never noticed this service before, but from the above documentation I also assume that moving forward any platform / integration is able to utilise this service and will as such create tts.entityâs that can then be selected as the target.
Therefore not having any target to select, simply means you donât have any platforms that have created such entities as yet.
All original setup TTSâs should still function normally under their own service call for example âtts.cloud_sayâ
At least that is my understanding and have no idea if any current platforms are using this new tts.speak function as yet.