[APP][Pro] Sonos (LocalAPI)

Google Services app might cost money, i just use my own HomeyScript that generates a URL using google translate: https://translate.google.com/translate_tts?ie=UTF-8&q=${encodeText}&tl=${lang}&client=tw-ob

If you for example play this URL through the play URL card it will say “Hello” in English US: https://translate.google.com/translate_tts?ie=UTF-8&q=Hello&tl=en-US&client=tw-ob

Yeah i know, i also have that free version in the Google Services app.

But even the Cloud version of the Google Services app is free for an x million characters. I have used it for years and it’s still always has been free :wink:

But the non-cloud version uses the same URL as you are using :wink:

No matter what i did in google services it FORCED ME to add a credit card.. Did you have to do that and it’s free? or did it not ask you?

Yes, you have to enter a CreditCard, buts it is free.
If you go over a few million characters in a month, you are gonna pay, although it would be a few cents for like a million characters or something. But i have never had to pay a cent at all and i implemented a Cache in Google Services to even reduce the usd characters.

But this is kinda off-topic for this thread, so if you have any questions, lets continue on the Google Services topic :wink:

I agree :laughing:

Dutch Text-to-Speech is built into the app and is free to use.

Open the Sonos (LocalAPI) app settings, select the built-in TTS provider, choose Dutch (nl-NL) and select one of the available voices.

In version 2.8.1 I have added a flow card to switch to line-in. (Available in test now)

I have to restart this app every few days because it stops working. I only use the app to send a Sonos command after receiving a webhook. (The webhook is sent by my Loxone Miniserver.)
I’m running this on a Homey Pro that’s working fine (Early 2019 model).
No network issues. Is this a known issue?

Hi @xiutit !

Still enjoying your amazing app here, but here I am again with a feature request:


Could triggers for Spraakversterking and Nachtmodus (yes/no) be exposed as triggers for the “Als…” kaarten, for the speakers that support it (mainly the soundbars I’m guessing)?

My use case is wanting to integrate both sound controls more into the TV experience: for example I’d like to show popups on the TV whenever any of these modes is changed, make these states able to be toggled from the TV itself, … But for that I’d need to be able to read their state, which currently does not seem possible (unless I’m missing something).

Maybe a bit niche, but could that perhaps be a useful thing to add for the soundbars?
I guess the other stuff like loudness, subwoofer, … could be included as well, or would that be to much?

Thanks!!!

I’ve added When and And cards for night sound, speech enhancement, loudness and the subwoofer in version 2.9.1, now available for testing.

I found and fixed two issues that could cause this behaviour. Could you try version 2.9.1 and let me know whether the app keeps working over the next few days without needing a restart? If it stops again, please send a diagnostic report before restarting.

Since you are adding WHEN-cards :blush:: is it possible to add trigger cards for when the volume is muted resp. unmuted?

So, i might get a Sonos Sub Mini. What flow cards does it have? I don’t know much about subs, so i don’t really have any ideas of flow cards yet.

I’ve added When and And cards for mute/unmute, surround sound and shuffle in v2.9.2

In V2.9.2 you get:

  1. When: The subwoofer is enabled or disabled.
  2. And: Check whether the subwoofer is enabled or disabled.
  3. Then: Enable or disable the subwoofer, or set its level from −15 to +15 dB.

Thanks!

However, the when cards for mute/unmute seem to work only once, after which I have to restart the app to get the trigger to work again. And then it works only once again.

I performed the following by sending a notification to the timeline to check whether the trigger occurred:

  • Press mute button > Mute WHEN-card triggers :white_check_mark:
  • Press unmute button > Unmute WHEN-card does not trigger :cross_mark:
  • Press mute button > Mute WHEN-card does not trigger :cross_mark:
  • Restart app
  • Press mute button > Mute WHEN-card triggers :white_check_mark:
  • Press unmute button > Unmute WHEN-card does not trigger :cross_mark:
  • Press mute button > Mute WHEN-card does not trigger :cross_mark:

I currently use the Device Capabilities app to watch the boolean value of the ‘Volume muted’ mute tag, and that works consistently: every mute / unmute action updates that tag.

It seems that the said WHEN cards are not working as expected.
Any idea what could be causing that?

Thanks! :grin:

Thanks for testing! Can you try 2.9.3 should be fixed.

Thank you. The flowcards are working now :grinning_face:.

Hi Dennis,

Is there a deliberate delay before speaker_playing turns true? In my tests it comes 2.7–2.9 s after the speaker itself reports PLAYING (measured against the speaker’s own AVTransport events), while stopping takes only 0.1–0.4 s. The track info updates right away, so the app seems to get the event in time. Could the delay be shortened or made a setting? I use “Started playing” to switch on an amplifier, so the first seconds of music get cut off.

Apart from that, the app works great on my all-S1 system (2.9.3, software 11.16.1): it found all five speakers, and grouping is handled better than in the official app. Thanks for making it!

Michael

Hi Dennis,

A follow-up to my question above: could you add a trigger for the speaker’s transport state, e.g. “Playback state changed” with the state as a tag, or simply a “Starting / buffering” trigger?

When I start a radio station, the speaker sends TRANSITIONING (ZPSTR_CONNECTING, then ZPSTR_BUFFERING) about 4–5 seconds before PLAYING. With a trigger on TRANSITIONING I could switch on the amplifier while the stream connects, so it’s ready when the sound starts. Right now “Started playing” comes 1–2 s after PLAYING, so the first seconds are cut off.

Thanks again for a great app. It has been rock solid on my S1 system today!

Michael

Hi Michael, could you try 2.10.0? “Started playing” should now fire sooner. I’ve also added the Playback state changed trigger.