@sweebee I think it is probably good enough to monitor the switch state events and to take a timestamp, e.g. Date.now() when the switch has been turned on. Then the monitoring device can calculate cost at fixed time intervals (e.g. using setInterval()) until the switch is turned off.
-
A Power Consumption and Cost Plugin for Pimatic Devices
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@Pimagical I think it would also be nice to an attribute like “hours of operation”. For fixed wattage this can be easily from the kWh, however, assuming the plugin will also support measurement of current usage it would be better to count time in operation, e.g. using the time intervals for updating kWh und cost values.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Hi
does someone do it ?
-
@kreg
Nothing, I am aware of.Started a new project. Give me four weeks to complete it. You can track the project at https://github.com/mwittig/pimatic-energy-monitor"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Nice! For interoperabity, maybe it is an idea to make it possible to set the price for 1 kWh both static in the config or by referencing to a variable. This way, the price could (hypothetically speaking) be fetched directly from the energy supplier.
Also, at my place there is a distinction in price between power used during daytime and power used during night-time. It would be nice if this could also be included.
Keep up the good work
-
@denniss17 Thanks for the input! This is a good idea. I’ll take it into account.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig that’s really nice! I will track your progress on this
-
Could be nice also to have daily/weekly/monthly/yearly values.
Also m3 in addition to kWhpimatic rocks!
-
@mwittig For developing a consumption plugin @xCite86’s rules can help: https://forum.pimatic.org/topic/1681/monthly-logging