Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
Posts: 2
Joined: 28 Feb 2014 04:34


Post by SirLouen »

I have a Fibaro Wall Plug connected to my Z-Way.
It reports the power consumption every 5 seconds
I would like to store the info every 5 seconds in a database or something in order to make some graphs and to know average consumption for a 24 hour period
Maybe there is something already done?

Posts: 31
Joined: 12 Jul 2013 11:36

Re: Statistics

Post by ollfa »

You can create a module which does exactly this. I made one a while ago it works but I don´t know if its the right way to do it. This is part of my index.js code.

function MySql (id, controller) {, id, controller);
this.eventLog = {};

// Module inheritance and setup

_module = MySql;
inherits(MySql, AutomationModule);

// Module methods
MySql.prototype.init = function (config) {, config);

var self = this;
this.controller.eventlog = {};
this.controller.onAny(function () {
var newArgs = get_values(arguments);
self.logEventMysql.apply(self, newArgs);

MySql.prototype.logEventsMySql = function(){

//Log events here.


Posts: 2
Joined: 28 Feb 2014 04:34

Re: Statistics

Post by SirLouen »

Can u send me the whole code ? im not into js :(

User avatar
Posts: 5640
Joined: 26 Jan 2011 19:36

Re: Statistics

Post by PoltoS »


Nice to see you using modules. You can make your module more "universal", add confgurable parameters and propose it as pull request on github. Or we can add it ourself if yousend it to us.

Posts: 13
Joined: 17 Dec 2015 23:45
Location: Sweden

Re: Statistics

Post by gabrielb »

Whats the status for this MySql thing. Did it become a module?

Post Reply