Multiple references in Value Format field for text node

Hi,

I'm getting up to speed on passing payload value to a text node for my dashboard. Using the following provides a working LED indicator based on msg.color passed in to the Value format field:

<font color={{msg.color}} ><i class="fa fa-circle" style="font-size:24px;"></i></font>

What I would like to do is pass in a second value, say, msg.icon to change the icon type too, along with the color. In testing, it appears only the first mustached entry is parsed, so I tried to make a value that contained all of the HTML code and pass through that way:

  • Upstream node: msg.content = '<font... rest of stuff... >'
  • Value format for text node: {{msg.content}}

I'm new to the dashboard functionality, so is there a way to do it with the text node, or should I look at using another Dashboard node to accomplish?

Thanks in advance!

you pass the icon in via the icon field (not the value field) so it can use {{msg.icon}} or whatever you need.

Thanks for the reply, I don't see an icon field for the text node, just Label and Value format.

I'm using this style of HTML in the value format to have the Font Awesome icons via HTML. For instance I would use "fa-cog" for an non-operating state, then change it to "fa-cog fa-spin" to denote it's operational (spinning icon). I solved by creating my own template that mostly gets the same CSS as the text node, but was just looking for confirmation if only one attributes value can be submitted.

Correct you can only have one substitution. And yes also correct about no icon , sorry. I was thinking about button for some reason.

I was looking for same solution to visually indicate a condition like door open/closed.
I think it would be good to be able to alternate icons in the Text node config like I can text colour (as per my example Value string below) rather than resorting to creating a template.
<font color={{(msg.payload?"red":"grey")}}>