If you want NodeRed to talk to other systems you can use a message broker service like MQTT. If you are keeping just inside NodeRed then global variable are just fine.
I want to hear more about your Alexa integration. I have done some basics like using Alexa to turn on Spa mode. But I would love to be able to use Alexa to query what a global variable is in NodeRed, like my pH or pool temp.
@Katodude I've only done a little experimenting from the examples others posted in this thread, but only the basic stuff:
1) "Turn Spa On/Off" using the package "node-red-contrib-amazon-echo." For this I had to do some remapping in iptables on pi (basically Amazon discovery looking on port 80, so I remapped to a higher unused port so I wouldn't have to run node-red as root)
2) Use "node-red-contrib-alexa-remote2-v2" and a "Routine Speak" node to have Alexa speak from one (or ALL) of your echo devices. This package seems to use a proxy server that is sets up on your pi to login to your actual Alexa account.
While node-red-contrib-amazon-echo is nice, it seems like it is limited in that:
1) The Amazon echo hub node does not give you any indication of which echo the request came from- so if you reply back using (2) above, you don't know which device to have Alexa speak from.
2) In looking at the node-red-contrib-amazon-echo package code, it appears to be based off the Philips hue Alexa-controlled light bulbs. That being said, I would assume you are limited to commands like what can be found here: Philips Hue Commands
That being said, you could probably add a device node to the hub node called "Pool Temperature," discover it, and say "Alexa TURN ON Pool Temperature," and have that node kick off a flow that would get the pool temp from your global variables, assign it to the payload, and then use the "Routine Speak" node to say it. (If the temperature is a string, and is "85," the "Routine Speak" node will announce it properly).
Something like this in a function node before the Routine Speak node: (...Actual code untested...)
// Get Pool Temperature
var x = global.get("PoolTemp")
var AlexaMsg = "The Pool temperature is " + x + " degrees";
msg.payload = AlexaMsg;
Its a hack, as "Alexa TURN ON Pool Temperature," is not "Alexa WHAT IS Pool Temperature"... but its all I got right now
UPDATE: Here is a way to identify which device is getting your questions:
node-red-contrib-alexa-remote2-v2 - You can use an Alexa-Event "On Device Activity" node. Buried in the resulting message is the device name. But what I found is that when you use the "Routine Speak" node to have Alexa say anything FROM that device, it will trigger it in an endless feedback loop. So I found the following: "node-red-contrib-simple-gate" package. After the first trigger, you can ignore the next triggers (messages) by closing the gate for some time (delay), then opening it back up.
I just noticed node-red has a Twilio node. With this you can sign up for a free Twilio account and have your pool controller send you text messages. (If you have Verizon this can be accomplished by sending email to <mymobilenumber>@vtext.com, but I like the Twilio way better). While I haven' tried the node-red implementation, earlier this year I was using the Twilio API for work. It is pretty straight forward.
I thought I recall @cmc0619 wanting to send text messages as reminders (purchase chlorine, etc).
About 1/2 down this page
There is a section called Interpret Commands and Room Awareness
It figures out the SN of the Dot that you are talking to, and then you can route the response to that Dot. In my flow, I'm turning on the lights in the room where the Dot lives.
The next example is a flow to get the pool temp, and have Alexa tell you the temp. But honestly I don't use it, I look at my phone because I forget I can ask Alexa lol
EDIT: I included flows in my page, you should be able to copy the flow and import it into node red, and then it will be easier to see what I did.