Media_player media_title change

I’m sure what I want to do is super simple but I’m driving myself crazy as a new user. In a nutshell I would like to be able to send out a serial command once the song title on my Sonos changes. My question is, how do I detect the media_title change in my media_player.sonos? I want to essentially use that to trigger sending out a bunch of the other attribute information to my whole home audio keypads and this first step is causing me problems.

Well i would use Node-Red
grab a events: state node + a debug node set to output complete msg object
use an events: state node but the Output only on state change unticked
this will output all changes
look in the debug window
find the path that shows the media title
on my media player its
data.new_state.attributes.media_title
click the copy path
you will then need a rbe node to block unless value changes and specify the
field your wanting to watch change
msg.data.new_state.attributes.media_title

then nothing will flow out of the rbe node unless the title has changed

[{"id":"3b83def.a4b8422","type":"server-state-changed","z":"6ebbb9e9.219f18","name":"","server":"bccb1397.a4a2c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"media_player.office_speaker","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"x":190,"y":120,"wires":[["612589d8.8a4538"]]},{"id":"bccb1397.a4a2c","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

image
seems that the google mini pauses at the same time it changes the title
put a switch node between it to only allow with payload playing
image

Thank you so much for the detailed response. I knew it had to be an easy solution but with all the options available I was banging my head against the wall for hours! It’s people like you that take the time to help out other users that really allow this community to grow!

1 Like