DataYours - monitoring energy usage

What archive are you currently running with?

The original defaults which I think is 1m:1d 1d:30d 1d:5y

Akbooer, is it possible for me to change from 1m:1d 1d:30d to 1m:1d 30min:30d without losing my history?
Thanks as am keen to start on more detail but want to know the best way to do this.

It’s very easy to copy data to a new file with different archives, but what would you want the missing 30 minute values to be?

This is the crux of the matter in changing archives: the mechanics are easy; the semantics are less so.

I guess whatever values are required so that when the 30min:30d becomes 1d:5y the daily total is still correct, effectively what it is already.

Ah, you didn’t previously mention the 1d:5y archive… I did wonder why you were concerned with preserving history when it only lasted for a month!

What is the aggregation function between the archives?

It’s for energy usage so looking back on this thread it sums. Guess then the missing values can just be zeroes?

…or spread the value over all 30 minutes of the day.

That would work too. I wouldn’t be using the 5d to 30d data until it’s all been replaced anyway so doesn’t make too much difference. Your suggestion might give better axis though.

@simonclark

Sorry this has taken a while - I’ve been away.

Here’s a little script to read a Whisper file, create a new one with whatever archive structure you like, and then copy all the data from the oldest archive into the new file. This should be exactly what you need since you’re not interested, in the long term, in anything other than daily data.

Note that you will have to edit the old and new filenames and archive structure (perhaps) to what you need. I’d strongly recommend to make a backup of your old file, since to test it you’ll probably want to rename the newly created one to the old filename. Don’t do this with DataYours running (since it caches the file headers and you will just have changed this.)

----- script to resize a Whisper file, retaining only the oldest archive's data.

-- PARAMETERS:
  local oldFile = "Vera-88800001.108.urn^upnp-org^serviceId^TemperatureSensor1.CurrentTemperature.wsp"
  local newFile = "resized.wsp"
  local newArchiveList = "1m:1d,30m:30d,1d:10y"
--

local whisper = require "L_DataWhisper"
local info = whisper.info (oldFile)
whisper.create (newFile, newArchiveList, info.xFilesFactor, info.aggregationMethod)

local vt = whisper.fetch (oldFile, 0, os.time())
for i,v,t in vt:ipairs() do
  if v then whisper.update (newFile, v,t) end
end

Hope this is what you need.

Hi akbooer,

excuse me if I use this thread for a question about energy meters . I’m trying to get the info about voltage from a zwave power meter (Aeon HEM 2nd generation) and archive the data in DY.

Actually I capture, read, archive and graph the Watts and KwH.

The device is able to capture Voltage with Watt, KwH, Ampere but the Veraedge is able only to capture Watt and KwH in the device and variables defined .

The device configuration parameters can set the device so it can send periodic report about Voltage to a group associated to the device.

Do you think if is possible to develop a plugin or a configuration (For example a Virtual Power Meter ) so the Vera Controller will be able to capture the voltage info ?

tnks in advance for your patience and support.

donato

Is this not the same issue addressed here

and
http://forum.micasaverde.com/index.php/topic,37119.msg277834.html#msg277834 ?

I might be wrong… (often I am.)

[quote=“akbooer, post:32, topic:186813”]Is this not the same issue addressed here

and
http://forum.micasaverde.com/index.php/topic,37119.msg277834.html#msg277834 ?

I might be wrong… (often I am.)[/quote]

Hi akbooer

You’re right … often (near always) you are !!

I already capture the kwh change with a PLEG rule
and write it in a variable relative to a virtual variable device.

The problem is to distinguish (on a value change ) if is a Voltage
Change or a kwh change.

Have you any suggestion?

Tnks

I thought the code here http://forum.micasaverde.com/index.php/topic,37119.msg277834.html#msg277834 did just that.

It will fail at very low kWH readings, but I’m assuming that happens only when the meter rolls over all digits. Otherwise, if it’s less than 300, it’s a voltage.

I thought the code here http://forum.micasaverde.com/index.php/topic,37119.msg277834.html#msg277834 did just that.

It will fail at very low kWH readings, but I’m assuming that happens only when the meter rolls over all digits. Otherwise, if it’s less than 300, it’s a voltage.[/quote]

Yes but I reset to zero kwh every night. I’ve to find a solution without resetting kwh

Tnks

Ho akbooer,

I’m trying to measure the Energy (kwh) that a PV system feed-in to a grid. I’m using DY on VeraEdge.

I’ve already the value of Power (Watt) archived in DY every minute daily calculated from the value of production and consumption Power using PLEG and I write it in a variable that is watched by DY.

How can I from this values (present in a wsp files on Vera) and using Lua calculate the Energy (kWh) during the day ( for example every 4 minutes)?

I suppose I must read the wsp file from the start of the day and summarize the values and then normalize to hour.

tnks

donato

There’s several ways to to this.

[ol][li]add some user-defined processing to DataWatcher (using that recently-added capability) which intercepts the power channel, integrates over the last N minutes and then outputs both the original power channel and also the additional kWh calculated channel[/li]
[li]use the archive aggregation function in a Whisper file to do the integration. I do this for some channels when using the “Live_Energy_Usage” functionality. It goes into a file with the archive structure “1m:1d,1d:5y” and an aggregation function of “sum”. So looking at the file on the scale of a day gives me, in this case, energy usage by the minute, but viewing it on a timescale of greater than a day gives the daily total.[/li][/ol]

Hope this is clear.

[quote=“akbooer, post:37, topic:186813”]There’s several ways to to this.

[ol][li]add some user-defined processing to DataWatcher (using that recently-added capability) which intercepts the power channel, integrates over the last N minutes and then outputs both the original power channel and also the additional kWh calculated channel[/li]
[li]use the archive aggregation function in a Whisper file to do the integration. I do this for some channels when using the “Live_Energy_Usage” functionality. It goes into a file with the archive structure “1m:1d,1d:5y” and an aggregation function of “sum”. So looking at the file on the scale of a day gives me, in this case, energy usage by the minute, but viewing it on a timescale of greater than a day gives the daily total.[/li][/ol]

Hope this is clear.[/quote]

Hi akbooer,

About the first option where can I find some documentation ? I’ve tried to search in the DY User Guide but I didn’t find it .

About the second option can I use it on a Variable of the Multistring Plugin that contains the power generated with this schema “retentions = 1m:1d,5m:7d,10m:30d,1h:1y,1d:10y” ?

tnks

donato

Yes, sorry, time for a documentation refresh. However, here’s a start: http://forum.micasaverde.com/index.php/topic,37119.msg278081.html#msg278081

Well, this is a bit subtle. Assuming the aggregation function for the archives is “sum”, then for “1m:1d,1d:10y” any request with a time interval less than a day gives the one minute values, wheras any over a day gives daily totals. However, with “1m:1d,5m:7d,10m:30d,1h:1y,1d:10y” then the summing interval depens on the time period over which you ask for the data:

[ul][li]over a day but less than a week, then its a five minute sum[/li]
[li]over a week but less than a month, it’s 10 minutes[/li]
[li]over a month, but less than a year, it’s an hour[/li]
[li]over a year, then you’re back to a daily total[/li][/ul]

So if you’re programming something separately, then simply ask for the whole ten years (or anything over one) and pick out the days that you need.