I have had the SONOS TTS installed and working via HASS.IO it was working fine until a month or so ago. To resolve I have tried to reinstall but now it doesn’t run, I get the following in the logs:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
ifelse: fatal: unable to exec ./run.sh: Exec format error
[cmd] ./run.sh exited 126
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
@kevinvincent thanks a lot for your add on!
Unfortunetly I’m stuck with the “Perform auth flow” step… When I try to reach https://my.hassio.ip:8349/auth I always get an ERR_CONNECTION_REFUSED and I’m not able to login. I tried all the possible IPs/URLs that I use to access HA, but none of them worked (yes, I do use https).
This is the addon log (it reports the same error of @connoleg above) :
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
ifelse: fatal: unable to exec ./run.sh: Exec format error
[cmd] ./run.sh exited 126
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
@asp@connoleg I haven’t updated my HA in awhile so might be something weird with the latest Hass.io. I’ve updated the addon with my hunch of what it can be. Can you try reinstalling?
Bingo! It’s working now Thanks a lot for the super quick reply!
One request, would it be possibile in the future to use the Google Cloud TTS? It’s much more smooth and realistic compared to the Google Translate TTS (try it!)
Is this still working? Because whether using withing the automation nor doing it manual, snapshotting and restoring after a tts command is not working for me. at least with spotify playing music before. any ideas?
Hi @kevinvincent,
Just to say thank you for your SONOS addon, exactly what I was looking for, and working great!
For those interested, I thought that the best way to use it was as a notify service (and therefore add it in notify groups or alerts), so here is my config for those interested:
notify:
- name: sonos
platform: rest
resource: 'http://<your.local.ip>:8349/api/speakText'
method: GET
message_param_name: text
data:
volume: '{{ data.volume }}'
playerId: >
{% set my_player = {"Cuisine":"RINCON_xxxxxxxxxxxxxxxxxxxxxx", "Salon":"RINCON_xxxxxxxxxxxxxxxxxxxxxx", "Salle à manger":"RINCON_xxxxxxxxxxxxxxxxxxxxxx"} -%}
{{ my_player[target[0]] }}
To build the dict for the playerId, you have to take the values from the results here: http://<your.local.ip>:8349/api/allClipCapableDevices
Then you can call it the same way you would use for another notify service:
service: notify.sonos
data:
message: ceci est un test
target: Salon
data:
volume: 30
It would be great if you could have a look at the possibility to broadcast to several or all SONOS speakers in sync (I think there were some discussions on this in your Github). Anyway, thanks again for this addon!
Hi all and thank you @kevinvincent for this the addon! I’m an absolute beginner and had a lot of trouble, but eventually I got it working.
I really would LOVE to use Cloud TTS (via Nabu Casa) with this addon, is there any way at all of doing so? Any help with this would be greatly appreciated. I would prefer to use this addon with my Sonos to other solutions, but I just can’t go on without Cloud TTS
I’m very new to HA, and I wanted something to announce when my doorbell is pressed.
This script makes sense to me, but where do I need to place it in HA to make it come alive? Ideally I want an automation of trigger being doorbell press, action being this sonos tts script but I have no idea where it should go.
Thats awesome thanks for the advice, I actually got it working straight after I posted then forgot to delete the post. I have a Google Nest doorbell and the announcement how plays on my Sonos Playbar.
I recently found the Sonos audioClip API call and decided to make a custom component to take advantage of it. And then I found this thread and saw that @kevinvincent already did that almost exactly two years ago!
Anyway, I’ve posted a separate thread earlier today with a link to the new project: https://community.home-assistant.io/t/sonos-cloud-api-better-alerts-tts/. It’s a different approach which uses a custom component instead of an add-on. It does the OAuth-y authentication within HA and exposes media_player entities to use directly in scripts and automations. Hopefully it’s useful to somoene else. And perhaps @kevinvincent can give some suggestions on how to improve it.
Hmmm… Interesting to see how you did it. I’ve chosen a different approach. I wait for state to change to playing and again until state is paused. Works fine…
If you’re willing to try something new, I made a custom component that doesn’t require installation or maintenance of an add-on: Sonos Cloud API - Better alerts & TTS.