ioBroker.sourceanalytix
ioBroker.sourceanalytix copied to clipboard
Implement counts to calculate counts ==> watt
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 : "");
}
});

- ensure counts per kWh are configurable
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.
implemented
not sure why I closed this, not implemented yet sorry