I have edited the customColors section of a Dashboard's JSON to customize tile colors for "variable-string" tiles.
Here are the entries I use:
"customColors": [
{
"template": "variable-string",
"bgColor": "rgb(239,15,127)",
"iconColor": "rgba(0,0,0,1.0)",
"state": "ALARM"
},
{
"template": "variable-string",
"bgColor": "rgb(21,162,42)",
"iconColor": "rgba(255,255,255,1.0)",
"state": "OK"
},
{
"template": "variable-string",
"bgColor": "rgba(55,55,55,0.64)",
"iconColor": "rgba(255,100,100,1.0)",
"state": "default"
},
The first two entries by themselves (without the third) yield the desired colors when the string variable is equal to "OK" or "ALARM".
However, when I add the third, "default" entry to the JSON it seems to negate the other two entries, so that the tile always displays with the "default" colors, even when the variable equals "OK" or "ALARM".
If I remove the third entry, string values other than "OK" and "ALARM" will simply display as white on black. I want my "default" entry to override this white on black behavior for those other values, while still keeping the two custom colors for "OK" and "ALARM"
Is there a way to achieve this that does not involve CSS?