Didn’t express myself very clear, was referring to the generic solution as a whole, it is possible that it can be done in a better way than what I was thinking, but my solution is messy.
I’ll try to write a small guide but any improvements and or generic suggestions would be good to see.
@rlkoshak it would actually be a very nice gesture of yours, if you could write a hands-on tutorial about how to best go from items-based rules to group-based ones. I believe many users would benefit from your experiences for best practices in that area. I’m not talking about a “Design Pattern” but a step by step guide
I’ve only looked at it briefly but Yes, that looks great!! Thank you
I should not forget to add your design patterns tag to this or something similar: https://github.com/openhab/openhab-docs/issues/205
I’m waiting for the forum restructure. That will be fun.
Another way to throw a different & larger lasso around the entire problem of energy monitoring is to go with a whole-house approach based on a multi-circuit-capable special-purpose hardware such as the Brultech GEM. I bought one of these units a few months ago & can now see per-circuit usage for the entire house. At around $500-$600 or so, not cheap, but perhaps a fair cost when compared to the time & coding investment required to try to piece together comprehehsive usage based on measurements of individual devices.
Hardware-level physical current monitoring also accounts for normal line-voltage variations in real time. (As much as +/- 7% from nominal 120V AC on heavily-loaded circuits.) A well-designed hardware solution also automatically measures & accounts for AC power factor, a very significant issue when dealing w/ inductive loads & switching power supplies.
IMO the GEM is a good piece of hardware, built-in web GUI is rudimentary but functional. Documentation is adequate but not super well-organized.
At some point I will work on getting the GEM hardware integrated w/ OpenHAB.
In the web GUI you can setup how you want the data exported. Today most of us are using the btmon.py script and mqtt to get the data into openHAB. I am not a programmer, but I don’t think it would be that complex to write a binding. If anyone is interested I can put one or more of my GEM units on the public internet for testing.
The binding will work if you supply “simulated” power inputs at given intervals.
I can probably add functionality for just supplying ON/OFF and the binding should work.
Do you use Openhab2 or Openhab3?
I have a heat pump that always shows me the current operating status. Off, hot water, heating. An electricity meter measures the consumption of the heat pump. Now I would like to know how the consumption is divided between hot water and heating. I could imagineto calculate the divided consumption via the consumption or the power.
“Energie WP Heizung”
Item BSZ_Verdichter_Hzg changed
Energieverbrauch_WP_Hzg.postUpdate(((BSZ_Verdichter_Hzg.state as DecimalType)*1.78))
rule “Energie WP Warmwasser”
Item BSZ_Verdichter_WW changed
Energieverbrauch_WP_WW.postUpdate(((BSZ_Verdichter_WW.state as DecimalType)*1.78))
Unfortunately, the operating hours display no longer works (An issue with the pump not OH related), because that’s how I used to calculate it before.
Instead of the 1,78kW I would use the actual measured power.