zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
446 stars 180 forks source link

Update problem with device node #160

Closed Leopoll closed 1 year ago

Leopoll commented 1 year ago

After upgrading from version 1.0.9 to 1.1.2 and Node-RED to 14.0.1, all HA nodes give an error. I restored the backup, but now the "device" nodes do not work (it does not give an error, it just does not work), the rest of the HA nodes work fine. rebooted many times - but nothing helps. Home Assistant 2022.12.8. image image

zachowj commented 1 year ago

what's the status under the device node now? Is there anything in the logs?

Leopoll commented 1 year ago

Status: running Now I'm trying to update again. Again "Error: Server config node not found" on all nodes.

Leopoll commented 1 year ago
[03:43:29] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
3 Jan 03:43:36 - [info] 
Welcome to Node-RED
===================
3 Jan 03:43:36 - [info] Node-RED version: v2.2.2
3 Jan 03:43:36 - [info] Node.js  version: v16.14.0
3 Jan 03:43:36 - [info] Linux 5.15.76-v7+ arm LE
3 Jan 03:43:39 - [info] Loading palette nodes
3 Jan 03:43:51 - [info] Dashboard version 3.1.6 started at /endpoint/ui
3 Jan 03:43:54 - [info] Settings file  : /etc/node-red/config.js
3 Jan 03:43:54 - [info] Context store  : 'default' [module=memory]
3 Jan 03:43:54 - [info] User directory : /config/node-red/
3 Jan 03:43:54 - [warn] Projects disabled : editorTheme.projects.enabled=false
3 Jan 03:43:54 - [info] Flows file     : /config/node-red/flows.json
3 Jan 03:43:55 - [info] Server now running at http://127.0.0.1:46836/
[03:43:55] INFO: Starting NGinx...
3 Jan 03:43:55 - [info] Starting flows
3 Jan 03:43:58 - [info] Started flows
3 Jan 03:43:58 - [info] [server:9055ffae.cacf6] Connecting to http://supervisor/core
3 Jan 03:43:59 - [error] [api-call-service:Fun off] Call-Service attempted without connection to server.
3 Jan 03:43:59 - [error] [api-current-state:если подсветка вкл] Entity could not be found in cache for entity_id: switch.0x00124b0019360934_l1
3 Jan 03:43:59 - [info] [server:9055ffae.cacf6] Connected to http://supervisor/core
3 Jan 03:45:32 - [info] Stopping modified flows
3 Jan 03:45:32 - [info] Stopped modified flows
3 Jan 03:45:32 - [info] Starting modified flows
3 Jan 03:45:32 - [info] Started modified flows

image

zachowj commented 1 year ago

Node-RED is not seeing that the NR companion custom component is setup in HA. If it was the status of the device nodes would say registered.

Leopoll commented 1 year ago

What to do? I didn't change anything. Some HA nodes are working now. image

zachowj commented 1 year ago

Most of the "Standard" nodes don't require the custom component. Check HA and make sure the custom component is still added.

In the Home Assistant UI go to "Configuration" -> "Integrations" and look for Node-RED.

If not, add it.

Step 5

https://github.com/zachowj/hass-node-red#hacs

Leopoll commented 1 year ago

Yes, it was missing. Thanks a lot. But what about 1.1.2 version? Why I can't update?

zachowj commented 1 year ago

Pretty sure it had nothing to do with version 1.1.2 but the add-on update. After you update make sure the "I use the add-on" is checked in the HA server config in NR.

Leopoll commented 1 year ago

Yes, it's not the version 1.1.2. Now updated only NR on 14.01. All nodes HA with errors. image image

zachowj commented 1 year ago

There should be an error in the debug window. What does it say?

Leopoll commented 1 year ago

Now it's empty. Last time was the "Error: Server config node not found"

zachowj commented 1 year ago

under the deploy button run "Restart all flows" and it should produce the error

Leopoll commented 1 year ago

Error: Invalid server config Error: Server config node not found

zachowj commented 1 year ago

If you open the nodes with error and select a server does the error go away?

Leopoll commented 1 year ago

No. Error doesn't go away

image

Leopoll commented 1 year ago

And the device node can't find any device. image

zachowj commented 1 year ago

Do you have more than one server config?

zachowj commented 1 year ago

The device node won't find any devices until it has a connection to HA

Leopoll commented 1 year ago

No, only one.

zachowj commented 1 year ago

Can you export your server config node and post it here?

Leopoll commented 1 year ago

[ { "id": "9055ffae.cacf6", "type": "server", "name": "", "version": 5, "addon": true, "rejectUnauthorizedCerts": true, "ha_boolean": "", "connectionDelay": false, "cacheJson": false, "heartbeat": false, "heartbeatInterval": "", "statusSeparator": "", "enableGlobalContextStore": true, "credentials": {} } ]

zachowj commented 1 year ago

Out of ideas at the moment. You could try creating a new server config and using that with an events state node and see if it connects.

Leopoll commented 1 year ago

Creating a new server was not helpfull. Now NR 11.1.1, NR Companion 1.1.2. All is working. Problem with NR 14.

avataru commented 1 year ago

No need to open another issue since it looks like I'm in a similar situation. I have HA 2022.12.8, NR 3.0.2, node-red-contrib-home-assistant-websocket 0.48.0 and NR Companion 1.1.2.

With "Using the Home Assistant Add-on" checked I get the following errors:

{"id":"c22a2efd1032de6a","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":false}

If I untick it and add set the base URL and access token it won't show any errors but won't see any entities on the get entities node so this option won't work either.

{"id":"c22a2efd1032de6a","type":"server","name":"Home Assistant","version":5,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":false}

Leopoll commented 1 year ago

I'm sorry. Something strange is happening. After rebooting the server (not only the HA, but the entire physical device), node-red-contrib-home-assistant-websocket disappears from the NR palette. Why?

rlust commented 1 year ago

I am having same issue. The devices I created in NR work some times then they are unavailable. Last issue was devices are there but no entities.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.