(second attempt to get it working, so maybe wait to install it)
This rule was made for two purposes. First to create the right information for my heatpump widget (most important the ‘mode’, what is de heatpump doing). Of course, you can use it to make your own too.
Second to provide the information to test energy conservation improvements. Check out the screenshot below. Long story of course. The biggest influence on the heatpump is the outside temperature. Using a heat-curve it translates that to how hot the heating water must be. But there’s second mechanism using heating minutes (one of the items the binding provides). Depending on how fast the heating water cools it will start a new heating cycles. By deriving the heating minutes in the last 3 hours it’s possible to see it happening (the screenshot). Outside temperature low, heating minutes up. And I’m experimenting with small things, for instance will decreasing ventilation lower the loss and thus reducing the heating minutes for a given outside temperature by a bit. This is work in progress, but that the second purpose of the rule.
What is does:
- Derive the mode (heating, passive heating, cooling, boiler or nothing) from the pump speeds and in/out temperatures of the heat exchangers.
- Calculate/store the minutes (per day) spend in each mode.
- Calculate/store the minutes (per 3 hours) spend in heating mode (my trial).
- Derive ground temperature (from brine in while running)
- On the first run it will create new items to store the derived data, they will be added to the Nibe group/equipment item (you select this when installing the rule).
- Reset_Calc : Resets cached values/history
- Mode : Derived mode of heatpump (0=off, 1=heating room, 2=passive heating room, 3= heating boiler, 4=cooling)
- Ground_Temp : ground temperature (derived from brine-in)
- Heat_Temp : (derived) Supply temperature but only for heating room
- Boiler_Temp : (derived) Supply temperature but only for heating boiler
- Brine_Temp : (derived) Brine in temperature but only when brine pump is active
- Heat_Min : (derived) running 24 hours total of minutes in heating room mode
- Passive_Min : (derived) running 24 hours total of minutes in passive heating room mode
- Boiler_Min : (derived) running 24 hours total of minutes in boiler heating room mode
- Cool_Min : (derived) running 24 hours total of minutes in cooling room mode
- Heat_Min_3h : (derived) running 3 hours total of minutes in heating room mode
To install it:
- (if not already done) install the JS Script and/or Nibe uplink binding (links in Language/Dependencies section
- Install this rule template from the marketplace (open your openHAB → menu settings → add-ons → automation → search Nibe Heatpump Rule and press install button
- Create a rule using this template (openyour openHAB → menu settings → automation → Rules → + / add rule button → Choose Nibe Heatpump Rule → select the item for the nibe group/equipment → save)
Language: JS Script ECMA2021
Dependencies: NIBE uplink binding
- added: Made it official, moved code to github (previous versions were on forum topic)
- added: Change to standard rule using helper methods
- fixed: install by marketplace (working on it/testing)
- added: Calculate rolling sum of minutes active in each mode in last 3 hrs
- added: Calculate rolling sum of minutes active in each mode in 24 hrs
- added: Estimate ground temperature (lowest brine-in in 24 hrs)
- added: Reads heatpump raw data and derives what’s it is doing (nothing, active heating, passive heating, cooling, boiler heating)
- added: Write result in new item mode (automatic added if needed)
- added: Store temporary items in cache (that survives rule init/sate) with reset item (added if needed)