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!