Switch / Contact in rrd4

Hi There,
I’m trying to make a chart of how often and for how long a switch and contact is on and off.
I’m using OH2 I have tried to make it with the MYSQL Persistance but I can’t get a graph from it as it stores ON or OFF values.
I have tried to use RRD4J but It does not seem to work @ all it can be because the periods of those items are small from 1s to 20s max.

This is the strategy I use:

Strategies {
	// for rrd charts, we need a cron strategy
	everyMinute : "0 * * * * ?"

Items {	
	// let's only store temperature values in rrd
	SWTest,CTTest : strategy = everyChange, everyMinute
	YTemperature : strategy = everyMinute, restoreOnStartup


# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies

#<defname>.items=<list of items for this defname> 


any idea how to get around this ?

If it is not using a number to store switch states it won’t work in rrd4j at all. I’d recommend using the InfluxDB+Grafana approach, or at least the InfluxDB part. I’ve been charting switches in it successfully.

Thanks Rich!
This is what I was looking for! :smile: