Dynamic conditions

I have a temperature sensor. I want to design a flow that turns on a conditioner based on temperature and time. the rules are like this.
if time is between 10 p.m to 4 p.m and the temperature is less than 17 then turn on heater if it is more than 23 then turn on cooler.
the number of these rules can be different and I want to be able to add rules like this dynamically. can you give me hints on how to implement this flow and which nodes I am supposed to use?

Welcome @fjahangiri to the forum!

Do you want to make the start and stop times variable? You can use the dashboard text input node with the time picker to get your times. Dashboard numeric nodes can be used to get the temperatures.

But you will have to check that the start time is before the end unless the end time goes past midnight and that the low temp is lower than the high temp. Then you could store these in a flow variable.

then you need a flow to read the sensor, see if it's now in the time range and is the temp to high or low and act accordingly.