Page 1 of 1


Posted: 28 Feb 2014 04:38
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?

Re: Statistics

Posted: 28 Feb 2014 12:01
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.


Re: Statistics

Posted: 28 Feb 2014 20:32
by SirLouen
Can u send me the whole code ? im not into js :(

Re: Statistics

Posted: 02 Mar 2014 13:21
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.

Re: Statistics

Posted: 13 May 2016 12:48
by gabrielb
Whats the status for this MySql thing. Did it become a module?