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:
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
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?
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
I'm getting a payload of 11 or 12 etc...with a flow.source set in the change node (below)
Then in the switch node I have the property set to flow.source (below)
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)