openLuup: Data Historian

The latest version of openLuup in the development branch now has the capability to archive variables. You don’t need DataYours at all, and can link Grafana directly to openLuup.

The latest version of openLuup in the development branch now has the capability to archive variables. You don’t need DataYours at all, and can link Grafana directly to openLuup.[/quote]

+1

Great to hear the news on Data Historian. Just wanted some clarification on this …

The on-disk archive is enabled by the single LuaStartup line luup.attr_set (“openLuup.Historian.Directory”,“history/”), where ‘history/’ is the path (including trailing ‘/’) relative to cmh-ludl/ where you want the data to reside.

Where should I put the line?

Cheers

Yes, I’ve been a bit low-key on this, but you do have all the data you need…

The on-disk archive is enabled by the single LuaStartup line [tt]luup.attr_set ("openLuup.Historian.Directory","history/")[/tt], where 'history/' is the path (including trailing '/') relative to cmh-ludl/ where you want the data to reside.

…yes, that’s right.

Where should I put the line?

Anywhere you like in Lua Startup, so long as it gets executed. Just save, and (ignoring the AltUI message that Vera will do so anyway) restart manually.

Be sure to take the latest development release (just now, that’s v18.7.10) it also has the capability to graph any of the variables listed on the console historian cache and DB pages, without even any need of using Grafana (uses Google Charts, so must be internet connected for this trick to work.)

You may want to customize things a bit for your own needs, but straight out of the box it should work OK.


PS: If there’s an HTTP/CSS guru out there, I may need some help putting these plots into pop-up frames above the console page, rather than overwriting it. (Must NOT involve JavaScript.)

Brilliant. Went to Altui/Misc/Lua Startup and added luup.attr_set (“openLuup.Historian.Directory”,“history/”)

In More/Plugins typed ‘development’ into the openLuup update box and hit update.

Graphs can be seen by following the relevant link in the Console - openLuup/Historian.

I like the way it is possible to graph multiple variables against each other in datayours and might see if grafana will do something similar.

[quote=“powisquare, post:5, topic:199464”]Brilliant.
[…]
Graphs can be seen by following the relevant link in the Console - openLuup/Historian.[/quote]

Excellent. My aim was to make it that easy.

I like the way it is possible to graph multiple variables against each other in datayours and might see if grafana will do something similar.

Not sure what you mean here? DataYours (and Data Historian console pages) both use Google Charts and can provide a variety of plots with multiple variables. Grafana can do so much more, so you shouldn’t have any trouble producing what you need…

Adding multiple metrics to a plot in Grafana is easy, and you can interactively walk though the machine / device / serviceId / variable menus to find what you need. openLuup also provides a few special functions to tidy up the metric naming in legends, etc: alias(), aliasByMetric(), aliasByNode().

Nearly there! Able to plot Current Temp, Setpoint and Boiler switch status against each other (well almost). Curiously the Setpoint data has disappeared from yesterday. The History folder exists but when I look in the Console to Files/History DB I see ‘On-disk archiving not enabled’. Would this be an issue?

The magic line in startup needs to be there to run at every startup. Did you remove it?

…and, in fact, CurrentSetpoint is not a default parameter to archive.

I will add it, but you can easily do so by editing the servertables.lua file, line 202,adding that variable to the existing, CurrentTemperature, … etc.

I am still confused by your ‘On-disk archiving not enabled’ message.

lua startup is good I think

– You can personalise the installation by changing these attributes,
– which are persistent and may be removed from the Startup after a reload.
local attr = luup.attr_set

– Geographical location
attr (“City_description”, “Greenwich”)
attr (“Country_description”, “UNITED KINGDOM”)
attr (“Region_description”, “England”)
attr (“latitude”, “51.48”)
attr (“longitude”, “0.0”)

– other parameters
attr (“TemperatureFormat”, “C”)
attr (“PK_AccessPoint”, “88800000”)
attr (“currency”, “�”)
attr (“date_format”, “dd/mm/yy”)
attr (“model”, “Not a Vera”)
attr (“timeFormat”, “24hr”)

– Any other startup processing may be inserted here…
luup.attr_set (“openLuup.Historian.Directory”,“history/”)
luup.log “startup code completed”

Added CurrentSetpoint to read “..{CurrentLevel,CurrentTemperature,CurrentPressure,CurrentSetpoint}”, – temperature, humidity, generic sensors, … and reloaded luup engine

There are various CurrentSetpoint whisper files which start with nil but none that are preceeded by controller number ? Have tried to attach a snapshot.

Those seems to be duplicates. I presume that they are not updating. Can you check that and also their creation times cf. the real ones?

Have you added one of the bridged Veras since starting to play with this?

Feel free to delete the nil ones and see what happens after a restart.

Just reread your post and seem to have missed the first line, sorry, but fwiw did not add any veras to muck things up.

Using Winscp logged in with sudo -s in Advanced/SCPShell/Shell (couldn’t delete files with the normal pi login). Deleted all nil files and restarted. Changed the setpoint and am now seeing the new values in Console. Grafana however has lost the data and is currently looking into empty arrays and … the nil files have returned. Will see if it populates over time.

Sorry this is causing trouble. A few non-archived variables, I had expected (because I don’t have thermostats or other exotic devices.) But this nil nodename is odd.

Can you confirm the number of Veras you have bridged (looks like at least two) and also show me the Variables page for both of those devices? A Startup Log might help me pinpoint the issue (also the first part of the main log, until all the plugins are initialised.) It’s not something I’ve seen on any of my systems, but hey, that’s what beta testing is for. (You DID know that you were a beta tester?)

No trouble at all. Honored if truth be told : )

There are three veras bridged but Grafana is only looking to two at present tracking CurrentTemperature and CurrentSetpoint from two thermostats and CurrentSetpoint SwitchPower1.Status from two relays. Please see attachments - hope it’s what you are looking for.

Nearly all of what I needed… I was also wanting the variables of the VeraBridge plugins themselves (three, in this case, then.) In particular, they should all have variables Offset, and PK_AccessCode. I also need their device names (but may find them in the logs. haven’t looked yet. I have now: the Vera with the nil issue is ‘VBOld Forge’)

Thanks for all the help.

Morning - please find VB variables attached

Well, there’s your problem. PK_AccessPoint for the errant machine is nil.

I’ve never seen this, and, frankly, don’t know how that machine can possibly work with the MiOS accounts. What did you do to it?

I have no idea? Has been running for over three years but I’m no expert in these things. Anything I should/could do?

I think this is a relatively recent happening, and wonder (could be wrong, though) if you have inadvertently managed to delete this attribute? Perhaps doing something in Lua Test?

Anyway, I can tell you that this seems like a Vera 3 / VeraLite class of machine. In fact, I can dig out from the logs that its PK_AccessCode should be 30107174.

As a sanity check, can you first look at the results of these three requests in a browser:

http://192.168.1.170/port_3480/data_request?id=variableget&Variable=PK_AccessPoint
http://192.168.1.171/port_3480/data_request?id=variableget&Variable=PK_AccessPoint
http://192.168.1.172/port_3480/data_request?id=variableget&Variable=PK_AccessPoint

you should get:

30107174
30108355
45105824

…but I’m wondering is the first one gives nil or an error? If so, we can try and fix this.