I'm trying to show status for ZWave Locks and Alarm Sensors (doors/windows/garage doors) on the same panel.
The issue is:
Locks show onState of True when locked.
Door sensors show onState of False when the door is closed.
I'd like both of these to map to the same green color on the dashboard. Fortunately locks also have a a value of onOffState.ui which I can use instead of onState so I can map the onOffState.ui Locked of the lock to the same color as onState of False on the door sensors.
But I have a few other edge cases where this could be interesting. Does anybody know if there's a way to do this with Grafana transformations or with a case statement in the SQL query? I'm ok running separate queries for the locks vs the door sensors. I'd like to have both queries query against onState, and then transform one so True/Locked is the same as False/Closed for doors. I've read that grafana can support Case Statements in SQL but not with influxDb.
Thanks