My chart doesn't handle "off" very well for a zwave controller

I’m using a zwave socket that shows me energy usage. I only turn it on once a day for about 15 minutes, but it looks like the chart service is really unhappy with this approach as it just treats it as if it has no data when it’s off. Is this a known issue, or can I do something about it?

What type of persistence service are you using to chart the data? How is this sevice configured (i.e. what does your tbd.persist file look like)?

From the chart it looks like it reports 0, which sounds like a sensible value for “energy usage” when your socket is OFF, or am I missing your point?

I’m using mysql to persist the data (I’ll get the file when I’m home).

I suspect it is recording the data correctly, it should be 0 - but the graph just assumes there is no further data so it’s assuming the value was unknown at that time.

It does look like you have it set to record only on change, as opposed to everyMinute or something similar. If it is only on change, it will not assume a value between updates, and you will just have the two data points. The graph engine will then fill in between the two data points. If you check your configuration and you do have more datapoints, then something else is going on.

This is my setting:

Strategies {
default = everyChange

Items {
* : strategy = everyChange, everyDay, restoreOnStartup

Don’t see anything about minutes there so I’m guessing it’s not correct.

Try changing everyDay to everyMinute, or everyHour depending on the level of granualarity you want in your chart. More data points will make the graphs square up.

That worked! This isn’t going to cause my DB to grow massively is it? Is there any sort of inbuilt schedule clean of old data that takes place?

Not too bad… only 1440 times larger if you set it to every minute.

If there is nothing else you are using the data for, I would use the rrd database for this storage. It is pretty well suited for this with a fixed database file size and automatically rolls off. That is up to you of course, and you can prune your SQL data too, though I am not aware of anything built in for doing so.