# Change state of entities

**URL:** <https://discourse.nodered.org/t/change-state-of-entities/77220>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [3 April 2023 23:26 UTC](https://discourse.nodered.org/t/change-state-of-entities/77220 "2023-04-03T23:26:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhysgh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rhysgh/32/74195_2.png) [@Rhysgh](https://discourse.nodered.org/u/Rhysgh)\
**Post date:** [3 April 2023 23:26 UTC](https://discourse.nodered.org/t/change-state-of-entities/77220/1 "2023-04-03T23:26:27Z")

</div>

Hi, I'm using node-red in home assistant.

Il trying to change the state of entities but I'm not getting it..

.. how would you do this?

````auto
  "battery_working_mode": "Time Of Use"``

i asked my mate chat gbt but hes got his knickers in a twist

he's telling me this ```{
  "options": {
    "battery_excess_pv_energy_use_in_tou": {
      "value": "Fed to grid"
    },
    "battery_working_mode": {
      "value": "Time Of Use"
    }
  }
}

````

Drag a call service node from the palette onto your flow and double-click on it to open the configuration window.

Select the Home Assistant server you want to connect to from the "Server" dropdown list.

Choose the appropriate domain and service that correspond to the entity you want to modify. In this case, you would need to choose the select domain and the set\_options service.

`

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 April 2023 00:38 UTC](https://discourse.nodered.org/t/change-state-of-entities/77220/2 "2023-04-04T00:38:53Z")

</div>

> [@Rhysgh](#):
>
> .. how would you do this?

It really isn't clear what "this" means in your context. You will need to give a more complete example of what you are trying to do.

Taking a stab in the dark, if you had a msg with:

```auto
{
    "payload": {
        "battery_working_mode": "something"
    }
}

```

And you wanted to change that to a different mode, you could use a change node:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/94f110f4d2877fc72c8d7a5205c60e7eb4cdd5da.png)

---

<div class="post-metadata">

**Author:** ![Rhysgh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rhysgh/32/74195_2.png) [@Rhysgh](https://discourse.nodered.org/u/Rhysgh)\
**Post date:** [4 April 2023 04:42 UTC](https://discourse.nodered.org/t/change-state-of-entities/77220/3 "2023-04-04T04:42:02Z")

</div>

I'm sorry.

I'm using node red in home assistant.

I'm trying to change the state of entities.

Just realised that I don't actually have the entity listed there I have the friendly name.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 April 2023 08:41 UTC](https://discourse.nodered.org/t/change-state-of-entities/77220/4 "2023-04-04T08:41:18Z")

</div>

> [@Rhysgh](#):
>
> change the state of entities

Sorry, we are still missing the context - on its own, that could mean anything.

---

<div class="post-metadata">

**Author:** ![Rhysgh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rhysgh/32/74195_2.png) [@Rhysgh](https://discourse.nodered.org/u/Rhysgh)\
**Post date:** [20 April 2023 14:41 UTC](https://discourse.nodered.org/t/change-state-of-entities/77220/5 "2023-04-20T14:41:14Z")

</div>

Sorry, I didn't know how else to say it.. this is the solution.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/767cdb2b792374054a5aae14059604dea4b61d0b.png)

---

<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:** [4 May 2023 14:41 UTC](https://discourse.nodered.org/t/change-state-of-entities/77220/6 "2023-05-04T14:41:54Z")

</div>

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