Please try with 2023.5 and skip the snapshot/restore. There’s a new feature that overlays the audio on top of any music currently playing. The tts.voicerss_say
service call should be all you need now.
Thank you very much for your response, going to give it a try
Best,
I’ve tried this, but it’s still the same.
Is there another solution for this?
Thank you for your response.
Yes, same here, still an error.
Not right after starting HA, but after a while TTS stop working.
My solution (ugly workaround) is to replace the
lib/python3.11/site-packages/homeassistant/components/sonos
directory with the same directory from the 2023.4.6 release.
Surprisingly, this solution worked flawlessly and did not rely on sonos-websocket
at all. Although it may not be the most elegant approach, it successfully restored TTS functionality in my Home Assistant setup.
Please don’t do that, it will definitely break over time. There were fixes to TTS in the point releases. Were you on the latest 2023.5.X?
Yes, I’m always at latest version (I’m even doing beta).
Even if it was said “fixed” in 2023.5.2 (“Bump sonos-websocket to 0.1.1”) it was later removed and re-introduced in 2023.5.3
But it is not solved (yet)
There aren’t existing reports of notification sounds stopping to work, so please create an issue in core
with more details.
There is but is now closed
The behaviour is exactly as before.
I’ll post logs there
Agreed. Still not working, is there another report open?
Just did
@Mabaelst, @kartcon good news for me, hoping the same for you, the correction made in sonos-websocket 0.1.2 by @jjlawren has solved my issue.
Hope it will be in 2023.5.5 (or 2023.6.x)
Thank you for your response,
but still don’t quite understand how to solve this. I’m fairly new here and trying to learn a lot.
Can you explain this to me a bit?
You’ll have to wait for next release of HA.
As a professional tinkerer, I have modified some files that shouldn’t be modified to test what will be in the next version.
I was prepared to take the risk of messing up my installation.
Thank you very much for your response,
So if I understand correctly, it will be fixed in the next update?
Using what should be in the next release is solving the problem.
To be sure that it is, look at the release note (2023.6.0 is planned for June 7th)
You should see a line like this one:
- Bump sonos-websocket to 0.1.2 (@jjlawren - #93323) (sonos docs)
No mention of it :<(
I also searched the full change log for both the GitHub ticket number and ‘jjlawren’.
Sometimes that happens when a fix is tagged for a point release that was never actually released (2023.5.5 in this case). It’s included in 2023.6.0.
@ jjlawren
Thanks for the response on Wednesday. Since then I installed 2023.6 and 2023.6.1, rebooted and restarted Home Assistant but continue to be unable to send TTS messages to anything but the target speaker. All attempts to join speakers into the group only result in the target producing the output.
I have downloaded the Sonos diagnostics and it does confirm sonos-websocket==0.1.2
"requirements": [
"soco==0.29.1",
"sonos-websocket==0.1.2"
],
I’ve also tested with a simplified automation where there are no passed variables, choose statements or any other complex coding. Just a simple join and speak automation.
- id: media_sandbox_4
alias: Media Sandbox 4
description: 'Generic testing utility'
initial_state: true
mode: restart
trigger:
- platform: state
entity_id: switch.momentary_sandbox_4
to: 'on'
condition:
- condition: state
entity_id: input_boolean.sandbox_testing
state: 'on'
action:
- service: media_player.join
target:
entity_id: media_player.kitchen_white
data:
group_members:
- media_player.living_room
- media_player.sunroom_black
- media_player.mbr
- media_player.office
- media_player.garage_speakers
- media_player.patio_speakers
- service: tts.google_cloud_say
data:
entity_id: "media_player.kitchen_white"
message: "The quick brown fox jumps over the lazy dog."
Today I have turned on Debug Logging and can provide those findings after tomorrows morning briefing. Lastly, I have confirmed the the target device is in fact grouping the other speakers in the States tab of Dev Tools.
group_members: media_player.kitchen_white, media_player.garage_speakers, media_player.office, media_player.patio_speakers, media_player.mbr, media_player.sunroom_black, media_player.living_room
volume_level: 0.2
is_volume_muted: false
I’m at a loss as to why I can no longer group these speakers and make a whole house announcement. Everything always ONLY plays on the Kitchen device (master). Any suggestions would be greatly appreciated.
If you’re using a tts.*_say
with Sonos, the speaker groupings no longer have any effect. Only the explicitly targeted speakers will play, regardless of any group structure used for music playback. Just list all of the destination speakers in the TTS call:
- service: tts.google_cloud_say
data:
entity_id:
- media_player.kitchen_white
- media_player.living_room
- media_player.sunroom_black
- media_player.mbr
- media_player.office
- media_player.garage_speakers
- media_player.patio_speakers
message: "The quick brown fox jumps over the lazy dog."
This avoids the need to snapshot/regroup/etc to play announcements. Music playback, groupings, and volume levels are no longer affected by TTS or media_player.play_media
calls with the announce
option enabled.
I’m sorry, but the above code does not work as intended. Every speaker in the entity_id list is milliseconds out of synch with its neighbor. See TTS: Speaker Group - Jitter/Stutter