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
Fra

You would need to use the $entities() variable to bring in other states or the $entity() to use the entity defined in the node.

So same as triggering entity use

$entity().entity_id

a differnt entity

$entities('sensor.xyz').entity_id