Logical OR operation between switches?

Hello Community!

I’m trying to develop an automated heating control in my house. I use a Sonoff TH and a valve actuator for each radiator. I created switches and temperature sensors seen correctly by OpenHAB.
But I need an extra switch to control the boiler, I use a modified Sonoff Basic which when turned on, starts the boiler, and when turned off, stops the boiler. So far so good on the hardware part.

What I can’t seem to understand how to program in OpenHAB is a kind of logic “OR” function to combine the switch states of each radiator. So basically all I need:

  • whenever any radiator’s switch is ON, turn the boiler ON
  • whenever all radiator switches are OFF, turn the boiler OFF
    Actually this is an OR logical operation of all the radiator switches, and the result should actuate the switch of the boiler. More easily: at any time if there’s at least one radiator switch in ON state, keep the boiler in ON state. Only turn off the boiler when all the radiator switches are OFF.

Any ideas how to implement this?
Thanks in advance for your help.

Use groups
Group:Switch:OR(ON,OFF) AllRadiators

More info:
Openhab groups

1 Like