Wanting to confirm how a dashboard button is supposed to work

I'm helping someone and feel it is a valid question:

original thread

And I see that others are posting helpful examples:

like this one.

But I'd like to raise the question:

@mariulin was wanting to change the colour of the switch node with a message property.
I tried and after a bit of trying, I believe it can only be set with direct colour names entered where it has the fields to enter the colour/s.

Screenshot from 2020-10-06 08-35-27

So as to be sure:
1 - can you use msg.(something) to set the colours?
2 - can you enter RGB values like: #e6d00b?

Or are you limited to colour names? (eg: red pink yellow etc)

  1. No - you can't use variables in there
  2. Yes - you can use any valid html5 value - so name rgb or hex.
1 Like

Not urgently, but could you pass that onto @mariulin so he too knows.

I have branched out and replaced the switch with the button node.

:thinking: however, in my button change example it is possible:
you have to inject:

node.send({ui_control:{onicon:"fa-3x fa-lightbulb-o",oncolor:"#e6d00b"},label:"on",payload:true});

and this one to change icon, color ... :

node.send({ui_control:{officon:"fa-2x fa-lightbulb-o",offcolor:"grey"},label:"off",payload:false});

to a Switch node , and put variables in :


optionnal : {{msg.label}}

@Trying_to_learn did you try this example ?
What makes this work ? @dceejay says it's not possible? magic? lol

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