I've read through all of this post and it was pretty helpful: #1300511146520084632 message
Although it was more complex than I actually need/ want my setup to be. Please note that I'm really new to home assistant. I read through a bunch of stuff, but I can't wrap my head around this topic.
**My goal is: **
- Have defined temperatures to specific times (without presence detection)
- Turn off the heat if the window is open
- Return heating depending of the time of day after window is closed
1 & 2 are pretty easy and I already set this up, the problem is that I need some sort of check if the window is closed again if it should heat or not, depending on the time.
(the following temps and times are just for my example)
Let's assume I want it to be 20°C between 15:00-20:00 and 15°C between 20:00-15:00. When I open the window at 16:00 and close it at 16:30, it should fall back to the temperature I declared for this timeframe (so 20°). But when I open the window at 19:50, but close it at 20:10, I want it to be at 15°, so it must check what time it is when closing the window and get the desired temperature from there.
What is a simple way to set this up? I can't get my head around how to do it with simple if else statements. I would like to use some sort of variables, so I can defined my temperature and times in one place and the rest is dependant on that. So if I change something with the timings I don't have to go into 10 automations and change stuff around.
Thanks!