Occupancy-based ventilation in mixed mode system

i am modeling a mixed-mode ventilation system where cooling is active only when the room is occupied. The heating setpoint is 21, natural ventilation is active between 24 and 25.5, and mechanical cooling is activated after 26 ONLY IF THE ROOM IS OCCUPIED. however, this results in overheating in hot summer days when the room is unoccupied, cooling is off but natural ventilation is not active either.

so i would like to write a conditional statement to activate natural ventilation for the following case:

if occupancy = 0 (therefore cooling is off) AND indoor air temp >= 26
natural vent is active

i was wondering whether this is possible.

thanks in advance.