# State node always displays first entity in list

**URL:** <https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060>\
**Category:** General\
**Tags:** home-assistant, node-red-contrib-home-assistant-websocket\
**Created:** [2 January 2023 12:30 UTC](https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060 "2023-01-02T12:30:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonM](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@SimonM](https://discourse.nodered.org/u/SimonM)\
**Post date:** [2 January 2023 12:30 UTC](https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060/1 "2023-01-02T12:30:19Z")

</div>

Hi all,  
I've an odd problem that I can't figure out.

For all of my state nodes, when re-editing them the entity dropdown is displaying the wrong entity it always shows the first available entity in the list. 😕 By all accounts, my flows work as expected but this issue is really frustrating, as I can't resolve it.

Fresh state node:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/3966f1a8b1dee06d63ca9f9b74da3c2ed51d9820.png)

Changing just the entity to any other available and deploying:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/d/9d1c75b905d4c804dc52965c6efdfad1037437fb.png)

_As I'm new I can only embed two images, so [please see first reply for third.](https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060/2)_

I've tried restarting my instance, multiple times. Uninstalling, clearing out any left over folders and reinstalling Node-Red fresh. Even rebuilding flows from scratch. Yet this same issues keeps occurring and from search and posting on Reddit and the Home Assistant forum, it appears to only affect my setup.

```auto
Node-Red v3.0.2
Home Assistant Community Add-on v14.0.0
Home Assistant 2022.12.8
Supervisor 2022.12.1
Operating System 9.4
Frontend 20221213.1 - latest
All nodes in palette on latest

```

Does anyone have any ideas on how to sort this out please?

Thanks,

Simon

---

<div class="post-metadata">

**Author:** ![SimonM](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@SimonM](https://discourse.nodered.org/u/SimonM)\
**Post date:** [2 January 2023 12:30 UTC](https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060/2 "2023-01-02T12:30:50Z")

</div>

_Third image._

Re-editing the same node and the dropdown is back to the first in the list, although note the auto name of the node (highlighted):

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/2/62948b3faf28e5227f2f856e355a39302749a0f9.png)

---

<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:** [2 January 2023 14:22 UTC](https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060/3 "2023-01-02T14:22:16Z")

</div>

It helps everyone if you could add the full node package name as a tag.

---

<div class="post-metadata">

**Author:** ![SimonM](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@SimonM](https://discourse.nodered.org/u/SimonM)\
**Post date:** [2 January 2023 16:31 UTC](https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060/4 "2023-01-02T16:31:33Z")

</div>

Apologies, I searched in the optional tags when I created the post, but no options for it are available.

```auto
node-red-contrib-home-assistant-websocket : server-state-changed

```

However, following your post I went checking and have since realised that the `events: state` node isn't a default one and is part of the Node-RED Companion Integration for Home Assistant. 🤦🏼‍♂️

---

<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:** [2 January 2023 17:30 UTC](https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060/5 "2023-01-02T17:30:28Z")

</div>

Which gives people a lot more to go on. Unfortunately, HA related help is quite limited in this forum because not many of the super-cool Node-RED experts in the forum actually use HA I'm afraid. So you might need to try to get some help in the HA forum.

---

<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:** [3 March 2023 17:30 UTC](https://discourse.nodered.org/t/state-node-always-displays-first-entity-in-list/73060/6 "2023-03-03T17:30:42Z")

</div>

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