hassio-addons / addon-node-red

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

Call service node can no longer be configured with blank data field #1802

Closed dpgh947 closed 8 months ago

dpgh947 commented 8 months ago

Problem/Motivation

I don't know when this problem was introduced, because everything already existing works ok, I only spotted it today when I edited an existing call service node that does a simple turn_off of a switch (I was actually updating the entity name).

Expected behavior

Having data field blank should not be flagged as a config error.

Actual behavior

When editing an existing node, or creating a new one now, for example to turn a switch or light on or off, the data field being blank is now being flagged as an error with the box marked red, and if you save the node it has an orange triangle against it. It will then not deploy without additional confirmation. The node seems to work, the triangle remains, but if node red is restarted the triangle goes away. The call seems to work ok, but trying to edit the node again brings the error back. Putting "{}" in the field seems to bypass the problem.

Steps to reproduce

Create a new service call node to turn a light on or off, or simply edit an existing (working) node, with a blank data field.

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix, describe the rationale behind it)

VOSsec commented 8 months ago

https://github.com/hassio-addons/addon-node-red/assets/129999011/4f8978e9-4818-476b-b189-d0b0e9c76402

Unfortunately I have the same problem. When I create a call service (no matter which one), it requires a data code (json) every time. If I leave the data code empty, I get an API error when executed.

VagnPetersen commented 8 months ago

Same problem here :(

casperklein commented 8 months ago

After updating from 16.0.2 to 17.0.2 I experience the same problem. The error message is:

[error] [api-call-service:TV: Source Live TV] HomeAssistantError: required key not provided @ data['source']

Restoring the 16.0.2 backup fixes the issue for now.

Edit: Might related to/duplicate of #1789

VOSsec commented 8 months ago

Hello everyone, in order to fix the error, the node "node-red-contrib-home-assistant-websocket" needs to be updated.

Go to the Node-Red main menu "Manage Palette" / "Installed Nodes" search for "node-red-contrib-home-assistant-websocket" and click on "Install Update". Restart the Node-Red addon and now it works again .☺️

Home Assistant 2024.1.3 Node Red Addon 17.0.3

Bildschirmfoto 2024-01-18 um 08 11 30
VagnPetersen commented 8 months ago

Works fine now. Thanks a lot!

dpgh947 commented 8 months ago

Great, thanks.

frenck commented 8 months ago

Hello everyone, in order to fix the error, the node "node-red-contrib-home-assistant-websocket" needs to be updated.

Go to the Node-Red main menu "Manage Palette" / "Installed Nodes" search for "node-red-contrib-home-assistant-websocket" and click on "Install Update". Restart the Node-Red addon and now it works again .☺️

Please don't manually manage and install the node. Instead, let the add-on handle it. The add-on ships a compatible version built-in. If you install it manually, you will run into stuff like his.

../Frenck

tamueller commented 8 months ago

@frenck : can you please elaborate which add-on would handle this? I had to install those palettes myself, because they were simply not there - so how could I automate this by letting an add-on do it?