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 #1700

Closed
wolfcam opened this issue Dec 2, 2024 · 3 comments
Closed

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

wolfcam opened this issue Dec 2, 2024 · 3 comments

Comments

@wolfcam
Copy link

wolfcam commented Dec 2, 2024

Describe the bug

In action Node if switch_turn_on is set in action field there's no more interface to set target even in last version. This happens in NodeRed and HA UI.

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

image image

Example Flow

No response

Environment Information

node-red-contrib-home-assistant-websocket 0.74.2
homeassistant:
Core
2024.11.3
Supervisor
2024.11.4
Operating System
13.2
Frontend
20241106.2

Additional context

No response

@zachowj
Copy link
Owner

zachowj commented Dec 31, 2024

Did you try restarting Home Assistant?

You can use this flow to verify if Home Assistant is correctly loading the switch data:

image

[{"id":"2c0ae0c533d34cf6","type":"ha-api","z":"c89d915bdff0f798","name":"get services","server":"","version":1,"debugenabled":false,"protocol":"websocket","method":"get","path":"","data":"{\"type\": \"get_services\"}","dataType":"jsonata","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":498,"y":976,"wires":[["56897320f296595c"]]},{"id":"2dea4a0a42104480","type":"inject","z":"c89d915bdff0f798","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":330,"y":976,"wires":[["2c0ae0c533d34cf6"]]},{"id":"56897320f296595c","type":"debug","z":"c89d915bdff0f798","name":"print switch.turn_on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.switch.turn_on","targetType":"jsonata","statusVal":"","statusType":"auto","x":714,"y":976,"wires":[]}]

The action node can only display the data supplied by Home Assistant. In this case, Home Assistant isn't providing all the required information. Specifically, there should be a target property loaded directly from the services.yaml file in Home Assistant:

https://github.com/home-assistant/core/blob/dev/homeassistant/components/switch/services.yaml

@wolfcam
Copy link
Author

wolfcam commented Dec 31, 2024

Yes, i tried several times to restart after some updates, but i had same error. Using the flow that you sent, i received this error:

12/31/2024, 8:31:35 AMnó: get services
msg : error
"Error: Invalid server config"

Trying to understand where this error was produced.

UPDATE:

I fixed the server connection from imported flow, but now HA showing:

msg : Object
object
name: "Turn on"
description: "Turns a switch on."
fields: object
empty

@wolfcam
Copy link
Author

wolfcam commented Dec 31, 2024

After the last update (2024.12.5), the issue has gone.

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

2 participants