I have Jellyfin installed and configured, and have the Jellyfin plugin in HASIO. In Home Assistant, if I go to Media > Jellyfin, all of my media is there. I can browse down to an audio file, and, using the options at the bottom right of the screen, select a device to play it to, press the power button, and the play button, and hear the audio on that device.
I am trying to automate that in Node Red on Home Assistant without any success. I have tried grabbing the stream URL from Jellyfin itself, and the URL inside HA as I play the file as detailed above, and placed that in a “DefaultMediaReceiver” payload, and nothing seems to work. That DefaultMediaReceiver payload works fine if I specify a URL to an MP3 file that is on the internet.
I use a function node with this code:
var msg =
{
"payload": {
"app": "DefaultMediaReceiver",
"type": "MEDIA",
"media": {
"url": "<jellyfin or HA URL to mp3 here...>",
"contentType": "audio/mp3",
"streamType": "BUFFERED"
}
}
};
return msg;
And that is sent to a castv2-sender node. Everything is OK, except the URL will never play> I also send a volume set to that device, and that works, and simply changing the URL to an online mp3 works fine.
Any help much appreciated. Happy to hear about a better way to do this in Node Red if I have taken a wrong path. I am trying to keep it in Node Red just because I have a bunch of other automation in there, but also happy to hear about other options that may have a better outcome too.
Cheers