Select one source out of many and send IR Commands to selected source

I'm trying to send IR commands by first picking the correct source and then depending upon the source selected send IR commands to that selected source. My sources are all DISH Network receivers, I have the correct codes and I'm using Global Cache to flash the IR codes at the receivers. If I send the IR codes directly to the source it works; however, I cannot seem to find a way to first pick the source and then send to the source based upon the selection. I don't want to send the IR commands to all the sources at once...

This flow sends the IR commands thru the Global Cache correctly:

This is the idea I had to first select a source, but is not working:

Anyone create a flow to send IR commands to one source out of many?
Sincerely

Wire the drop-down to a change node that sets flow.source

Next wire the buttons to a change node that compares flow.source and add a bunch of == string value comparisons from from the change node outputs to the transmitters

Thanks for your help!

In my change nodes below:

I have Set, Change, Delete or Move in the change nodes...How do I compare the data from the first change node? also, do I need to have a change node for each button or can I do all the comparison thru the 2nd change node?

Flow 1

drop-down --> change node (set flow.source)

Flow 2

Button --+--> Switch --+--> IR Node
Button --+             +--> IR Node
Button --+             +--> IR Node
Button --+           

If you don't mind me saying, I think a little training would help:

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

To clarify this. Setting flow.xxx means you can, in a separate flow, compare flow.xxx

I.e. it is simply a place to store the selected value until at some later time (i.e. when you click a button), you can the compare the flow.xxx value in a switch node to route the message to the correct IR node based on the value of flow.xxx

Thanks for helping. I watched the videos and did learn some things.


I'm getting a payload of 11 or 12 etc...with a flow.source set in the change node (below)
Capture 2
Then in the switch node I have the property set to flow.source (below)

I'm checking flow.source and looking for 11, 12 etc...

It is not passing any data through...

Show me the flow context in the context viewer (drop-down near debug icon top right)

I suspect the stored value is a number and you are comparing to strings in the switch node (note the a/z icons)

Also, you are setting flow.souce to an empty string. It should be msg.payload (that's where the data from the drop down is, so you should be setting that into the flow.souce)

Thanks for your help on this! It is working fine based upon your suggestions.