I have Multi-state indicators setup…
0=Green
1=Red
But I’m also needing to change color for bad tag quality, say gray. How do I make this happen? I keep poking around and I’ve been unsuccessful. A bad/offline tag will not have a value so I can’t figure this out.
You can use the quality property of the tag, or more simply, the isGood expression function
Any good write-ups for this? I haven’t been able to find any. I think I’m close but it’s not quite working now I need it to.
If you want to be explicit, you can use binEnc
- binEnc(isGood({tag}), {tag})
. It’ll return an integer value that’s the binary complement of the booleans provided; so your truth table becomes:
Quality |
Tag |
Binary |
Integer |
bad (0) |
0 |
00 |
0 |
bad (0) |
1 |
01 |
1 |
good (1) |
0 |
10 |
2 |
good (1) |
1 |
11 |
3 |
Then you can explicitly specify the rendering in the style customizer for any of the possible states.
1 Like