zachowj / hass-node-red

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

Invalid warning message that custom integration needs to be installed #15

Closed declanshanaghy closed 4 years ago

declanshanaghy commented 4 years ago

Version of the custom_component:

v0.4.1

Describe the bug

I have some binary_sensors in my flows that generate the following warning message upon every deploy.

Node-RED custom integration needs to be installed in Home Assistant for this node to function correctly.

They all work fine, but this warning clutters the debug window.

See screenshot Within the screenshot 2 sensor nodes are visible. The warning is printed by one of them but not the other. There is also a warning from another sensor node that is off screen.

declanshanaghy commented 4 years ago

For some reason this warning has now stopped appearing for the sensors shown in that screenshot. However, it is now appearing for a new sensor I just added. It also appears to be preventing that sensor from setting it's state correctly.

steveneon commented 4 years ago

i have this issue as well same as above.

markozekic commented 4 years ago

Me too :-).

zachowj commented 4 years ago

@declanshanaghy @steveneon @markozekic What do you have your deploy method set to?

image

If the server config node has to reestablish connection every time you deploy this can cause the issue. Full will always restart the connection and Modified Flows will sometime restart the connection.

declanshanaghy commented 4 years ago

I had it set to Full. The issue isn't happening at the moment. I changed to Modified Nodes and will keep an eye out for it.

Thx

cjramseyer commented 4 years ago

I have this (v0.4.1) installed on two different instances of HA. One instance is showing the same error, though it has already been added through integrations. The other instance does not show this message. Both instances of HA have been restarted

Jpsy commented 4 years ago

I had dozens of these msgs on every deploy. Setting the deploy method to "Modified Nodes" solved the problem at hand. But shouldn't this warning be issued only if no connection could be established.

zachowj commented 4 years ago

@Jpsy When you do a Full Deploy it also reinitializes the configuration node which is the node that controls the connection to HA. When the HA nodes all reinitialize, the connection to HA could be in several different states. If it hasn't connected and read the HA config to check if the custom component has been installed you will get the error.

Jpsy commented 4 years ago

Thanks @zachowj, so this is basically a kind of race condition. Is there something I can do to change my config node so that the HA connection is reliably started first?

gitolicious commented 4 years ago

For me the message was shown when I added the HA component but ignored the last step:

In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Node-RED"

Just in case someone else stumbles upon the same...