I built a simple tabular persistence viewer in HTML, jQuery and AJAX. The first iteration was put together by my wife, using PHP, but I wanted something that I could easily put into HABPanel. A helpful web developer could probably condense it with more jQuery or rewrite it using AngularJS and make it a HABPanel template, but it’s working quite well for my purposes. Hopefully others will find it useful!
In the Readme you state “5.View your persistence data in a browser at http://[openhab server]:8080/static/history.”
Since you called the file “index.html” the correct call would be “http://[openhab server]:8080/static/”.
Using it through a VPN, my Items don’t show up, will try it later when back on my LAN.
Thank you! I had changed some things last minute… this is cleaned up now. The URL for viewing should be http://[openhab server]:8080/static/PersistenceViewer (or https).
Do you mean the table headers (Items, Time/State? If so, what do you get when you put this in your browser (this is assuming you did not configure a startItem)?
Sorry for not being fluent in html.
Yes, I was referring to the TableHeaders.
Using the call the RestAPI as posted above I do get the items displayed.
Checked the index.html and found some missformed lines (probably caused by copy/paste done via a phone). With the corrected file contents it is working!
Using this viewer it will make explaining the way rrd4j is saving data in different archives quite easy.
I do foresee the questions: rrd4j needs saving every minute, why does the viewer not show The minute values for the last xx houres/ days etc? Because you are not looking in archive 1!
I don’t use rrd4j. Is returning 30 days of data by default too much? I could add another querystring to the URL to configure how far back to go, if no dates are used. Or is changing the dates enough?
IMHO that is enough, in order to look into the different archives of rrd4j one needs to set a specific timeframe. Since that is adjustable the viewer needs this possibility.
In the next couple days, I’ll setup some additional persistence services and look into it.
That’s an odd one. Which persistence service? If you look into the index.html, there is some debugging that’s commented out. See if they help troubleshoot. Are those items in groups? If you don’t specify a startItem, then the script will pull in all items that are groups. That is what you’ll first see in the Items table. If you specify a startItem, you will only see the items in that group.
I found an issue that would have prevented any persistence service from being used other than the default. Try again with the latest. It was working for me with MapDB. And congrats!