interactiveinstitute / elvis

Educational tool for measuring energy usage with Fibaro Wall Plugs on Raspberry Pi
https://www.tii.se/projects/energy-in-a-box-at-komtek
GNU General Public License v3.0
3 stars 0 forks source link

Do kWh interpolation (using W) client-side #10

Closed sander closed 11 years ago

sander commented 11 years ago

This will allow a more realtime-like view. Currently, the interpolation is not done or done on the server side, so that the client receives an update every 1 s or less often.

sander commented 11 years ago

New plan, just discussed: wlt_server.py only sends a [P0, P1, …] power value array when there’s an update. We need to set option 4 (immediate power report) to 1 (1%) and hope that doesn’t overload the network. The client will use the power value to interpolate linearly: every ms, a small amount of kWh is added depending on the currently stored power value.

We can test this over the next weeks and see whether it is accurate enough. If not, we need to do some back-and-forth syncing with the server, based on the plugs’ stored energy values.

Anton04 commented 11 years ago

Now Magdalena can also see the bug reports here! New version to be tested on Monday 11/11.

sander commented 11 years ago

Fixed in commits d98b7f7fc and e250c4756. The effect is nice and enhanced when you use a small measurement value, possible since commit c11c88d91.

This fix currently makes the Plugwise and ‘fake random data’ implementations unusable. If the tests go well we can get rid of the Plugwise implementation. It makes sense to reimplement ‘fake random data’ sometime for demos.