hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
513 stars 117 forks source link

Nodes get the state "DISABLED" and dont work anymore #1899

Open W-e-e-Z-e-l opened 6 days ago

W-e-e-Z-e-l commented 6 days ago

Problem/Motivation

Since the update to version 18.0, i have trouble with some nodes. It seems this happens only to newly created or recently edited nodes. These nodes dont work anymore and show the state "DISABLED" under itself in the editor.

Expected behavior

The nodes should work without "DISABLED" state.

Actual behavior

Some nodes dont work anymore.

Steps to reproduce

I suspect this happens only to newly created or recently altered nodes since the update to v18.0. So create a "events: state" node and configure e.g. a temperature sensor against it.

Proposed changes

I dont know what to write here...but ive found someone in the nodered forum with the same problem and the people there suspect the HA integration as the root cause: https://discourse.nodered.org/t/home-assistant-node-status-disabled/88858

dpgh947 commented 6 days ago

I just opened an issue which is the same problem I think - if you make use of "expose as" on nodes such as events-state to create a switch in HA that can be used to enable/disable the node, then when you edit a new node, it is now defaulting to the first switch in the list rather than "none".

https://github.com/hassio-addons/addon-node-red/issues/1900#issue-2368554934

W-e-e-Z-e-l commented 6 days ago

Oh, good hint! You are right! I didnt notice the "expose as" feature on the nodes...they were set to an entity i have in my environment, but after switching the "expose as" back to "none" the nodes works as expected. Great workaround at least for me :)

W-e-e-Z-e-l commented 5 days ago

Hmm, there is weird stuff happening around the "expose as" feature...even after manually switching back to "none" the feature set itself again to the first entity in the list after a while.

dpgh947 commented 5 days ago

It seems to need setting back to none every time you edit the node. What I think is happening is in the previous version of node red, the "none" was at the top of the pull down list, so if you hadn't set it explicitly, it picked none every time you edited. Now, none appears at the end of the list. So if you haven't explicitly set it, every time you edit the node, it is picking up the first entry, which is no longer "none". I am not seeing it changing by itself, but if I edit an existing node that used to be "none", it is picking the first entry every time. If you are going to save the node, you have to set it back to none every time. If you go back in to edit on a node you previously set to "none", it will display wrong, but if you don't save it, it's ok.

W-e-e-Z-e-l commented 5 days ago

Yep, seems like this. To get rid of the trouble of changing the "expose as" repeatedly, i created a virtual switch and named it "A". The "expose as" list is in alphabetical order. This should do the trick until the problem is permanently fixed.

dpgh947 commented 5 days ago

Neat work around. "none" is being explicitly put at the end of that list, wherever it is coming from - I created a switch called zzzz but "none" still came after it, so it is being added there deliberately somewhere. I am 90% sure it used to be at the top. I think that's what is breaking it.