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

Hass-variables and node red #40

Open
Denrozh opened this issue Apr 30, 2020 · 3 comments
Open

Hass-variables and node red #40

Denrozh opened this issue Apr 30, 2020 · 3 comments

Comments

@Denrozh
Copy link

Denrozh commented Apr 30, 2020

Hello. I've tried to update/change a variables value and/or its attributes in node red with call service nod, but it doesn't work. Node configuration:
Server: Home Assistant
Domain: variable
Service: set_variable
Entity Id: variable.example_123
Data: { "value" : "{{Buterbrod}}"}
And... Debug: "Call-service API error. Error Message: extra keys not allowed @ data['entity_id']"
What should I do to make it work?

@mvereecken
Copy link

You should leave the entity_id field empty. I had the same issue.

@ianfretwell
Copy link

You should leave the entity_id field empty. I had the same issue.

(Hoping that you might still get a notification for this!)

So where is the variable actually specified then if you remove it from entity_id ? Can you give an actual example please?

Thanks!

@Ex0danify
Copy link

Ex0danify commented Jan 14, 2022

In my opinion this is a breaking bug!

It works if you call the service with the following data payload and an empty entity_id:

{    "variable" : <entity_id>
      "value": <value to set>
}

If you are able to set this yourself in your call (for example in a node-red flow), there is not much of a problem.

In my case I'm using the lovelace "custom:banner-card". This extension of lovelance allows you to define a tap action like follows:

- entity: variable.night_mode_active
    name: Night Mode
    value: mdi:weather-night
    color: black
    map_state:
      '0':
        action:
          service: variable.set_variable
          value: 1
        color: black
      '1':
        action:
          service: variable.set_variable
          value: 0
        color: yellow

In this case, the call is made with entity_id, with no way I could change that. Maybe that will also be a problem in other extension that use the action call with the entity_id supplied.

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

4 participants