Post by papa on Nov 11, 2016 20:01:41 GMT
Using OpenHAB Persistence (as for Charting)
Until recently, in using OpenHAB persistence, I was largely shooting in the dark & borrowing from the OpenHAB demo. I’ve been trying some of it more carefully & learning from the results.
Without persistence, OpenHAB item data is rather fleeting or buried: It constantly updates on the User Interface & deep in the logs that record many OpenHAB details. As the name implies, “persistence” saves & persists OpenHAB information for later use. Three later uses for persistence that I can mention: 1) If OpenHAB is stopped & restarted, persistence can restore the previous item data to the User Interface rather than show undefined states until new data is suppled. 2) Persistence can save selected item data for the User Interface to show as a chart (a graph over time). 3) Persistence might save selected item data to be reported by other programs & methods as graphs, etc.
In this thread, I aim to document two available OpenHAB persistence methods: RRD4J & logging. Caution: Persistence may store a lot of data, not a big issue for a regular computer (Windows or Linux). However, according to this, data writes can corrupt a Raspberry Pi’s SD card over time.
===========================================
Addons Files needed for RRD4J & logging persistence:
In your computer’s addons folder, make sure you have these two files: org.openhab.persistence.logging-1.8.x.jar & org.openhab.persistence.rrd4j-1.8.x.jar.
For Windows, copy the files to C:\openhab\addons
For Linux (including Raspberry Pi), execute these commands (giving your Linux password)
sudo apt-get install openhab-addon-persistence-logging
sudo apt-get install openhab-addon-persistence-rrd4j
===========================================
openhab.cfg
No need to change the original in openhab.cfg for the sake of RRD4J or logging persistence??
==============================================