I have several Announcement automations involving Alexa’s. (ie. Good Morning templates, Washing Machine complete, Garbage reminders, Front door opened, etc…).
I’d like to be able to store the Echo’s volume before these Announcements fire, and then revert back to that volume after the announcements. All of my Announcement automations use a volume_level, but if music/radio/etc is playing before the announcement, I’d like it to go back to the volume it was at.
Alexa volume is a state attribute.
I think I need to use some sort of trigger based template, but I’m a bit of a noob with templates.
Perhaps the announcement automation triggers a 1st action to store the current volume_level, then run the remaining automation actions, then the final action is to go back to that original volume.
Any suggestions? Point me down the right path? Thanks.
I’ve gone the custom HACS component route, but getting a stupid error (stupid in that it’s me that is the error :). Can create your first script, but the second one (tts_restore_dot_volume) gives me an error:
Message malformed: extra keys not allowed @ data[‘tts_restore_dot_volume’]
I’ve literally pasted your script in, only changing the name of the media player.
Sorry for the noobness… I only created the 2 scripts you had above. The first one did not throw an error upon creating it, however it errors when I run it (unable to find service variable.set_variable)
I think I missed the part in the custom component where I needed to put the variables in the config file?
That’s for my echo but you should probably rename it to something useful for you. Then you will change the entity_id in the scripts to match the name you chose.
Here is where I’m at. Thanks for your help with this.
Installed HACS component - hass-variables https://github.com/Wibias/hass-variables/blob/master/README.md
I’m still getting an error when I try to run one of the 1st script (Save Current Volume). The 2nd script (Restore Volume) seems to to run fine when triggering these via the UI.
Yes, several times. The service is there in developer tools, so I don’t think that is the issue. I get this in the logs when trying to run the first script:
Save Current Volume for Echo TTS: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data[‘value_template’]
I tried moving the last line of }}’ up to the same line in the value_template, as well as trying with a space and without.
Hi there,
Did this change by any chance? This is not working for me. I think the integration had a breaking change and someone changed it and how it is set up. But I can not get this to work, unfortunately.