Rules with a wait for changing state back

Hi!

I want to check my thermostat for changes and activate the pump so my floor heating starts to work.
If the temperature is very close to the setpoint temperature, the pump will start and stop every 2 minutes or so.
How can I wait in a rule for changes and only run the rule, if the state did not change back within X minutes?

Regards
Christian

  • Platform information:
    • OS: Wind
    • openHAB version: 2.3

Add some hysteresis to the temp setting to prevent short cycling. Here is an example you can try.

rule " temperature"
when
    Item TempSetpoint changed or
    Item YourTemp changed
then
    var Number cur_temp = YourTemp.state as Number
    var Number setpoint = TempSetpoint.state as Number
    val  Number hysteresis = 0.5

    if (cur_temp < (setpoint - hysteresis)) {
        if (YourPump.state != ON) {YourPump.sendCommand(ON)}
    }
    else if(cur_temp > setpoint + hysteresis) {
        if (YourPump.state != OFF) {YourPump.sendCommand(OFF)}
    }
end
2 Likes

Thanks a lot.
This may work, but my SRT321 is battery driven and I just get back heat or not to heat.

Regards,
Christian

One option is to add a temp sensor. If that’s not practical maybe use the Expire binding with your pump item and set the delay time for bringing the pump on and/or shutting it off.

The “heating ON” “heating OFF” responses come from a temperature measurement I assume so the regulating loop works but is too aggressive. Where is the thermostat located?
Can you place the thermostat further away from the heating source or lower the water temperature inside the floor heating to make the loop more stable?

Pay attention to hysteresis but for an example of how to do specifically what you are asking for see the antiflapping timer in Generic Presence Detection and Design Pattern: Motion Sensor Timer