Is there a way to read and store value of specific attribute for later use?
Sometimes I like to broadcast using TTS on my chromecast devices but not they may have their volume set quite low. I know I can script a ‘set volume’ to turn things to an acceptable broadcasting volume however I’d like to return that device back to its original volume at the end of the script…I understand having numerous devices with individually different volumes throws a whole new level of complication if I were to broadcast to an audio group but for now, I just want to work with one device.
TL;DR;
Is it possible to read the attribute ‘volume_level’ of a ‘media_player.entity’ and store it so it can be used at the end of the script to ‘return to previous volume’ once the script has finished?