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

Options to expose to HA as switches disappear in previously working nodes #26

Closed clandestine-avocado closed 4 years ago

clandestine-avocado commented 4 years ago

Version of the custom_component

Using v0.4.3

Configuration


Add your logs here.

Describe the bug

I had this installed via HACS, working well for months. One automation I had exposed ti HA became unavailable, so I began looking at the others I had exposed. When I open a node I can briefly see the boxes where I had named the switch and gave it an icon - then it disappears. I took a video of this behavior and can send that upon request if it helps.

Below you can see a card with all the exposed switches from NR - the grayed out lines are ones I have checked - once the node has been opened, the switch becomes unavailable in HA.

I ran the debug, logs below - and it says it creates switches for the ones I have not opened in NR.

image

Debug log


-------------------------------------------------------------------
nodered
Version: 0.4.3
This is a custom integration
If you have any issues with this you need to open an issue here:
https://github.com/zachowj/hass-node-red/issues
-------------------------------------------------------------------

2020-05-27 11:39:04 DEBUG (MainThread) [custom_components.nodered.discovery] Discovery message: {'type': 'nodered/discovery', 'server_id': 'b1cff34f.02b12', 'node_id': 'eb7e62ef.27845', 'component': 'switch', 'state': True, 'config': {'name': 'Kitchen Automation', 'icon': 'mdi:pistol'}, 'id': 10}
2020-05-27 11:39:05 INFO (MainThread) [custom_components.nodered.discovery] Creating switch b1cff34f.02b12 eb7e62ef.27845
2020-05-27 11:39:05 INFO (MainThread) [custom_components.nodered.websocket] Webhook created: uXa5dS7S8L6Rub5..
2020-05-27 11:39:05 INFO (MainThread) [custom_components.nodered.websocket] Webhook created: Pp98yiWaUmQRj74..
2020-05-27 11:39:05 DEBUG (MainThread) [custom_components.nodered.discovery] Discovery message: {'type': 'nodered/discovery', 'server_id': 'b1cff34f.02b12', 'node_id': '71e0ead5.d69c64', 'component': 'switch', 'state': True, 'config': {'name': 'Bedroom Automation', 'icon': 'mdi:pistol'}, 'id': 13}
2020-05-27 11:39:05 INFO (MainThread) [custom_components.nodered.discovery] Creating switch b1cff34f.02b12 71e0ead5.d69c64
2020-05-27 11:39:05 DEBUG (MainThread) [custom_components.nodered.discovery] Discovery message: {'type': 'nodered/discovery', 'server_id': 'b1cff34f.02b12', 'node_id': 'ea620998.df9958', 'component': 'switch', 'state': True, 'config': {'name': 'Master Bath Automation', 'icon': 'mdi:pistol'}, 'id': 14}
2020-05-27 11:39:05 INFO (MainThread) [custom_components.nodered.discovery] Creating switch b1cff34f.02b12 ea620998.df9958
2020-05-27 11:39:05 DEBUG (MainThread) [custom_components.nodered.discovery] Discovery message: {'type': 'nodered/discovery', 'server_id': 'b1cff34f.02b12', 'node_id': '50e4bfcc.e6629', 'component': 'switch', 'state': True, 'config': {'name': 'Bath Fan Automation', 'icon': 'mdi:pistol'}, 'id': 15}
2020-05-27 11:39:05 INFO (MainThread) [custom_components.nodered.discovery] Creating switch b1cff34f.02b12 50e4bfcc.e6629
2020-05-27 11:39:05 DEBUG (MainThread) [custom_components.nodered.discovery] Discovery message: {'type': 'nodered/discovery', 'server_id': 'b1cff34f.02b12', 'node_id': '9b927271.33e65', 'component': 'switch', 'state': True, 'config': {'name': 'Closet Automation', 'icon': 'mdi:pistol'}, 'id': 16}
2020-05-27 11:39:05 INFO (MainThread) [custom_components.nodered.discovery] Creating switch b1cff34f.02b12 9b927271.33e65
2020-05-27 11:39:05 INFO (MainThread) [custom_components.nodered.websocket] Webhook created: yPMF3vJy6QBwaoW..
zachowj commented 4 years ago

When you open one of the nodes in NR does it show the alert box about needing to install the custom component?

clandestine-avocado commented 4 years ago

@zachowj oddly, the nodes that I had previously exposed now DO show the option to expose them to HA - even the name and icon I had previously assigned are still there - all I had to do is recheck the box and they are now exposed to HA.

Yes, the alert RE: installing the custom component shows in the "Node Help" section. In this screen shot (of a Webhook node that I had NOT previously exposed to HA as a switch) you can see the alert in the Node Help section - but no option to expose to HA.

Webhook_missing_expose

Now, I'm sure this is a "me" problem - but under Server in NR, I have a list of seemingly duplicated servers - most named "Home Assistant", then one Hassio, and one Hass.io. mult_HA_servers

I had not messed with adding HA server since I set NR upa few months ago - so not sure why there is a long list of servers when I really only have one HA server. When I select a few of these servers, sometimes I get the alert box within the node config box like this:

mult_HA_servers_with error

zachowj commented 4 years ago

If you're importing other people's exported flows and you don't remove the imported server information this will happen.

https://bonani.tech/a-good-practice-when-sharing-node-red-flows-with-home-assistant-nodes/