Ideas on how to create a Thermostat flow with scheduling

Im am just looking for ideas on how to create a node red flow to create a thermostat for my heating with the following requirments.

4 preset time schedules for 3 day settings (all with individual temperature settings)
Preset 1 = Mon - Fri
Preset 2 = Sat
Preset 3 = Sun

For each day setting the following can be set

Wake Temp
Leave Temp
Return Temp
Sleep Temp

Require Manual on off switch for summer
Require manual overide of temperature to force the heater on.
Also if power goes on and comes back on to resume the current state

I have created a dashboard with the temp and day settings in home assisatant, but im not quite sure which way to attack this.

My thoughts were to use a function node to store the current value and other settings in a global variable and then trigger any state change with a time node.

Any suggestions would be great. happy to post the solution once i get it working.


I would quess from what I've read here most of us have done a thermostat controlling one thing or another. I'm pretty sure every single one of them are different one way or another. My advice to you is decide what you want to do maybe even draw on paper a flow diagram of what you want, then start programming. If you hit a wall come back and ask questions, we will help.

If you want a generic one - head over to Peter Scargills blog and look on there - he has evolved a thermostat over a number of years that appears to be very flexible.


Also not sure if you know about this one in HA itself


I have a flow for central heating and hot water. It's a heavily modified version of a flow I found online for a nest-like thermostat.

I use 2 BigTimer nodes to set the daily demand temperatures M-F and 2 nodes for the weekend - they all feed into the same demand temperature node.

The demand temperature is a global.

I have other flows detecting our presence based on phone connection to the wifi. Depending on if we leave or arrive, the demand temperature can be changed.

I have other variables that determine whether heating automation is on or off, presence detection is on or off, away mode (if we're away from the house) is on or off - in that case the demand temperature from the timers is ignored and a static demand temperature is used as an override.

I have a dashboard dial that can be used to manually change the demand temperature, but also have made myself some esp32 based touch screen devices to allow manual incrementing of the demand temperature - they also send room temperature data back to the mqtt server - which the heating flow averages and uses to determine the house actual temperature.

To avoid repeatedly turning the boiler on and off based on temperature values - I only allow the boiler to receive a command every 10 minutes from the flow, but if the demand temperature is changed by the user, then the demand temperature is changed immediately and the boiler receives an on/off command instantly.

As someone else on the thread said - everyone does this differently - but these ideas may help you think of things that will work for you.

Thanks this sounds similar to what I am trying to do. The standard thermostat is too basic. Would i be able to get a copy of your code if possible?


I've tidied it up a little and added some comment nodes

Other features I have included
The heating flow checking an email account so that you can email your heating or hot water to come on (for a 2 or 4 hour period) - I have a vpn, but this is a fallback.

My heating and hot water switches are flashed with Tasmota. In the winter I activate Tasmota rules that mean that if the switches lose contact with either the mqtt server or the wifi then they turn on - better to use a little bit of fuel than have burst pipes when away in case of a rpi crash or other failure - my system would then rely on the boiler thermostat and thermostatic radiator valves.

I've about 20 large flows for my home automation - and they are interlinked - I'll post something that you can use as a starting point based on my heating/hot water flow.

The nest-like thermostat stuff is based on this (or similar)
I changed mine a little as I've no AC.

Flow was too big to post here so I had to add a link.

Hope it's of use and understandable - it evolved over a number of years.

1 Like

Thanks, I'll get a look at it this week and see how it f goes.

if the flow is to big instead of doing that with google drive
see picture
when exporting flow select download instead of copy to clipboard. Then go to your download folder and rename to something that makes sense.
here is my temperature contorls for my fermenter room.
Keep in mind im using an esp8266 with a ds18b20 temp sensor Tasmota is flashed to my esp8266 and i have a pressure sensor to monitor co2 pressure and i have controls for a solenoid valve which is what i physically use to control a temperature of a fermenter.
myfermenters.json (55.9 KB)

Thanks for the tip

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.