How to configure HVAC mode in winter/summer?

Well, this is complicated logic and complicated logic is complicated. :wink:

You could model this using a state machine: A State Machine Primer with HABlladin, the openHAB Genie

Draw out what you want in a state diagram and look for ways you can break things down into substates.

Once you have it all mapped out it is just a matter of writing a really long if/else or switch statement that represents all the lines on the state machine.

In your case, the states you are trying to get to is whether to turn on cooling/heating or not. But a number of other states feed into that decision (summer/winter, current temp, presence, etc). Separate out the calculations of those other states from the cooling/heating states to make your rules a little more manageable. Good luck!