One Value Not Graphing In Grafana

Hi all, I have a bunch of values that persist and graph in Grafana just fine. One value however is not. Here is what I have done to try to trouble shoot but have not figured it out…
I read this post here. I don’t have this in a group so don’t think that would be the issue.

The value is for my propane remaining…

Item

Number PropaneRemaining "Remaining [%.2f Gal]" <gas>

Persist File

PropaneRemaining: strategy = everyChange, restoreOnStartup

Rule - Dont know what happened to the code fences one this rule. Something went whacky…

// Rule to calculate remaining propane in tank

//var propane_quantity_start PropaneRemaining = 297

var Boolean emailSent = true
//Time cron “0 * * * * ?” //for debug
// Rule to calculate remaining propane in tank
rule “Propane Remaining”
when

Time cron  "0 59 23 1/1 * ? *"

then

logInfo("propane.remaining", "Propane remaining (before):"+PropaneRemaining.state )
logInfo("propane.remaining", "Propane daily usage:"+Propane_DailyUsage.state )
PropaneRemaining.postUpdate((PropaneRemaining.state as Number) - (Propane_DailyUsage.state as Number))
logInfo("propane.remaining", "Propane remaining (after):"+PropaneRemaining.state )

// if(PropaneRemaining.state < 40) {
// sendNotification(“sweetwaterurbanfarms@gmail.com”, “Propane is Low”)
// sendMail(“boilermanc@gmail.com”, “Propane”, “Propane is Low”)
// emailSent=false
// }
// else {
// emailSent=true
// }
end

In the syslog I see these type of entries for other items:

Dec  9 00:28:55 openHABianDevice influxd[566]: [httpd] 174.49.88.250, 174.49.88.250,::1 - openhab [09/Dec/2020:00:28:55 +0100] "GET /query?db=openhab_db&epoch=ms&q=SELECT+mean%28%22value%22%29+FROM+%22localCurrentTemperature%22+WHERE+time+%3E%3D+now%28%29+-+6h+GROUP+BY+time%281m%29+fill%28null%29 HTTP/1.1" 200 1063 "-" "Grafana/7.3.1" 239aeb31-39ad-11eb-93a8-b827eb78d7cb 24244

I assume that is posting the value into Grafana. I do not see that entry for the PropaneRemaning. However, the value shows up in my sitemap and updates appropriately as the propane is being used.

Grafana Query:

Object

request:Object
method:“GET”
url:“api/datasources/proxy/2/query”
params:Object
db:“openhab_db”
q:“SELECT mean(“value”) FROM “PropaneRemaining” WHERE time >= now() - 6h GROUP BY time(20s) fill(null)”
epoch:“ms”
data:null
precision:“ms”
hideFromInspector:false
response:Object
results:Array[1]
0:Object
statement_id:0

Interested to see what the thoughts are on this one.

thanks!

I would check if there are values stored in the DB.
You store them on “everyChange”. So it there is no change no values can be available during the timeframe “time >= now() - 6h”

Thanks @HaKuNa, I will check in the db. Good idea. So trying to think through that. If I have a value that shows up now on my site map, say 100, then it should be stored in the database in order for it to display or am I missing something there…

Sorry, continuing that thought. By the rule, it only updates that value once a day. So that would be the everychange. So it should be in there since it should update the value when it changes that one time a day. Just thinking out loud.

In any case, I will check the db but will be later today.

thanks!

But your query in grafana requests only values for the last 6 hours. Expand that to, let’s say 7 days.
If there is an entry once a day, you should have at least 6 datapoints.

Ahh that got it. What I guess I still dont understand is, if the value is being persisted then even if I query for the last 6 hours why would it not show up as what was in the database?

I am guessing there is a way in Grafana to have each panel query over a different time even though the dashboard is updating every 5 minutes but showing the last 6 hours.

thanks! getting there!

Because the entry in the DB is older than 6 hours.
But if you store only 1 record per day, a timerange of 6 hours does not make sense.
Select an appropriate timerange in Grafana and save the chart. Then this will be the default if you open it the next time.