Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexalog / libklio normalize readings to minute-resolution #107

Closed
wintermutepi opened this issue Oct 1, 2012 · 1 comment
Closed

hexalog / libklio normalize readings to minute-resolution #107

wintermutepi opened this issue Oct 1, 2012 · 1 comment
Labels

Comments

@wintermutepi
Copy link
Contributor

Hi,

I would like to record multiple devices in the house with HexaBus plugs+ and plot a sum graph with a minute resolution. The fact that each plug submits its readings at different seconds is not quite good for this use case. My quick and dirty workaround was:

  • just cut off split seconds of timestamp
  • look at the 5 values before and after the current value to see if there's another reading for the same minute
  • average over values of the same minute

Of course, it would be even better to calculate a more accurate minute value by taking the last value before and the first after the minute in question.
E.g., if you had readings (UNIX timestamp here converted to human-readable datetime)

datetime value
2012-10-01 19:59:40 50
2012-10-01 20:00:30 100
2012-10-01 20:01:10 200

  1. imagine a line through the points (2012-10-01 19:59:40;50) and (2012-10-01 20:00:30;100) which could also be referred to by (-20;50) and (30;100) when counting the seconds to the next full minute (full minute = 0)
  2. the linear equation has the form y = ax + b
  3. the gradient of the line through the two points is a = (100-50)/((30-(-20)) = 50/50 = 1
  4. with the point (-20;50) you get b=70

do the same with the next two timestamps (-30;100) and (10;200), you get a = 2,5 and b = 175

That way, the normalized readings would read:

datetime value
2012-10-01 20:00:00 70
2012-10-01 20:01:00 175

Could we have this calculation in libklio?

Cheers,

Monika

@gonium
Copy link
Member

gonium commented Oct 4, 2012

This is a libklio-only problem - I moved the issue to the libklio tracker. See here:

mysmartgrid/libklio#10

@gonium gonium closed this as completed Oct 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants