Charts

I have strange problem with default charts. I use rrd4j db with strategy every minute and restore on startup for all items which I need a chart.
One chart is for switch, which represents heating on /off, which is fine:

It is simpe 1 or 0, but on second chart I have two items: current temperature (red) and heating setpoint (green):

Problems are those triangles :smile:
This item is twice a day changed on particular time from night temp and day temp + can be change if I changes it from GUI. Except one day when I changed it other days should reach just two values, why is it extrapolated ?

Can I changed it ?
Is it any other simple way to generate charts, but viewable on mobile devices ?

Extrapolation is how rrd4j works. It didn’t save every value. Instead it saves the average over a certain time period. I’m not certain that is the problem here but it would not surprise me if it were.

Rich, but it has no sense, look, on both charts. On this above is one item (Grzanie) which is registered exactly in same time as green line on second chart. So usually when red is “1” (heater is on), green is 20.7C (daily temp), when red is “0”, green is 19.5C (night temp). Red is not interpolated, but green it is (same frequency of change, same time).
I think it is a problem in charting algorithm and it is due to second line on this chart, but this just my thinking … as I understand I don’t have any influence on it, am I right ?
Do you know other, easy to use chart methods, which can be use on mobile ?

Thanks for reply !

How does that item look if you chart it by itself?

It looks same, but I found that my log file (events.log) doesnt log this var.
Probable, because I just used following assignment (twice per day):
Heating_setpoint.state = Heating_setpoint_Night.state as DecimalType
but for others (which I add later) I started use postupdate.
Can it reflect on persistence ?

I will change it and see the results.

Yes, you must make state changes to an Item using sendCommand or postUpdate. Just setting an Item’s state using “=” will not propagate through the event bus to the rest of the system.

ok I see.

I have changed it, so now I am able to see values in a log, but still no change on chart :frowning:.
Same triangles, on chart with temperature and on chart with only set points.

For some reason it is acting like there are only a few data points to graph instead of the one per minute which it should be. But with rrd4j charting usually doesn’t work at all if you don’t store once per minute. So I have no idea what is going on. The only recommendation I can make is try a different DB and see if that helps.

I generated separate charts and result is same.
Config is simple:
Items:

Number Heating_setpoint_Day    "Zadana temperatura dzień [%.2f °C]" <temperature> (Temp_Chart)
Number Heating_setpoint_Night "Zadana temperatura noc [%.2f °C]" <temperature> (Temp_Chart)
Number Heating_setpoint "Temp zadana" <temperature> (Temp_Chart)

Rules:

rule "Enabling heating"
when    
    Time cron "0 0 4 * * ?" or
    Time cron "0 0 14 * * ?"
then    
    if (hvacMode.state.toString == "Auto") {
    postUpdate(Heating_setpoint, Heating_setpoint_Day.state as DecimalType)
    }
    
end
rule "Disabling heating"
when    
    Time cron "0 0 10 * * ?" or
    Time cron "0 0 19 * * ?"
then    
    if (hvacMode.state.toString == "Auto") {
    postUpdate(Heating_setpoint, Heating_setpoint_Night.state as DecimalType)    
    }
end

So its a simple assignment 4 times per day. Of course both day and night temp are editable via GUI, but lets say I’m not touching them.

Persistance (rrd):

Strategies {
everyMinute : “0 * * * * ?”
}

Items {
Temp*, Grzanie, Heating_setpoint, Heater_Counter_Week, Heating_setpoint_Day, Heating_setpoint_Night : strategy = everyMinute, restoreOnStartup
}

I have started log Heating_setpoint, using persistence historic state, so every 30minute I log current, -10min, -20min, -30min and those values are constans (if there was no change). So it looks that persistance DB has correct values.
Problem is chart function … probably.

If I will change DB, so I understand I can not use std charting function :frowning:

There are two charting methods. rrd4j has a charting capability built into it and there is a charting servlet which works with other queryable persistence stores (e.g. db40, MySQL, etc). If you use the servlet it will work.

Rich I have read your older posts and wiki, but still I dont understand what does it mean “default chart”.
So I can use rrd charting (via image link)- does it mean that it is a default ?
What I need to do to use other chart servlet (default ?) like this example from wiki
http://localhost:8080/chart?groups=Heizung&period=W&random=1&h=800&w=1200

Does it mean that I need to config i.e db4o with everyminute strategy + change default servlet to db4o in config ?
Can both rrd and db4o coexists ?

Yes. That is how you interact with the charting servlet rather than the rrd4j charting.

This wiki page covers the basics for persistence. you can have as many persistence types running as you want so db4o can run along side of rrd4j. I do not know if you need set db4o as the default.

The every minute strategy is only required to deal with a limitation/feature of rrd4j. However, if you don’t save the value more frequently than every change I suspect your chart will still be spikey.

I fixed it finally, but still don’t understand why.

In sitemap I was using just chart command:

chart item=Temp_Chart period=D refresh=30000

but when I analysed link on GUI/www I have:

http://localhost:8080/chart?groups=Temp_Chart&period=D&random=1

so according wiki it is “default” chart, but I think it is not rrd based, because rrd should be like follows:

http://localhost:8080/rrdchart.png?items=Weather_Temperature,Weather_Temp_Max,Weather_Temp_Min&period=W

I have changed my db4o config and add everyminute strategy and it works now :). those triangles was a result of “everychange” strategy probably

For better understanding I added next charts:

Image url=“http://localhost:8080/rrdchart.png?items=Heating_setpoint&period=D” refresh=3000`

Image url=“http://localhost:8080/chart.png?items=Heating_setpoint&period=D” refresh=3000

First image is fine, I got other then above style with grid and description Generated by RRD4
Second image doesn’t work.

What’s funny the first one is only visible under Windows openhab server, on Linux both are off. Config is copy-pasted .