Home Assistant Community Add-on: Node-RED

Im getting this on my node-red logs, any ideas?

30 Oct 23:22:51 - [info] Starting flows
30 Oct 23:22:52 - [info] Started flows
30 Oct 23:22:52 - [info] [mqtt-broker:Mosquitto] Connected to broker: mqtt://localhost:1883
30 Oct 23:22:52 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant
30 Oct 23:22:52 - [error] [function:Compose weather] TypeError: Cannot read property 'state' of undefined
30 Oct 23:22:52 - [error] [function:Compose temperature] TypeError: Cannot read property 'state' of undefined
30 Oct 23:22:52 - [error] [function:Compose weather] TypeError: Cannot read property 'state' of undefined
30 Oct 23:22:52 - [error] [function:Compose temperature] TypeError: Cannot read property 'state' of undefined

Please read the release notes (posted yesterday in this thread) on the upgrade instructions.

Ah ok, seems like there are some breaking changes with two of the nodes. The Poll State and Current State both have a little different formatted output. im working on it, thanks @frenck

1 Like

When using Ha services, code-red contains node-red-contrib-home-assistant-websocket errors. How to fix? or how to update? Ha installed in Docker!

So, I see in the notes that ā€œthe add-on now authenticates against Home Assistantā€. But what is my username? I have the api_password set, and thatā€™s all Iā€™ve ever used to login to home assistant. and now I canā€™t access node red at all, I tried blank user and ā€˜adminā€™, but I canā€™t even see in the docs where to configure a potential username for home assistant?

1 Like

me2 too i have delete the folder .store, restart and set a new user. but node-red said ā€œLogin failedā€. After delet node-red incl. folder, the same. something Iā€™m doing wrong

So, the answer for me was, upgrade to a newer home assistant, since apparently users are a thing now, but werenā€™t on the version I was using.

The new home assistant config was automatically added, but didnā€™t replace my existing one, so on every node I had 2 ā€œHomeassistantā€ options to choose as the server. I just deleted the old one, and had to double-click then click done on every HA node to reset it to the new server config using the generated key, and now it appears to be working again.

I upgraded to the new Node-RED, reconfigured and made sure everything worked smoothly. Tonight I updated my Hassio to HassOS 1.12 then Hass to 81.2. After the system came back online I noticed in the Hass System Log a whole bunch of errors when Node-RED was trying to initialize the API.

18-10-31 00:12:47 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
18-10-31 00:12:47 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
18-10-31 00:12:47 ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].

There wasnā€™t any errors anywhere else and my automations wouldnā€™t work until I restarted Node-RED. After restarting Node-RED everything was fine again.

After upgrading Node-red started to appear such mistakes all the options Ha

I keep getting this error no matter what I tryā€¦

31 Oct 17:42:23 - [error] [server:Home Assistant] Error: Invalid access token or password.

I have tried to uninstall and reinstall the add-on and reset all settings to default without any luckā€¦

My config looks like this:
{
ā€œlog_levelā€: ā€œinfoā€,
ā€œcredential_secretā€: ā€œ(same credential as before the upgradeā€,
ā€œhttp_nodeā€: {
ā€œusernameā€: ā€œā€,
ā€œpasswordā€: ā€œā€
},
ā€œhttp_staticā€: {
ā€œusernameā€: ā€œā€,
ā€œpasswordā€: ā€œā€
},
ā€œportā€: 1880,
ā€œsslā€: true,
ā€œcertfileā€: ā€œfullchain.pemā€,
ā€œkeyfileā€: ā€œprivkey.pemā€,
ā€œrequire_sslā€: true,
ā€œsystem_packagesā€: [],
ā€œnpm_packagesā€: [],
ā€œinit_commandsā€: []
}

Please edit your server connection in NodeRed.
it has to be changed to :
http://hassio/homeassistant as the server URL
No access token necessary

See last item on upgrade instructions :

:tada: Release v1.0.1

Full Changelog

Changed

  • Upgrades Node-RED to 0.19.5
  • Adds FAQā€™s about upgrading to v1.x.x

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

I note that I had to specify the username in lowercase in order to get this to work, despite having mixed-case usernames in HA.

Config as per @TKDJesper is working for me if I use the username incorrectly with lowercase from HA

1 Like

Iā€™ve tested this (again just right now to be sure), but the add-on handles casing of usernames correct on my end.
Iā€™ve tested with the username Henk and password }_zmq4c.%CXbqh>/B9"2Dmq%,!Am)v"^+pJ~qEjLvā€™[gF$`. So both complex password an capitalized usernames, did work on my end?

Hi Frenckā€¦
I solved the issue with only lower case lettersā€¦
In Home Assistant the users is registered with a capital letter, but if I write the exact name as it is in HA, I get a login failedā€¦ If I only use lower case letters, then all is fineā€¦

The Usersā€™ name is registered with a capital letter, the username is lowercase (automatically suggested by HA).

2 Likes

All went well except that the new problem is that now HA does not connect to node-red there is no data in the API pass and Long-Lived Access Token. That there to point fingers? Before the update, the data were registered there.

Not sure what you are using, but that is not what the add-on should look like (your fields are different).

image

Seems like you have a manually installed/loaded version of the Spartan-II-117 fork installed.

Donā€™t know for sure but in manual I didnā€™t installed all the repository HA after the update this has become.

Go to the palette management and search for home-assistant, what do you see?