openLuup: Data Historian

Funny you should say that, but it is work in progress (and nearly ready!) The latest update to the Console should be what you need.

1 Like

Incredible !! You are the best !!

Have a nice evening

Hi akbooer,

is there any news about a simple UI interface in openluup enviroement to define/display variables.

tnks

donato

Hi Donato

Well, yes, it’s been there for a while.

The console device pages look like this, for example:

The small blue icons take you to a listing or a plot of the recent variable values.

Clicking on the +Create button takes you to a menu like this:

Did you need anything else?

AK

Hi akbooer,

where can I find this version of openluup software? Is this master or development branch ?

This is in the more recent development branch releases. Simply type development into the openLuup update box on the Plugins page and press the update button.

hi @akbooer,

I have been using grafana with historian for quite some time and just today wanted to add a variable to the archive and grafana plotting. I tried doing it through the console/historian menu but it appears that checking the checkbox under that menu does not take. The graphing of that variable under the console works but I am trying to add it to the grafana dashboard. How do we go about adding a variable to be archived?

Yes. If you are not on a tablet, you should see a popup on that column title (“variable…”) which says:

“note that the checkbox field is currently READONLY”

Sorry about that, it is clearly on the “to do” list.

All you need to do is create the right historian file, and once it’s there, it will be updated. There’s two ways to do this:

  1. Add the generic variable name to the historian rule base. This is found at the end of the file servertables.lua in the openLuup folder. The pattern matching rules are of the form

device_number.short_serviceId.variable_name

and is grouped under different sample rates (“every_5m, every_10m, etc…”). It takes ‘*’ as a wildcard in any of these three fields, or more complex syntax (as used by the historian’s data finder.)

If that’s not clear, then let me know and I can make a specific rule set for you.

  1. Create the file as a one-off, manually. This would be in the history/ database, or wherever you’ve specified for the historian archives. There are default values for the various archives in the file created, depending on variable type, but again these can be overridden.

Again, you’ll need a bit more detail on this, but I can tell you that if you tell me eactly what you’re trying to archive.

Sorry this is so difficult, I really must get around to making tht checkbox work!

AK

1 Like

Thank you. I have no intent to hardcode it so I will go the file creation route. No rush I can you the console in the meantime. It appears that the free memory on the vera which I was trying to plot may not be needed after all as it seems like I resolved the memory leak I thought I had.

OK, so a one-off file create can be done with code like this run in Lua Test:

local whisper = require "openLuup.whisper"

local filename = "history/0.377.Weather1.TodayHighTemp.wsp"
local archives = "10m:7d,1h:30d,3h:1y,1d:10y"

whisper.create (filename,archives,0)

print((whisper.info (filename)).retentions)

The key parameters you will need to change are filename and archives. This also assumes that your historian folder is history/.

The filename syntax is 0.deviceNumber.shortServiceId.variableName, and the archives are in the usual Whisper syntax – these particular ones are what I use for most measurements, with a 10 minute basic sample rate, but you could, for example, switch that to 5.

If the code is successful, it will echo the archive retentions read from the newly created file, thus:

10m:7d,1h:30d,3h:1y,1d:10y

Hope that makes sense. You’ll have to reload for the historian to start using this new set of archives.

1 Like

Thanks. I had already done it but doing a copy paste of an existing history file and renaming it to the variable I wanted. Seems to be working.

Yup, that works great too, if you want the same archive structure and you don’t mind the old data hanging around in there!

Maybe I got lucky… I had no old data when I did this. It seem to have gotten wiped out and the data structure I copied over seems to work.

1 Like