I have a problem using Home Assistant input_number and input_boolean variables in Function nodes.
I’m doing this in a Function Node : (to a input_number variable defined in configuration.yaml)
- var ha = global.get(‘homeassistant’);
- ha.homeAssistant.states[‘input_number.x’].state = 1;
- global.set(‘homeassistant’, ha);
Seen from the Context Tab in Home Assistant (under Global context) the variable value changes as expected, but an Event-state node (Server-Change-State) monitoring input_number.x do not react to the change.
If input_number.x values is altered using a Call-Service-Node (Api-Call-Service) instead, everything works fine.
What I need, is to be able to alter input_number and input_boolean variable values using a Function Node, instead of using a Call-Service-Node.
I’m running Node-Red on Home Assistant (Hassio) - all latest versions.
Any suggestions ?
Boja.