- Platform information:
- Hardware: synology NAS - docker
- openHAB version: 3.0.1
Hi all,
I am new to OH, started with OH3 for mainly automating Swimming pool filtration and heating making use of solar energy. To optimise the usage of my solar production I want to heat my pool when I produce more energy than I consume.
I read electricity production or consumption with MQTT, and use Shelly devices to switch my pool pump and heat pump on or off, based on the solar production.
I defined all items and rules using the UI interface, and persistence is writing data to mariadb via jdbc.
As front end I have HabPanel
So far my rules are very simple and work as expected:
- when solar production is above 1 kW I turn on the pool pump
- when solar production is above 2 kW I turn on heat pump
- when solar production is zero switch off pool pump and heat pump
The first rule looks like this, others are similar:
triggers:
- id: "1"
configuration:
itemName: GenericMQTTThing_ElectricityCurrentlyReturned
previousState: ""
type: core.ItemStateChangeTrigger
conditions:
- inputs: {}
id: "3"
configuration:
itemName: GenericMQTTThing_ElectricityCurrentlyReturned
state: "1.0"
operator: ">"
type: core.ItemStateCondition
actions:
- inputs: {}
id: "2"
configuration:
itemName: ShellySwitchPoolPumpPower
command: ON
type: core.ItemCommandAction
The 2 pumps together use around 3 kW, heat pump requires working pool pump, so I split them in 2 rules, since pool pump must run a minimal amount of time per day, also when it is cloudy, heating is ideally only when there is enough solar energy production.
Now I would like to add a couple of improvements, can someone give me some recommendations on how to achieve this?
-
I want to calculate the duration the switch was on during the day. In the persistence database and using the analyze button of the item I see each ON and OFF command and their timestamp, the function sumSince should give me that duration. I want to use this duration in the condition for switching the pump off: switch pump off if solar production is zero AND duration is less than 8 hours, or even better : if duration is less than a variable duration, which is set by the water temperature, e.g. if temperature is above 30°C then 12 hours, if between 25 and 30°C then 10 hours else 8 hours. Temperature is also available on one of my items from channel shelly:shelly1:ShellyThermometer:sensors#temperature1.
-
I want to have a button or similar on my HabPanel to override the normal rules, to âboostâ the heating. In the rules UI I see that I can make a rule to disable another rule, so if I disable my Switch Off rule the pump and heating remain on, until I select to go back to normal mode. What kind of item/widget do I need for this?
-
I also would like to have some hysteresis like described in Use excess Photovoltaics Production intelligently (Building a time based âhysteresisâ). Will that be possible in the UI based rule editor? Or do I need to switch to rules file of other languages?
Thanks in advance,
Luc