# ENTITY\_ID in a text string

**URL:** <https://discourse.nodered.org/t/entity-id-in-a-text-string/92482>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [18 October 2024 07:31 UTC](https://discourse.nodered.org/t/entity-id-in-a-text-string/92482 "2024-10-18T07:31:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fracrm](https://avatars.discourse-cdn.com/v4/letter/f/bc79bd/32.png) [@fracrm](https://discourse.nodered.org/u/fracrm)\
**Post date:** [18 October 2024 07:31 UTC](https://discourse.nodered.org/t/entity-id-in-a-text-string/92482/1 "2024-10-18T07:31:09Z")

</div>

Hi, I'm using node red for the first time. I am using the home assistant "current\_state" node and I would need to also include the entity\_id of the object that the node is processing in the msg\_payload. In particular I would like the msg.payload of the node to be:

{  
"data": {  
"deviceId": "vmalertdev",  
"text": "attention $entity\_id"  
}  
}

So I need to include in text the value of entity\_id processed by node "current state".  
Example: "text": "attention door\_sensor"

Thanks  
Franco

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 October 2024 07:54 UTC](https://discourse.nodered.org/t/entity-id-in-a-text-string/92482/2 "2024-10-18T07:54:20Z")

</div>

Your question is simple enough and the answer probably is too however, I have no idea what `$entity_id` is, where it comes from, or how you access it. I also have no idea what a "current\_state" node is or what it looks like. Unfortunately, not a lot of folk here use HA.

If you could show us what things look like and where/what this `$entity_id` is, I will probably be able to help - otherwise, you might get better luck on the HA forums.

* * *

PS: please use the forum tools for formatting data and flows in your posts.

#### Canned blurb:

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<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:** [16 January 2025 07:54 UTC](https://discourse.nodered.org/t/entity-id-in-a-text-string/92482/3 "2025-01-16T07:54:25Z")

</div>

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