I want to have a % display of how full my water tank is.
the sensor measures in ohms from 0 to 246.
On a dashboard i would like to see 0% (empty) through to 100% (full) at 1 % intervals.
I want to show this on a gauge, and also on a timeline so we can see how much water is being used when.
I assumed i would be able to use something in Value Mapping, but i cant see how i could make that work there… is there something within the query that needs to be added?
thanks for the super fast response. I tried what you said but im not getting the correct value. The value in the dashboard is 2.48.
The current ohm value is 2.478027344
It looks like the output is a truncated version of the ohm value?
ps. You do have to change r.column01 and r.column02 with your own fields/colums
I wasn’t sure for what values you wanted to calc. percentage so I used those for the example
So in your case something like?
|> map(fn: (r) => ({ r with "Percentage ( % )" : float(v: r["_field"]) / float(v: r["_measurement"]) * 100.0 }))
Hi, I don’t think it’s a decimal issue.
The original (ohm) value is 2.48, the percentage for this should be around 8% i think, given the full range is 0-246.
I’m not getting the 8% though. Did I amend the query correctly?