ENTITY_ID in a text string

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

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 ```)

``` 
   code goes here 
```

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

See this post for more details - How to share code or flow json