In node red, I’ve utilized variables to run soundFX routines through the same processes so I don’t have to create multiple flows for different things.
One of my automations is a grandfather clock. Another fires off a random vintage Folgers advertisement when the coffee maker is done.
Both of them rely on repeated values which I store as global variables.
One of those values is the root URL path to my sounds, which is:
https://hassio.mydomain.com:8123/local/sounds
Under that path, I have various paths to numeric sounds. For example, there’s a /coffee
path. Inside of that path there’s a christmas
path which is defined using Javascript which bases it upon the current month.
Now, normally, I could just create a Javascript node and manually type in the URL to the sound folder, then store that as global variable in NodeRED.
But, what I would prefer to do is extract that value from the already existing homeassistant object via:
global.set("states", global.get('homeassistant').homeAssistant.states);
global.set("services", global.get('homeassistant').homeAssistant.services);
…assuming that the URL for the site is stored somewhere in this object.
Does anyone know a) how to quickly search through the object and/or b) if the value I’m looking for is there?