I do not succeed in changing input_number in home assistant from Node-Red function node

Hi, I do not succeed in changing an input_number in home assistant using a Node-Red function. I had a look at Changing state of input_number in Function Node - is it possible? but this could not solve my problem.

I tried this function:


global.get('homeassistant').homeAssistant.states['input_number.test'].state = "12";
return msg;

and this one:


var ha = global.get("homeassistant");
ha.homeAssistant.states["input_number.test"].state = 6;
global.set("homeassistant", ha);
return msg;

but the input_number remains unchanged in the Home Assistant Lovelace interface.

Does anyone has an idea what might be the problem?

thanks in advance
Herman

Some more info: the states from HA are read correctly in the function (initialized it at 80) in the HA Lovelace interface and the state of input_number.test is changed correctly in the function to 6, but the state of input_number.test remains at 80 in the HA Lovelace interface ...