Is the Base URL stored in the Global home assistant variable in NodeRED?

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:

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');

…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?


If you have external URL defined in the HA UI you could grab it and save it to the global score of NR.



[{"id":"29dea161.167d0e","type":"ha-api","z":"ffbd7f06.4a014","name":"","debugenabled":false,"protocol":"websocket","method":"get","path":"","data":"{\"type\": \"get_config\"}","dataType":"json","location":"payload","locationType":"msg","responseType":"json","x":290,"y":1552,"wires":[["83347616.aaf6a8"]]},{"id":"a1fd86db.ff52a8","type":"inject","z":"ffbd7f06.4a014","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":138,"y":1552,"wires":[["29dea161.167d0e"]]},{"id":"83347616.aaf6a8","type":"debug","z":"ffbd7f06.4a014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":454,"y":1552,"wires":[]}]

Hmm…that would probably do it.