zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
460 stars 182 forks source link

Possible to use variables from msg for name? #60

Closed clarkd closed 3 years ago

clarkd commented 3 years ago

Version of the custom_component

Latest

Describe the question

Is it possible to use a variable for the name of the entity, e.g. {{msg.payload.name}}?

I'm trying to create multiple sensors based on a JSON payload. The JSON is like this:

{
    "data": [{id: 123, name: Alpha}, {id: 456, name: Beta}]
}

I want a sensor for each item in the array, so have used a split node to send multiple messages.

image

For some reason it does not seem to accept a varaiable name.

Any advice?

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.