Hi Cyril,
Here is what you can do (based on the demo setup):
Add an item
and make sure you persist it with rrd4j. Then create a rule like:
rule "Set number of lights"
when
Item Lights received update
then
NoOfLights.postUpdate(Lights.getStateAs(NoOfLights.acceptedDataTypes.get(0)))
end
The part "NoOfLights.acceptedDataTypes.get(0)" is only a workaround for "DecimalType" - out of some reason, putting "DecimalType" is not accepted here…
Now you can simply add a chart in your sitemap:
Chart item=NoOfLights period=D
That's it! Please note that as we use a number item, rrd4j does treat the values as floating point and not discrete numbers. That means that if you have 1 light on for 30 seconds and two lights for the next 30 seconds, you will see the line at 1.5 in the graph for this minute (which is the minimal resolution). But I think this should be fine for your use case.
Best regards,
Kai