hassio-addons/addon-node-red

Node-RED does not update auto-complete data for entity ids #407

Jpsy posted onGitHub

Problem/Motivation

The Entity Id fields in several HA nodes provide an auto-complete feature that does a speed-match against all known HA entities while typing into the field. But there seems to be a problem to update the entities list that is used for this match.

Expected behavior

When entities are added / remove / renamed in HA, these changes should reflect in the Node-RED auto-complete.

Actual behavior

Node-RED continues to use old and outdated entity Ids to do the speed match. This behavior has been described by several users. Some examples: https://www.reddit.com/r/homeassistant/comments/ad2kb3/when_you_change_entity_names_how_do_you_refresh/ https://community.home-assistant.io/t/node-red-auto-complete-not-working/122901/2

Restarting Node-RED or HA or the whole system does not update the entities either.

Workaround: A re-sync of the entities list can be forced by starting the Node-RED add-on without Protection mode. This results in an updated entities id list and auto-complete is up-to-date again. <strike>Switching on Protection mode freezes the list again so that it out-dates again over time.</strike>

Steps to reproduce

  • Hass.io with some entities and Node-RED installed
  • Change / add / remove some entities in HA
  • Check Node-RED auto-complete again to see that auto-complete has not updated it's entity id list.

Proposed changes

Update entities list in Node-RED at least with each new start of HA or of Node-RED. This should happen in the same way as it does with Protection mode switched on.

<blockquote><img src="https://www.redditstatic.com/new-icon.png" width="48" align="right"><div><img src="//www.redditstatic.com/desktop2x/img/favicon/favicon-16x16.png" height="14"> reddit</div><div><strong><a href="https://www.reddit.com/r/homeassistant/comments/ad2kb3/when_you_change_entity_names_how_do_you_refresh/">When you change entity names, how do you refresh them in Node-Red?</a></strong></div><div>A regular restart of HA doesn't seem to do it. Do you need to restart the Node-Red docker or is there a way inside node-red to re-read the Home...</div></blockquote> <blockquote><img src="https://community.home-assistant.io/user_avatar/community.home-assistant.io/fxcoolby/200/68424_2.png" width="48" align="right"><div><img src="https://community-home-assistant-assets.s3.dualstack.us-west-2.amazonaws.com/optimized/3X/f/4/f42b82971fce994297fbc2b269efa248beef897b_2_32x32.png" height="14"> Home Assistant Community</div><div><strong><a href="https://community.home-assistant.io/t/node-red-auto-complete-not-working/122901/2">Node-RED auto-complete not working</a></strong></div><div>Have you tried to look into the logs, both for your HA and Node Red addon? This is not normal.</div></blockquote>


:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be usefull.

posted by addons-assistant[bot] over 5 years ago

Is the behaviour altered when you disable the caching on the server properties in Node Red? I personally don't understand the link with the Protection mode of the addon itself.

posted by sinclairpaul over 5 years ago

Sorry, but I'm not sure how protection mode can be enabled? Are we talking about the protection mode switch on the add-on configuration page here? (Inside the Hass.io panel)? Or a specific Node-RED feature?

posted by frenck over 5 years ago

Yes, I am talking about the Protection Mode switch in the Hass.io add-on settings. This workaround was mentioned in the second of the two links in my posting. It worked for me as it did for the poster in that thread.

posted by Jpsy over 5 years ago

@sinclairpaul where do I find these server properties? I am not aware of that caching mode.

posted by Jpsy over 5 years ago

Open an HA node click the pencil by the server name image

You may want to validate delay connection attempts is set as well

image

posted by sinclairpaul over 5 years ago

For the record, the add-on does not use anything related to the protection switch, so the switch does not change or adjust anything, so that makes no sense. (The protection switch allows access to the docker socket for example, which node-red doesn't use and not even requests).

posted by frenck over 5 years ago

I checked the details again and found that after switching protection mode off, the sync starts to work and KEEPS WORKING when I switch protection mode on again. This was stated incorrectly in my original issue posting and I have corrected the text now.

Bottomline: This seems to be a one time effect / problem that can be solved by switching Protection off and on again. As others have witnessed this too, I am quite sure that there is a basic issue behind this. But it might be connected with the history of the NodeRed add-on and might not affect new users. So I propose that this issue can be closed, but the problem should be kept in mind in case it should happen resurface.

@frenck : Please believe me that I have worked with the NodeRed add-on with outdated entity ids for MONTHS. Only when I discovered the workaround in the links I was able to get the sync of entity ids working again.

@sinclairpaul : I would love to try your suggestion, but as my system syncs again now, I cannot test your proposal.

posted by Jpsy over 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

posted by addons-assistant[bot] about 5 years ago

Fund this Issue

$0.00
Funded

Pull requests