I have borrowed from a couple posted pistons and merged together some features of each that I like for tiles and piston state. Now, however, I seem to be over my head and can’t figure out what seems it should be simple on its surface.
I want the piston state to show the level of the family room switch when it’s on, and 0 when it’s off. How do I work a simple “if” statement into this? Everything I’ve tried either breaks the range color function, returns on 0, returns a blank, or results in a java exception error.
‘[b, black | Level is currently][b, {rangeValue([Family Room Main Lights : level], ‘Green’, 25, ‘DarkOrange’, 75, ‘FireBrick’)} | ‘[Family Room Main Lights : level]’][b, black |%’
The version above works and color coding is correct. But if I try to put insert an “if” statement where the above is bolded, all I can manage to create are varying ranges of broken. I’ve tried:
[Family Room Main Lights : switch] == ‘on’ ? [Family Room Main Lights : level]"%" : ‘0’"%"
[Family Room Main Lights : switch] == ‘on’ ? [Family Room Main Lights : level] : ‘0’
And every combination of single and double quotes I can think of… what am I missing?
Thanks in advance for any help!