# Config Server
Home Assistant connection configuration
Label for this configuration, see details below for implications
If you're running Node-RED as a Hass.io Add-on check this. No other information is needed.
# Base URL
The base URL and port the home assistant instance can be reached at, for example:
# Access Token / Password
Long-lived Access Token or Password used to contact the API
# Legacy Password
If you're using the legacy password to log into Home Assistant check this and enter your password in the password text box.
# Unauthorized SSL Certificates
This will allow you to use self-signed certificates. Only use this if you know what you're doing.
# State Boolean
string | delimited
A list of strings, not case sensitive, delimited by vertical pipe, |, that will return true for State Type Boolean.
# Cache Autocomplete Results
Enables the caching of the JSON autocomplete requests. Enabling or disabling this may require a restart of Node-RED for it to take effect.
Every node requires a configuration attached to define how to contact Home Assistant, which is this config node's main purpose.
Each config node will also make some data available on the global context, the
Name value in this node is used as, camelcase, the namespace for those values
events is made available on the global context.
states is always set to all available states at startup and updated whenever state changes occur so it should be always up to date.
events is only updated on initial deploy.
# Context Example
Say we have a config node with the name
Home Assistant, with an entity set up in Home Assistant as
switch.my_switch. This state would be available within function nodes and you could fetch using something like the below code
const haCtx = global.get("homeassistant"); const configCtx = haCtx.homeAssistant; const entityState = configCtx.states["switch.my_switch"]; return entityState.state === "on" ? true : false;
# Connection Issues
Communication with Home Assistant is accomplished via a combination of WebSocket and the REST API if you are having troubles communicating with home assistant make sure you can access the API outside of node-red, but from the same server node-red is running on, using a REST client, curl, or any number of other methods to validate the connection