I have a value tile that shows if a door is “open” or “closed”. I would like the tile background color to change based on the value: open or closed. The below code is from the smartthings docs. However, my values are strings not integers. Any help how I can adapt this, or some other method, to change background colors based on string values?
valueTile("temperature", "device.temperature", width: 2, height: 2) {
state("temperature", label:'${currentValue}', unit:"dF",
backgroundColors:[
[value: 31, color: "#153591"],
[value: 44, color: "#1e9cbb"],
[value: 59, color: "#90d2a7"],
[value: 74, color: "#44b621"],
[value: 84, color: "#f1d801"],
[value: 95, color: "#d04e00"],
[value: 96, color: "#bc2323"]
]
)
}
Thanks!