I seem to have an interesting problem with Singlestat. I’m selecting current values that range from -5000 to 5000 and the values get loaded and truncated to integers correctly. For positive numbers with decimal fractions, the guage shows correctly, but whenever the number goes negative and has decimal places the guage vanishes. The value is still correctly displayed, just no guage. The sql being used is as follows
SELECT
UNIX_TIMESTAMP(time_ts) as time_sec,
-floor(solar.PowerReal_P_Sum) as value,
“Power Usage” as metric
FROM solar
WHERE $__timeFilter(time_ts)
ORDER BY time_ts ASC
This is the fixed version that works for me. The differrence between this and the one that fails is that this one has the “floor” function to round the number. Without it on negative numbers the guage vanishes.
An example of some of the number I have been using are
-3197.869873046875
-3096.27001953125
-118.57999420166016
Regards,
Andrew