# I do not succeed in changing input\_number in home assistant from Node-Red function node

**URL:** <https://discourse.nodered.org/t/i-do-not-succeed-in-changing-input-number-in-home-assistant-from-node-red-function-node/51435>\
**Category:** General\
**Tags:** http-request\
**Created:** [23 September 2021 10:30 UTC](https://discourse.nodered.org/t/i-do-not-succeed-in-changing-input-number-in-home-assistant-from-node-red-function-node/51435 "2021-09-23T10:30:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Herman](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@Herman](https://discourse.nodered.org/u/Herman)\
**Post date:** [23 September 2021 10:30 UTC](https://discourse.nodered.org/t/i-do-not-succeed-in-changing-input-number-in-home-assistant-from-node-red-function-node/51435/1 "2021-09-23T10:30:28Z")

</div>

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?](https://discourse.nodered.org/t/changing-state-of-input-number-in-function-node-is-it-possible/31724) but this could not solve my problem.

I tried this function:

```auto

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

```

and this one:

```auto

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

---

<div class="post-metadata">

**Author:** ![Herman](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@Herman](https://discourse.nodered.org/u/Herman)\
**Post date:** [25 September 2021 09:50 UTC](https://discourse.nodered.org/t/i-do-not-succeed-in-changing-input-number-in-home-assistant-from-node-red-function-node/51435/2 "2021-09-25T09:50:47Z")

</div>

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 ...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 November 2021 09:51 UTC](https://discourse.nodered.org/t/i-do-not-succeed-in-changing-input-number-in-home-assistant-from-node-red-function-node/51435/3 "2021-11-24T09:51:00Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
