Storing Global Variables: Need to find Local URL

Quite a few of my NodeRED automations use Global Variables that I define in a flow that runs on a regular interval.

One of the routines I have creates a payload that contains the URL to the sound effects stored in https://my.homeassistant.com/local/www/sounds/.

I’ve had to manually configure a Javascript node to assign “https://ha.myhomeassistant.com” to a variable, but I’d like for that to be based upon the Internal URL defined in the general settings from the HA User Interface in the event that it were to ever change…

I’ve pulled all services and states into a global object, but I don’t see configuration settings. Is that accessible?

https://developers.home-assistant.io/docs/api/websocket#fetching-config

1 Like

I knew you’d come through for me @Kermit! Now I just have to figure out how to do that. :).

Use the API node:

image

Output it to msg.payload (I prefer msg.config, myself) and you have your HA config.

What the. That’s too easy. ;).

1 Like