Node-red add-on is not pre-configured and does not see entities

Hi,
I installed Node-Red add-on in my home assistant instance. It was working for a while. After some update it became unconfigured and the flows, that I had, disappeared.
Currently, Node-Red seems to be uncofigured. When I try to add a new node then I have to configure a home assistant server. When I added the new server and marked ‘Using the Home Assistant Add-on’ then a list of entities is not loaded.
What should I set to make this working with Home Asisstant?

Maybe you are missing the long lived token for Node Red.
This guide might help you.

Thanks for the reply.
I tried this but it didn’t help.

have you updated nodered companion in HACS?

If you are using Node-RED as a Home Assistant add-on package, then it comes modified specifically for HA and with an included set of palette nodes. The add-on is fully pre-configured and can be used ‘out of the box’.

You do not say what update caused your original issue, but there have been changes in the way addons are managed in Home Assistant, which included a move of all addon files to new directory locations. The update from old to new location included an automatic move of files. It is possible that your original setup had the Node-RED flow file in one location, and your update did not move this correctly.

You do not say which versions of HA, Node-RED addon, or palette nodes you are using, but as always with any problem it is important to update all the relevant software packages. You can easily find the version of each package using the Node-RED debug window > Home Assistant tab > and click on the ‘gear icon’ at the very bottom right.

The HA, Companion, and Node-RED (associated with the addon version) versions must be either the latest, or versions that are compatible with each other.

You do not say what node you are adding, however I assume this to be one of the WebSocket nodes that use a Home Assistant server configuration node to connect back to HA via API and WebSocket.

If you set the HA server configuration to ‘Using the Home Assistant Add-on’ then the server will connect to HA using the supervisor proxy, and no other manual settings are required. Again it all works ‘out of the box’.

You do not say where you are not finding your ‘list of entities’ as not loaded, however I assume that you are referring to either the Global Context homeassistant variable, or to the entity-name auto-complete facility.

You can see the homeassistant server settings easily by again using the Node-RED debug Home Assistant tab, and looking at the (you should only have one) Home Assistant server under the server section.

If you have more than one homeassistant server then you may well be causing an overload of the WebSocket, which would of course prevent the server from working correctly (if at all). I wonder if you have been creating a new homeassistant server configuration node for each WebSocket node you add, rather than using the same server each time?

The UI settings include

  • Enable heartbeat
  • Enable global context store
  • Cache autocomplete results

The heartbeat can be useful to keep the WebSocket / API connection alive as it can ‘go to sleep’ if not used and thus becomes unresponsive for a short period when needed again.

The global context store, if enabled, will save (and regularly update) a copy of the HA state to a global context variable.

The ‘autocomplete’ facility auto-populates a selection list for Area / Device / Entity for (all?) of the WebSocket nodes UI selector edit fields. This feature usually works quite well, but can be problematic. The lists are cached internally by the server, and this can prevent them from working, so the recommendation is to try turning this setting off if it is on, which forces the autocomplete list to be regenerated each time it is required where there are issues with caching. Or you can turn it on if it is off, which may help solve performance issues when regeneration of the list is taking too long.

If this autocomplete feature is indeed the ‘list of entities’ that you are no longer seeing, it is also worth noting that all the UI editing happens in your web browser, and using a different browser and/or flushing the browser cache is always going to be a first step toward dealing with such issues.