Refreshing the Spotify Integration Attributes

Hello HA community!

Working on my Spotify dashboard using the current Spotify integration, Spotcast, and the lovelace-slider-entity-row in HACS.

The ability to change Spotify Connect sources was a great addition, and when I change the input_select to the new device, Spotify is updated and the music starts to play on that device perfectly.

spotify_1

Because the Spotify integration updates every thirty seconds or so, I see the volume for the attributes for the integration aren’t updated right away, and so the Volume slider which is bound to my media_player.spotify_amy_worden doesn’t reflect the volume for right away.

Is it possible to tell the Spotify Integration to refresh its attributes prior to the next scan_interval, such as when the input_select changes?

Here is the data I would like to automate refreshing once a different source is selected:

source_list: GRAMO-MSTRBDR, SHIELD, GRAMO-BASEMENT, GRAMO-FAMILY, Web Player (Chrome)
volume_level: 0.3
media_content_id: spotify:track:01MXkFA8sL7at6txavDErt
media_content_type: music
media_duration: 341.746
media_position: 227.618
media_position_updated_at: 2021-01-17T17:47:12.690000+00:00
media_title: Making Love Out of Nothing at All
media_artist: Air Supply
media_album_name: All Out Of Love
media_track: 10
media_playlist: Yacht Rock
source: GRAMO-FAMILY
...

So much thanks!

I ran into the same issue and used node-red to update the entity status more frequently (and also stop it when the player goes offline). Feel free to import this flow (and make sure to select the correct entities afterwards in the blue nodes because they’re set to my configuration): Spotify Updater ($2476545) · Snippets · Snippets · GitLab