Hass-variables and node red
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?
You should leave the entity_id field empty. I had the same issue.
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!
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.