node-red-contrib-home-assistant icon indicating copy to clipboard operation
node-red-contrib-home-assistant copied to clipboard

Entity ID is a required field on current state node, but shouldn't be

Open ConnorGriffin opened this issue 6 years ago • 2 comments

Describe the bug The current state node accepts an entity ID input (msg.payload.entity_id), which is used to make the service call. You can override this by proving an entity_id in the Entity ID field, which is a required field. If a valid entity_id is not provided in this field, the node will have a red triangle, indicating that it is not configured properly. In addition, a popup will appear every time the flow is deployed, stating that "The workspace contains some nodes that are not properly configured."

To Reproduce Steps to reproduce the behavior:

  1. Drop in a current state node
  2. Leave the Entity ID field empty
  3. Configure your flow to feed an entity_id to the current state node's input, which will make the node get that entity's current state
  4. Attempt to deploy the flow, you will receive an error message stating that the node is not configured properly

Expected behavior I don't believe Entity ID should be a required field because the node accepts entity_id on the input side. If possible, the Entity ID field should only be required if there is nothing connected to the node's input. I don't know if this is possible with Node-RED.

Environment (please complete the following information):

  • Node Red Version: 0.18.4
  • NR Home Assistant Plugin Version: 0.3.2
  • Is Node Red running in Docker: yes

Other (please complete the following information):

  • Have you searched previous issues for duplicates?: yes
  • Did you attempt to reproduce the issue in the dev docker environment, if so what were results (See README.md):

ConnorGriffin avatar May 20 '18 04:05 ConnorGriffin

#17 seems to be a similar issue. I suppose the workaround is to supply an entity that you don't actually actually care about in the Entity ID field. That doesn't seem like a great solution though.

ConnorGriffin avatar May 20 '18 04:05 ConnorGriffin

Simply put '{}' in the field and you should be good to go as long as you are providing the entity_id in the payload.

hink avatar Jul 11 '18 18:07 hink