I’m trying to identify media players that are actively playing through Sonos, but I’m having trouble getting the right results with my current approach. I’ve tried filtering the list of Sonos entities to only include media players and then checking their state, but it’s not returning the expected results.
Thanks for posting your solution. did you end up using the plex intergration for this? or mis posted the code? i would very much like to use this, in this blueprint: Group Sonos based on presence (e.g. Motion)
Thanks! but that code just gives me the first speaker, not the actively playing speaker. ive added selectattr('state', 'eq', 'playing') to the template but that doesnt seem to work