Feature to set volume level for an announcement #2782
Replies: 6 comments 8 replies
-
@danielbrunt57 first, happy new year! Thx for your implemetation. My script from here: #2766 (comment) I have now made a version which respects various delays and also prevents the volume jumping of the music. Also tried it with different sentence lenght's (in german) and optimized the end delay.
Before, please manually start an tunein station with low volume like 20 (example like in the bathroom in the morning). Download: notify.zip One issue i noticed (and is currently present in my version) is: on tts the "targets" attribute does not work correctly with mutiple devices. |
Beta Was this translation helpful? Give feedback.
-
I just had a look at your version and I see the problem re: tts. If we want
|
Beta Was this translation helpful? Give feedback.
-
I have fixed the tts issue just by adding the loop a second time. Here is my current version: notify.zip Sadly the restoring does'nt work correctly sometimes, so music stays on the speak volume (especially when using multiple targets). I think there are multiple issues with this:
My initial script is announcing/tts'ing all alexas synchrounous (one after one) and not parallel, like this approach. Maybe you could take my latest version and get it to work stable? P.S.: It's so sad amazon was just to lazy to add an "volume" attribute to the announce/tts :-( |
Beta Was this translation helpful? Give feedback.
-
The applestrudel package using alexa-remote in Node-RED has this node: and logging shows a single POST with set new volume, the TTS to speak, and set the old volume:
** OpenHAB (Java-basesd) also has a method to speak/announce at a different volume level. |
Beta Was this translation helpful? Give feedback.
-
I've studied the code further and now I see the difference between
the announcement using
|
Beta Was this translation helpful? Give feedback.
-
Nope. If music is playing, the volume is set/increased, the TTS/announcement occurs all the while music continues playing at the new volume level while the text is spoken, then volume level is restored. The only solution I found for this in NR is: That would have to modified to first test if music is being played, pause it, then resume it. I've no idea if OpenHAB handles things differently. It's all quickly getting very complicated... |
Beta Was this translation helpful? Give feedback.
-
I've worked out code to allow you to set a volume level for an announcement after which the previous volume level is automatically restored. Here is the revised
notify.py
for you to test: notify.zipTo pass the temporary volume level, you code it like this:
Beta Was this translation helpful? Give feedback.
All reactions