Timer based Heating system

Ive had a look around on occasion, and never found a complete option for a central heating system, that has adjustable timers, weekday and weekend settings, and the stuff youd like from a HIVE like system.

I have a Sonoff basic controlling the heating as a switch, and a DHT11 connected to a sonoff in my lounge, to give me my heating zone which is the area i use to base my heating on.

I use Input Select to set my timers, Input Number to set my temperatures and have ’
binary sensor’ set up to tell me if we are on a weekday or a weekend. Climate is set for the lounge, and i have created a sensor which has a long convuluted check, to tell me which part of the week we are in. these checks are based on the Input select timers, and the binary sensor.

The output of my sensor is then used for an automation. When the sensor value changes, an automation sets the climate based on its output.
To top it off, ive set up an Alexa skill to be able to do all of this via voice.

Ive placed all of my YAML code into one set of code which is below. As i have separated my config, it will all need placing in its own areas in your own config, should you choose to give all of this a go.

In due course, I will post a link to my whole configuration!

Heres my YAML,

#####################
#  binary sensor:   #
#####################

  - platform: workday
    country: 'UK'
    name: 'workday_today'

#########
#boolean#
########


vacation_mode:
  name: Holiday Mode
  initial: off
school_holidays:
  name: School Holiday Mode
  initial: off


#################
## Input_number  ##
#################
    
  morning_temp:  
    name: Morning Heating Level
    initial: 16
    min: 13
    max: 20
    step: 1

  evening_temp:
    name: Evening Temperature
    initial: 16
    min: 13
    max: 20
    step: 1
    
  daytime_temp:
    name: Daytime Temperature
    initial: 12
    min: 12
    max: 20
    step: 1 

  nighttime_temp:
    name: Overnight Temperature
    initial: 12
    min: 12
    max: 20
    step: 1        
    
  holiday_temp:
    name: Vacation Temperature
    initial: 14
    min: 12
    max: 16
    step: 1      
    
    
    
##################################
# Heating mode sensor   ###########
###################################

#sensor:
  - platform: template
    sensors:
      current_heating_mode:
        friendly_name: "Heating mode"
        value_template: >-
            {% if is_state('binary_sensor.workday_today', 'on') and ( states.sensor.time.state >= states.input_select.weekday_morn_on.state ) and (  states.sensor.time.state <= states.input_select.weekday_morn_off.state) %} weekday morning
            {% elif is_state('binary_sensor.workday_today', 'on') and ( states.sensor.time.state >= states.input_select.weekday_morn_off.state ) and (  states.sensor.time.state <= states.input_select.weekday_eve_on.state) %} weekday daytime
            {% elif is_state('binary_sensor.workday_today', 'on') and ( states.sensor.time.state >= states.input_select.weekday_eve_on.state ) and (  states.sensor.time.state <= states.input_select.weekday_eve_off.state) %} weekday evening
            {% elif is_state('binary_sensor.workday_today', 'on') and ( states.sensor.time.state >= states.input_select.weekday_eve_off.state ) and (  states.sensor.time.state <= '23:59') %} weekday overnight
            {% elif is_state('binary_sensor.workday_today', 'on') and ( states.sensor.time.state >= '00:00') and (  states.sensor.time.state <= states.sensor.time.state <= states.input_select.weekday_morn_on.state) %} weekday overnight
            {% elif is_state('binary_sensor.workday_today', 'off') and ( states.sensor.time.state >= states.input_select.weekend_morn_on.state ) and (  states.sensor.time.state <= states.input_select.weekend_morn_off.state) %} weekend morning
            {% elif is_state('binary_sensor.workday_today', 'off') and ( states.sensor.time.state >= states.input_select.weekend_morn_off.state ) and (  states.sensor.time.state <= states.input_select.weekend_eve_on.state) %} weekend daytime
            {% elif is_state('binary_sensor.workday_today', 'off') and ( states.sensor.time.state >= states.input_select.weekend_eve_on.state ) and (  states.sensor.time.state <= states.input_select.weekend_eve_off.state) %} weekend evening
            {% elif is_state('binary_sensor.workday_today', 'off') and ( states.sensor.time.state >= states.input_select.weekend_eve_off.state ) and (  states.sensor.time.state <= '23:59') %} weekend overnight
            {% elif is_state('binary_sensor.workday_today', 'off') and ( states.sensor.time.state >= '00:00') and (  states.sensor.time.state <= states.sensor.time.state <= states.input_select.weekend_morn_on.state) %} weekend overnight
            {% endif %}    
            
            
            
###############
## Input_select  ##
###############
# by leaving out initial, the time is restored from recorder

weekday_morn_on:
  name: 'Morn On'
  icon: mdi:timer
  #initial: '06:30'
  options:
    - '06:00'
    - '06:15'
    - '06:30'
    - '06:45'
    - '07:00'
    - '07:15'
    - '07:30'
    - '07:45'
    - '08:00'
    - '08:15'
    - '08:30'
    - '08:45'
    - '09:00'
    - '09:15'
    - '09:30'
    - '09:45'
    - '10:00'
weekday_morn_off:
  name: 'Morn Off'
  icon: mdi:timer-off
  #initial: '07:00'
  options:
    - '07:00'
    - '07:15'
    - '07:30'
    - '07:45'
    - '08:00'
    - '08:15'
    - '08:30'
    - '08:45'
    - '09:00'
    - '09:15'
    - '09:30'
    - '09:45'
    - '10:00'
    - '10:15'
    - '10:30'
    - '10:45'
    - '11:00'      

    
weekday_eve_on:
  name: 'Eve On'
  icon: mdi:timer
  #initial: '16:30'
  options:
    - '15:00'
    - '15:15'
    - '15:30'
    - '15:45'
    - '16:00'
    - '16:15'
    - '16:30'
    - '16:45'
    - '17:00'
    - '17:15'
    - '17:30'
    - '17:45'
    - '18:00'
    - '18:15'
    - '18:30'
    - '18:45'
    - '19:00'
    - '19:15'
    - '19:30'
    - '19:45'
    - '20:00'
    - '20:15'
    - '20:30'
    - '20:45'
    - '21:00'
    - '21:15'
    - '21:30'
    - '21:45'
    - '22:00'
    - '22:15'
    - '22:30'
    - '22:45'
    - '23:00'
    - '23:15'
    - '23:30'
    - '23:45'
    - '00:00'    
    
weekday_eve_off:
  name: 'Eve Off'
  icon: mdi:timer-off
  #initial: '17:00'
  options:
    - '15:00'
    - '15:15'
    - '15:30'
    - '15:45'
    - '16:00'
    - '16:15'
    - '16:30'
    - '16:45'
    - '17:00'
    - '17:15'
    - '17:30'
    - '17:45'
    - '18:00'
    - '18:15'
    - '18:30'
    - '18:45'
    - '19:00'
    - '19:15'
    - '19:30'
    - '19:45'
    - '20:00'
    - '20:15'
    - '20:30'
    - '20:45'
    - '21:00'
    - '21:15'
    - '21:30'
    - '21:45'
    - '22:00'
    - '22:15'
    - '22:30'
    - '22:45'
    - '23:00'
    - '23:15'
    - '23:30'
    - '23:45'
    - '00:00'    
    
weekend_morn_on:
  name: 'Morn On'
  icon: mdi:timer
  #initial: '08:30'
  options:
    - '06:00'
    - '06:15'
    - '06:30'
    - '06:45'
    - '07:00'
    - '07:15'
    - '07:30'
    - '07:45'
    - '08:00'
    - '08:15'
    - '08:30'
    - '08:45'
    - '09:00'
    - '09:15'
    - '09:30'
    - '09:45'
    - '10:00'

      

weekend_morn_off:
  name: 'Morn Off'
  icon: mdi:timer-off
  #initial: '09:30'
  options:
    - '07:00'
    - '07:15'
    - '07:30'
    - '07:45'
    - '08:00'
    - '08:15'
    - '08:30'
    - '08:45'
    - '09:00'
    - '09:15'
    - '09:30'
    - '09:45'
    - '10:00'
    - '10:15'
    - '10:30'
    - '10:45'
    - '11:00'      

    
weekend_eve_on:
  name: 'Eve On'
  icon: mdi:timer
  #initial: '16:00'
  options:
    - '15:00'
    - '15:15'
    - '15:30'
    - '15:45'
    - '16:00'
    - '16:15'
    - '16:30'
    - '16:45'
    - '17:00'
    - '17:15'
    - '17:30'
    - '17:45'
    - '18:00'
    - '18:15'
    - '18:30'
    - '18:45'
    - '19:00'
    - '19:15'
    - '19:30'
    - '19:45'
    - '20:00'
    - '20:15'
    - '20:30'
    - '20:45'
    - '21:00'
    - '21:15'
    - '21:30'
    - '21:45'
    - '22:00'
    - '22:15'
    - '22:30'
    - '22:45'
    - '23:00'
    - '23:15'
    - '23:30'
    - '23:45'
    - '00:00'  
  
      

weekend_eve_off:
  name: 'Eve Off'
  icon: mdi:timer-off
  #initial: '19:00'
  options:
    - '15:00'
    - '15:15'
    - '15:30'
    - '15:45'
    - '16:00'
    - '16:15'
    - '16:30'
    - '16:45'
    - '17:00'
    - '17:15'
    - '17:30'
    - '17:45'
    - '18:00'
    - '18:15'
    - '18:30'
    - '18:45'
    - '19:00'
    - '19:15'
    - '19:30'
    - '19:45'
    - '20:00'
    - '20:15'
    - '20:30'
    - '20:45'
    - '21:00'
    - '21:15'
    - '21:30'
    - '21:45'
    - '22:00'
    - '22:15'
    - '22:30'
    - '22:45'
    - '23:00'
    - '23:15'
    - '23:30'
    - '23:45'
    - '00:00'
2 Likes

I’m starting to look into smart heating now too, currently I have an ugly RF thermostat/timer combo (868mhz and rolling code so I can’t intercept it).

I’m interested in how you have the sonoff controlling the Boiler? As it would solve my problem!

I’m looking into creating zoned heating using thermal actuators on the radiators (should be able to do each radiator for around £20!) But I want to be able to start up the boiler if you manually override the new TRVs which currently I can’t do…

From what you’ve explained above this would be a great framework to build off for my system, once I sort out my boiler issue… :smiley:

from my boilers circuit diagram, the interconnection for timers and thermostats are just a series circuit, allowing the live signal to reach the far end and activate the boiler. from the diagram attached, i use liveSupply (Ls) Neutral, and send the output back to Lr Live return.

boiler wiring diagram

I have a live and neutral feeding in to the boiler, and i just take the live output, and feed it into the far end of the above circuit. What are thermal actuators? (i’ll google it!) ive seen wifi thermostats, but not thermal actuators.
Happy to assist.!

That’s great, I’ll need to take a look how my current thermostat is wired in (I’m not very electrical minded…).

I planned on using these:


Which are two wire normally closed, and M30 thread, so should screw straight onto where the existing TRV is on your radiator (provided youve had valves in the last few years).

Wire those into/through a Sonoff, and into a 13amp plug (downside = you lose a plug, and it must be near the radiator).

You can then put a random temp sensor of your choice into the room, and then get home assistant to turn power off to the radiator when the room is up to temp (you could even wire in a PIR to the sonoff so if there is motion in the room it will turn the radiator on).

As a bonus I plan on using the button on the sonoff to act as an override so if it’s a lot colder outside and you feel chilly, you can press the sonoff button and it will turn on the boiler and radiator for an hour or so, or until its a few degrees warmer.

Sorry that the above is a wall of text! It’s just a concept at the moment, but I can’t see why it wouldn’t work?
One thing to note is that it can take around 3 mins to turn the rads on/off with these valves so may need to offset the temp that turns them on/off by a degree or two to stop the room getting too hot.

1 Like

You perhaps should look at heaty, now re-released as schedy.

I’ve had a look and it all looks quite complex. Personally I’m happy with a few bits of yaml, which achieve my aim. Maybe it will look simpler after a longer in depth look.