rogro82 / hass-variables

Home Assistant variables component
238 stars 58 forks source link

How to update via Node Red? #17

Closed Swiftnesses closed 5 years ago

Swiftnesses commented 5 years ago

Hi,

Thank you for these excellent component, I've made some variables and would like to update / read them from Node Red, do you know if / how this is possible?

When I search for entities via Node Red it doesn't seem to locate them (all other components with entities seem to work okay...?).

Many thanks in advance,

Mark

Swiftnesses commented 5 years ago

Needed to reboot Node Red, sorted!

Swiftnesses commented 5 years ago

Spoke too soon, trying to set a state value results in:

"Error call service, home assistant api error. Error Message: Invalid format"

Can anyone offer some advice with regards what format (JSON) I need to send to update the variable?

Swiftnesses commented 5 years ago

Sorted, example JSON to use in the service card:

{ "variable": "test_variable_1", "value": "33" }