Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action node has no target if switch.turn_on is chosen #1648

Closed
Vartkat opened this issue Oct 14, 2024 · 11 comments
Closed

Action node has no target if switch.turn_on is chosen #1648

Vartkat opened this issue Oct 14, 2024 · 11 comments

Comments

@Vartkat
Copy link

Vartkat commented Oct 14, 2024

Describe the bug

In action Node if switch_turn_on is set in action field there's no more interface to set target

To Reproduce

Drag an action node,
Open and choose switch.turn_on as action
The target field disappears

Expected behavior

I was hoping to keep the target :-)

Screenshots

Before :
image
After :
image

Example Flow

not necessary

Environment Information

Version: 0.74.1

Home Assistant version: 2024.10.2
Companion version: 4.1.1

Node-RED version: 4.0.3
Docker: yes
Add-on: 18.1.1

Node.js version: v18.20.4 arm linux
OS: Linux 6.1.0-26-arm64 arm

Additional context

Home Assistant
Core 2024.10.2
Supervisor 2024.10.0
Operating System
Interface utilisateur 20241002.3
Node-RED
Current version: 18.1.1

@zachowj
Copy link
Owner

zachowj commented Oct 14, 2024

Try accessing the Node-RED UI via port 1880 and not through the Home Assistant UI

@juansahome
Copy link

juansahome commented Oct 14, 2024

I have the same issue. Few days ago I create a new flow and no issue, now the option is missing (and also the layout changed).

On existing nodes now there is the following error message: "Entity ID 'media_player.xxx' should be in the data property, not the target property, for the selected action"

@zachowj
Copy link
Owner

zachowj commented Oct 14, 2024

@juansahome Based on the error, it looks like the action you're using expects the entity_id to be placed in the data field rather than the target field. That's why you're not seeing the target field displayed.

@juansahome
Copy link

I understand what you're saying, but before (last 3 years was working correctly).

Also, when you're trying to create now an action node, no option to select any Data or Entity ID:

image

@zachowj
Copy link
Owner

zachowj commented Oct 14, 2024

@juansahome

This change was introduced in version 0.66.0, as the properties were previously handled incorrectly. The update aligns the schema with Home Assistant’s behavior. If you build the same action in Home Assistant and switch to YAML mode, you'll see that these properties are correctly placed under the data property.

In version 0.66.0, actions with entity IDs incorrectly placed in target.entity_id instead of data.entity_id will now throw errors.

{
  "message": "Prueba",
  "entity_id": "media_player.xxx"
}

@Vartkat
Copy link
Author

Vartkat commented Oct 15, 2024

Being aligned with Home Assistant doesn't prevent from offering a nice UI. As you can change the interface on the fly, if it's switch domain you can do the same + button as entities but name it Data or think of something more user friendly than having to find the entity id and write it in a JSON. No ?

@juansahome
Copy link

I agree with @Vartkat

Being aligned and correcting an incorrect handling of the frontend interface, doesn't prevent to disable it, but to allow only the correct settings - as it's being done with other actions (such as the input_boolean.toogle that only allows boolean entities) - as currently the tts.google_translate_say cannot be created/corrected from the interface, so for me that's an issue - and the workaround - if the user wants to only use the fronted / interface - is to use the editor.

@inguy24
Copy link

inguy24 commented Oct 17, 2024

I have to agree with @Vartkat and @juansahome as well. Although I completely understand the need to mirror the HA standards, I think they screwed the pooch on this one. It makes it difficult to easily select targets as I have to go to my lists of entities instead of just starting to type one in the target field and have it autocomplete. Perhaps this needs raised with HA as well as to why they seem to deviate from their other actions that would still have targets? This really does create problems where I am already passing a good deal of information via the msg.payload function for the data,data field but now would need to hard code in my entities in functions as opposed to just quickly placing them in the target field of the action node.

@zachowj
Copy link
Owner

zachowj commented Oct 26, 2024

fixed in https://github.com/zachowj/node-red-contrib-home-assistant-websocket/releases/tag/v0.74.2

@zachowj zachowj closed this as completed Oct 26, 2024
@hatch01
Copy link

hatch01 commented Nov 13, 2024

I am not sure, but this does not seem to fix this issue in the 0.74.2.
I have this version and still cannot see any field in the web ui to select the targets when using something like switch.turn_on.

@zachowj
Copy link
Owner

zachowj commented Nov 15, 2024

@hatch01 Please create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants