Hi, I set up rrd4j charting with OH2 on raspberry pi
I can chart sensor data which is coming to oh via mqtt.
but when I calculate a new item in OH rule, the new Item can not be charted.
my Item is like this:
val edw = [ t |
var denominator = 240.97 + t
var numerator = 17.502 + t
var exponent = numerator / denominator
var pow = Math.pow(Math.E, exponent)
return 6.112 * pow
]
val Number t2Var = t2.state as Number
val Number t1Var = t1.state as Number
val ed44 = edw.apply(t2Var)
val ew44 = edw.apply(t1Var)
val numeratora = 1 + .00115*ew44
val numeratorb = ed44-ew44
val numerator = edw44 - 0.6687451584 * numeratora * numeratorb
val div = numerator / ed44
h4.postUpdate(div * 100)
The command I gave must be issued on the (Karaf) console.
Since you don’t know that, please get your basics right before asking for help.
It’s all in the docs so go read those next.
it is persisting @rossko57
I deleted rrd file and it generates again, but same result and also change the rule and change type to number and delete rrd file again, same thing happes, t1 appears but not the calculated one:
rule "cadd4dd"
when
Time cron "0 0/1 * 1/1 * ? *"
then
ex1 = (17.502 * t3.state as Number) / (240.97 + t3.state as Number)
ed444 = 6.112 * Math.pow(Math.E, ex1)
ex2 = (17.502 * t1.state as Number) / (240.97 + t1.state as Number)
ew444 = 6.112 * Math.pow(Math.E, ex2)
minus = (t3.state as Number - t1.state as Number)
part1 = 1+0.00115*t1.state as Number
h4.sendCommand((((ew444 - 0.6687451584 * (part1) * (minus)) / ed444)) * 100)
end
and about the memory, i disable the log to extend my sd card age!
Out of curiosity, I check HABMin panel for charting! when selecting item to chart, there is no h4 in there, but t1 exists!
the only difference between the two is the way they created, t1 is created via paperUI and h4 is defined in item file.
so, I add an item via paperui for calculating humidity to see if it works or not.
when I create new item in paperui, and calculate humidity via rule file.
now charting works!
but strangely, new item can not be shown in sitemap!
I mean the value doesnt show up in sitemap:
Text item=h4 icon="humidity" label="humidty"
I can postUpdate two items for charting and showing them, no problem here. but it is strange!