Play the latest played music URL stream

Hi all,

I have a flow in node red that catches the latest played music stream url. I created a second flow to play the catched url music stream.

The problem is that sometimes the music is start playing and sometimes i get the error:

“HomeAssistantError: string index out of range”

Are you sure the flow that gets the stream is working properly? Just a guess is that the error occurs due to an error in the payload format coming in to the node.

This is the total flow.

if i debug the node it is showing the url that i want to stream


You’re sure it’s the same when it fails? The image looks like it was a good service call. You can add a change node to store the payload to a flow variable. Then when it fails look at what it sent.


edit: to view the variable, open node red to the page with the node, on the right where the debug is choose context. Then hit refresh next to the flow section.