i8beef / node-red-contrib-castv2

MIT License
22 stars 14 forks source link

Dynamically send cast device IP address #94

Closed GIGS1975 closed 11 months ago

GIGS1975 commented 11 months ago

Hello there Thanks for you wonderfull work. May i ask for a little bit of assistance? How can i set the cast device IP address from a HTTP call dynamically? As there is no such property like IP address in the node itself, only in the config node, is there any way to achieve this? I want to send a HTTP request to Raspberry, and this request would contain, what IP address do i want to cast my MP3 file.. Then this information i would somehow get to CastV2 node, so it will play the mp3 on the IP address that arrived from HTTP call. Is there any workaround? Many thanks for any help.

i8beef commented 11 months ago

That's not how this node works. It maintains a constant connection to your cast devices, it doesn't connect, send commands, and then disconnect. I usually setup a single node per cast device with a link node, so I can send arbitrary messages from any flow.

GIGS1975 commented 11 months ago

So there is no way to send the cast device IP to a forexample function node, and somehow update it to the CastV2 node right? If you would do something like this, what woul be your approach?

i8beef commented 11 months ago

Correct. The node maintains a constant connection to the target, so you can't change it dynamically. If you need to route messages dynamically, you'd have to do something like a switch node to map known IP addresses / target names, etc, to individual castv2 nodes that are preconfigured to that IP.

GIGS1975 commented 11 months ago

Thanks a lot for advice