ioBroker.sourceanalytix icon indicating copy to clipboard operation
ioBroker.sourceanalytix copied to clipboard

Implement counts to calculate counts ==> watt

Open DutchmanNL opened this issue 5 years ago • 4 comments

as prototyped too be implemented after watt calculation fix

var VerbrauchImp;


VerbrauchImp = (new Date().getMilliseconds());
on({id: 'mqtt.0.ESP_Keller.Strom.Count', change: "ne"}, function (obj) {
  var value = obj.state.val;
  var oldValue = obj.oldState.val;
  if (getState("mqtt.0.ESP_Keller.Strom.Count").val == 1) {
    console.log('test');
    setState("mqtt.0.ESP_Keller.Strom.test2"/*Watt*/, (Math.floor(1440000 / ((obj.state ? obj.state.ts : "") - VerbrauchImp))), true);
    console.log((obj.state ? obj.state.ts : ""));
    console.log(VerbrauchImp);
    VerbrauchImp = (obj.state ? obj.state.ts : "");
  }
});
Schermafbeelding 2019-06-27 om 20 26 23

DutchmanNL avatar Jun 27 '19 18:06 DutchmanNL

  • ensure counts per kWh are configurable

DutchmanNL avatar Jun 27 '19 18:06 DutchmanNL

Hi, as described in iobroker forum. I have implemented my Ferraris counter with an adruino to my GPIO port on my Raspberry. I have a 1 signal at my GPIO, when the red area is passing the Arduino sensor the signal will switch to 0 and back to 1 again. Means, I have an 0 impulse on my GPIO every round from the Ferraris counter.

Bastelritius avatar Apr 06 '20 11:04 Bastelritius

implemented

DutchmanNL avatar Sep 30 '20 19:09 DutchmanNL

not sure why I closed this, not implemented yet sorry

DutchmanNL avatar Jan 20 '21 08:01 DutchmanNL