Heating X2: Schedule Thermostats with Calendars

Introduction

The Heating X2 blueprint, with the accompanying optional Code Generator, offers comprehensive heating control for systems from a single thermostat up to a full smart home heating system with multiple thermostats grouped by room and zone.

Heating X2 can stand alone or be used as part of the suite than includes Calendar switch Y2: switch a device using a calendar, and Zone Switch Z2: operate a heating zone valve from a heat demand sensor

Features

  • Schedule by calendar: set the temperature of each room with a local calendar and as many heating events as you like
  • Multiple thermostats: One or more thermostats per room: multiple thermostats are synchronised together. Works with smart TRVs, any smart thermostat, or Generic Thermostat
  • Manual override: a change on the thermostat, dashboard or by voice assistant remains in effect for a defined period (default 2 hours)
  • Door or window open: turns off heating in the room if any door or window is left open for a defined period (default 3 minutes) – optional list of zero or more closure sensors.
  • Occupancy: turns off heating if a room is left unoccupied for a defined period (default 1 hour) – optional list of zero or more motion or human presence sensors.
  • Warmup period: occupancy is ignored for a defined period at the start of a calendar event (default 2 hours)
  • Away mode: sets all rooms to a temperature specified per room (default 5C) when there is no one at home
  • Background temperature: used when there is no calendar event (default 5C but specified separately from the frost and away temperatures)
  • Zone control: can switch one or multiple heating zone valves, or a boiler that needs a heat demand switch, based on heat demand from a group of thermostats
  • Notifications: if thermostats do not respond to a new setting, go offline, or come back online
  • Logging: optional recording of key events from the heating automations into a log file
  • Robust: Graceful degradation when a thermostat or a sensor is offline
  • Battery-efficient: conserves TRV battery life by only transmitting real changes
  • Code generator: uses Microsoft WORD Mail Merge to automatically generate YAML code for all the required helpers, timers, log files, template sensors, groups, automations, and dashboard cards from a single EXCEL spreadsheet that lists your zones, rooms and thermostats

For one or two thermostats, you can use the Heating X2 blueprint stand-alone and create automations from it in the UI in the usual way.

If you are setting up a complete smart home heating system with multiple rooms, and have WORD and EXCEL, then you should try the accompanying Code Generator – see below.

If you have multiple heating zones, or a boiler that needs a heat demand signal, code generator created sensors and groups, and the Zone Switch Z2 blueprint complete the kit.

History

Heating X, the first release, was published on the Home Assistant Community Forum and GitHub in February 2023. This new release Heating X2 (Heating X, release 2) follows a year of testing Heating X in two homes with several rooms each, and feedback from users of the first release.

Installation

Get the Heating X2 Blueprint

Heating X2 is published separately from Heating X because it is not ‘plug compatible’ – the inputs have changed so it is not just a matter of changing the code.

New users should adopt release 2 straightaway. Existing release 1 users should consider upgrading, but a new install will be required. Note however, that the release 2 code generator now includes the generation of the automations. The new blueprint has a different name Heating X2, so can co-exist with Heating X.


Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
Or use this link to access the code manually in GitHub.


One instance of Heating X2 is required for each Room in your house that is equipped with smart TRVs, and further instances can be used for other types of thermostat that you want to control with a calendar.

It is designed for HVAC-heating and uses the Centigrade temperature scale, but could doubtlessly be adapted for air conditioning (HVAC-cooling) or to work in Fahrenheit.

Get the Heating XYZ Log File Entry script

The blueprint requires a script that facilitates the formatting and writing of the log file(s). (More on logging below). It is mandatory, even if you do not want logging, because the test for logging required is included in the script to declutter the blueprint.

It is not a blueprint, just a script, so the recommended installation method is:


  1. Create the file scripts.yaml in /CONFIG/ if you do not already have it
  2. In configuration.yaml add the following line if you do not already have it
script: !include scripts.yaml
  1. Copy the heating_xyz_logfile_entry code from GitHub
  2. Paste the code into scripts.yaml

The same script is used by Heating X2, Calendar Switch Y2, and Zone Switch Z2, so you only need do this once.


Devices

Thermostats

Heating X2-based automations can control anything with domain ‘climate’, so physical smart thermostats such as TRVs, water heaters, or Generic Thermostats that for example links a temperature sensor with a heater that has a smart plug.

A room can have more than one Thermostat; multiple thermostats in the same room operate in tandem, synchronised to the same settings.

You can name the thermostats as you wish, but for a large installation you might want to follow the Code Generator’s recommended names.

Door or Window Opening Sensors (optional)

If you have installed contact sensors or similar (with device class ‘opening’), you can list them in the blueprint input.

Then, if any door or window is open for a defined period of time (default 3 minutes), the automation turns the heating to the minimum (frost) setting. When all doors and windows are closed the heating reverts to normal.

If a sensor goes offline, it is treated as showing ‘closed’. If you have no closure sensors at all, Heating X2 automations will act as if all doors and windows are always closed.

Occupancy Sensors (optional)

If you have installed one or more sensors with device class ‘occupancy’, such as PIR motion sensors or human presence sensors, you can list them in the blueprint input.

Then, if all of these report ‘clear’ for a defined period of time (default 1 hour), the room is considered unoccupied. If the room is not in a warmup period (see below) the automation will turn the heating to the background setting. When any one presence sensor reports ‘detected’ the room is considered occupied and the heating reverts to normal.

If a sensor goes offline, it is treated as showing ‘detected’. If you have no sensors at all, Heating X2 automations will act as if the room is always occupied.

Calendars

Heating X2 uses Local Calendars to program the thermostat(s) for each room, one calendar per room.

For each automation (room or individual device such as water heaters), create a calendar using the Home Assistant Local Calendar integration (you need Home Assistant 2022.12.1 or later).

You can name the Thermostats as you wish, but for a large installation you might want to follow the Code Generator’s recommended names.

Heating X2 will probably also work with external calendars linked to Home Assistant, but I have never tested that.

Add an Event to the calendar for each period that you want to specify a temperature that is different from the background temperature (see below). Take care to put it in the right calendar as the integration tends to give you the wrong one by default.

  • In the Summary field put the title of the event as you want to appear on the dashboard in the reason text – e.g., “ Daytime setting”, “ Night setting”, “ Evening boost”. I recommend including the room name as an aid to picking up errors.

  • In the Description field, add the required temperature for this event anywhere between two hashes: e.g., “Set temperature to #21.5# C”. Do not use another hash before the one that introduces the temperature, or write anything else between the hashes. The value and step size should correspond to the devices you are using. The Blueprint checks that there is a valid temperature and reports any errors in the reason text.

  • Set the Event start and end times as usual. Consecutive events are allowed and the automation will transition directly from one to the other. Overlapping events are allowed. The event with the latest start time takes precedence.

  • Set the events to Repeat daily or on specific days of the week as required.

Helpers and Timers

The blueprint requires a number of helpers and timers, which are used as global variables. The simplest method to set these up for a large installation is to use the Code Generator. If you cannot or do not want to use the Code Generator, you can create the helpers by hand for each automation (Room) that you are going to create with the blueprint.

Input Text

  • Setting reason – into which the automation writes the reason for the current setting for display on dashboards. Make the length 255 characters.

Input_numbers

  • Manual temperature – into which the automation writes the temperature specified by manual override.

  • Required temperature – into which the automation writes the temperature currently set for the room (to optimise radio traffic and check response)

Timers

  • Manual override timer – which the automation uses for the time remaining for a manual intervention before it reverts to automatic

  • Warmup timer – which the automation uses for the time for the warmup period following a new calendar event

  • Door or window open timer – which the automation uses for the time until the heating will be turned off following a door or window opening (paused when they are all closed)

  • Room unoccupancy timer – which the automation uses to count down the time until the heating will be turned off following the room becoming unoccupied (paused when the room is occupied)

  • Echoblock timer – which the automation uses to time the response from a thermostat before checking its setting, and to distinguish manual changes to the set temperature from those made by the automation.

Logging

Logging is optional, so skip this step if you do not want it. The default blank in the blueprint logging service name indicates that no logging is required.

To enable logging

  1. If you want to keep your log fles in a folder, then add the folder to /CONFIG/ – in my example it is called log_files.
  2. In configuration.yaml add an entry for each automation like this
      notify:
        - name: immersion_heater_log 
          platform: file
          filename: log_files/immersion_heater_log.txt
          timestamp: true 
  1. Specify the service name (not the file name), exactly as defined, in the blueprint parameters (below). In my example the name is immersion_heater_log

The Automations

For a large installation this can best be done by using the Code Generator. The automations can (and should) be edited in the UI afterwards.

If you prefer to create the automations by hand, create one automation for each room (or other devices controlled by one calendar) using the UI. Select the Blueprint Heating X2 and specify in the inputs the devices, calendar, helpers and timers described above. There are also some optional parameters


Blueprint Parameters

At the time of creating the automation you can specify a number of parameters, i.e. fixed values for the Room. They all have defaults (which are also what the code generator will set), so you might want to skip this step at first and come back to them later.

  • Minimum thermostat temperature – the minimum temperature that your thermostat can be set to; a.k.a. frost setting. Default 5C.

  • Maximum thermostat temperature – the maximum temperature that your thermostat can be set to. Default 30C. (Would have to be set higher for a water heater, say 70C).

  • Manual override period – the time period for which a manual intervention will override the schedule. Default 2 hours.

  • Warmup period – the period of time from the start of a new event for which room unoccupancy will be ignored. Default 2 hours.

  • Door or window open delay time – the time for which a door or window can be open before the heating switches off. Default 3 minutes.

  • Room unoccupancy delay time – the time for which no presence in the room is detected before it is consider unoccupied. Default 1 hour.

Additional goodies

Template Sensors for Set and Measured Temperatures

The Code Generator provides optional template sensors for each thermostat to read the Set Temperature and the Measured (ambient) Temperature. The Heating X2 blueprint does not require these, but they are included in the code generator in case you want them for display on dashboards or as inputs to other automations.

There is a new, third template binary sensor called Heat Demand that can be used for zone control.

Starter Dashboard

Dashboards can be complex for a large heating installation. They having nothing to do with the Blueprint, but a starter dashboard for a whole home heating control installation can be created using the Code Generator.

My starter dashboard has a card for each Room that has a vertical stack with the name of the room as its title, the thermostat(s) for that room, the reason text as a markdown card (because the text is too long for a regular text entity) and the manual override timer (so that it can be reset). See the picture at the top of this page.

I use Mushroom Cards and the Better Thermostat card, so if you want to use this card design, you need to import both of them first from HACS or change the dashboard code to use standard cards.

The code generator creates YAML for these example cards for every Room. That code can be used as a whole to make a complete View containing all your Rooms and Thermostats (in the order you listed them for the Code Generator), or you can select the code for each Room individually to place the cards separately on your dashboard. Once pasted in (either way), the dashboard and the card can be edited with the UI.

While testing, you might like to add some more of the helper and timer entities to the dashboard cards, so that you can better see what is going on. Adding timers allows them to be cancelled from the dashboard as well.

More details

The guide “Smart Heat Your Home with Heating XYZ”, with hardware and software configuration tips and detailed instructions for using the code generator, is bundled with the Code Generator download.

Good Luck!

:+1:

2 Likes

Hi @AndySymons

Thanks for your Blueprint, much appreciated! I just started playing with it and it took me an hour before i discovered that your “Import Blueprint” link above actually links to heating x instead of heating_x2. I had a bit of trouble to get it to a state where no errors are shown :wink: I would ask you to consider changing that.

Also in the generator for the input_text i would ask you to consider to change from “No reason yet set” (quotation marks probably messed up by Word itself) to a simple No reason yet set. While this is overwritten soon anyway, it just doesn’t look perfect :slight_smile:

Lastly in the generator for templates there are two single quotation mark missing after the Thermostat entity names in the last line. Look for:

state: "{{ float(state_attr('climate.«Thermostat_entity_name», 'temperature'),0) > float(state_attr('climate.«Thermostat_entity_name», 'current_temperature'),99) }}" # false if either sensor is unavailable

replace by:

state: "{{ float(state_attr('climate.«Thermostat_entity_name»', 'temperature'),0) > float(state_attr('climate.«Thermostat_entity_name»', 'current_temperature'),99) }}" # false if either sensor is unavailable

Also that generator for templates generates a lot of empty templates on my configuration (doesn’t happen with the others).

I’ll report back once i had it running for a couple days :slight_smile:

Cheers,
Uli

Oops, I thought I had already fixed that. I found the error a while ago (6 Feb) and fixed the github link, but somehow failed to fix the HA link. I thought I had tested both but evidently dropped a stitch somewhere :astonished: :face_with_open_eyes_and_hand_over_mouth:

My apologies for the inconvenience. Thanks for commenting, and I look forward to hearing more about your installation.

Note that the latest version is from today 22 Feb. The 19 Feb update is needed to get around some timing problems with the calendar that I have now reported in Local Calendar timing issues . The last update just removes some diagnostic text that I had forgotten about and will create errors because you will not have my diagnostic helpers.

DONE and uploaded to the repository.
Thanks for the comment.

Again thanks. DONE and uploaded to the repository.

What do you mean by an ‘empty template’?
Do you have blank lines in your data worksheet? You should delete any lines that do not have a thermostat name.

24 Feb 2024: Release 2.1.

Compatible with 2.0 and with same name Heating X2

This version has a more robust approach to handling the calendar to ensure that consecutive events are never missed without the need to run every minute. Now any number of overlapping events are allowed; the one with the latest start time takes precedence.

See also the thread Local Calendar feature request 5 - Recognise overlapping events

First of all: What a blueprint!!! Very nice work!!!

That being said, i’ve found a bug :slight_smile:
The setting_reason is not set on action “# ACTION[4].CHOOSE[5]. If there is no active calendar event” (line number 867). It seems the value is to long


ps: share a 'buy me a coffee link" please :wink:

1 Like

Thank you for the kind words. I’ll look into the coffee thing :slight_smile:

It works fine in my setup but you do have to make sure the input_text.<room>_setting_reason is set to 255 characters (the maximum) as it defaults to 100, which is indeed too short (page 9 in the guide “Smart Heat Your Home with Heating X2 ”).

If you defined it in the UI, the field is “maximum length”.

If you use handmade YAML, you use the max: key, like this:

input_text:

### Kitchen heating
  kitchen_heating_setting_reason:
    name: Kitchen heating setting reason
    max: 255
    initial: “”
    icon: mdi:card-text-outline

The above is how it is defined by YAML from the code generator

I hope that helps!

1 Like

27 Feb 2024: Release 2.2.

Compatible with 2.1 and with same name Heating X2.

This release adds the option to log key events from the automations created by the blueprint into one or more log files. This helps track down anomalies like TRVs not responding correctly.

The log file content looks like this.

Heating X2 notifications (Log started: 2024-02-27T13:42:10.558298+00:00)
--------------------------------------------------------------------------------
2024-02-27T13:42:10.558335+00:00 ---
2024-02-27T13:42:10.564862+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-27T13:42:15.695047+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' set to 20.0
2024-02-27T13:42:15.703642+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' is already set to 20.0
2024-02-27T13:42:15.708166+00:00 [Parlour heating control] New state: Set manually to 20.0.
2024-02-27T13:42:20.695623+00:00 ---
2024-02-27T13:42:20.700644+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-27T13:42:20.742891+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-27T13:42:45.008107+00:00 ---
2024-02-27T13:42:45.010569+00:00 [Parlour heating control] Triggered by: echoblock_timer_end
2024-02-27T13:42:45.051430+00:00 [Parlour heating control] The thermostat 'Parlour north TRV' is set correctly.
2024-02-27T13:42:45.054353+00:00 [Parlour heating control] The thermostat 'Parlour south TRV' is set correctly.
2024-02-27T13:42:52.420332+00:00 ---
2024-02-27T13:42:52.425302+00:00 [Parlour heating control] Triggered by: manual_override_end
2024-02-27T13:43:28.606181+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' set to 21.0
2024-02-27T13:43:32.987376+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 21.0
2024-02-27T13:43:32.995748+00:00 [Parlour heating control] New state: Set to 21.0 by calendar event 'Parlour Daytime' until Tue 27 Feb 2024 at 18:30.
2024-02-27T13:43:33.610287+00:00 ---
2024-02-27T13:43:33.616708+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-27T13:43:33.687466+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-27T13:43:38.188684+00:00 ---
2024-02-27T13:43:38.193401+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-27T13:43:38.234533+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-27T13:44:02.017457+00:00 ---
2024-02-27T13:44:02.021264+00:00 [Parlour heating control] Triggered by: echoblock_timer_end
2024-02-27T13:44:02.357930+00:00 [Parlour heating control] The thermostat 'Parlour north TRV' is set correctly.
2024-02-27T13:44:02.360491+00:00 [Parlour heating control] The thermostat 'Parlour south TRV' is set correctly.
2024-02-27T18:30:00.007832+00:00 ---
2024-02-27T18:30:00.009144+00:00 [Parlour heating control] Triggered by: calendar_event_end
2024-02-27T18:30:05.939880+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' set to 22.0
2024-02-27T18:30:08.989503+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 22.0
2024-02-27T18:30:08.996066+00:00 [Parlour heating control] New state: Set to 22.0 by calendar event 'Parlour evening ' until Tue 27 Feb 2024 at 22:00.
2024-02-27T18:30:09.000783+00:00 ---
2024-02-27T18:30:09.005298+00:00 [Parlour heating control] Triggered by: calendar_event_start
2024-02-27T18:30:09.069108+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 22.0
2024-02-27T18:30:09.536088+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 22.0
2024-02-27T18:30:09.545442+00:00 [Parlour heating control] New state: Set to 22.0 by calendar event 'Parlour evening ' until Tue 27 Feb 2024 at 22:00.
2024-02-27T18:30:10.943223+00:00 ---
2024-02-27T18:30:10.944410+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-27T18:30:10.986450+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-27T18:30:14.128470+00:00 ---
2024-02-27T18:30:14.132698+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-27T18:30:14.175860+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-27T18:30:39.008876+00:00 ---
2024-02-27T18:30:39.010089+00:00 [Parlour heating control] Triggered by: echoblock_timer_end
2024-02-27T18:30:39.053471+00:00 [Parlour heating control] The thermostat 'Parlour north TRV' is set correctly.
2024-02-27T18:30:39.056236+00:00 [Parlour heating control] The thermostat 'Parlour south TRV' is set correctly.
2024-02-27T20:30:09.008655+00:00 ---
2024-02-27T20:30:09.015909+00:00 [Parlour heating control] Triggered by: warmup_timer_end
2024-02-27T20:30:09.089932+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 22.0
2024-02-27T20:30:09.092705+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' is already set to 22.0
2024-02-27T20:30:09.095222+00:00 [Parlour heating control] New state: Set to 22.0 by calendar event 'Parlour evening ' until Tue 27 Feb 2024 at 22:00.
2024-02-27T22:00:00.011358+00:00 ---
2024-02-27T22:00:00.037822+00:00 [Parlour heating control] Triggered by: calendar_event_start
2024-02-27T22:00:03.420337+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' set to 12.0
2024-02-27T22:00:08.535682+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 12.0
2024-02-27T22:00:08.559073+00:00 [Parlour heating control] New state: Set to 12.0 by calendar event 'Parlour Night' until Wed 28 Feb 2024 at 07:30.
2024-02-27T22:00:08.565311+00:00 ---
2024-02-27T22:00:08.569164+00:00 [Parlour heating control] Triggered by: calendar_event_end
2024-02-27T22:00:08.643776+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 12.0
2024-02-27T22:00:30.100260+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 12.0
2024-02-27T22:00:30.108363+00:00 [Parlour heating control] New state: Set to 12.0 by calendar event 'Parlour Night' until Wed 28 Feb 2024 at 07:30.
2024-02-27T22:00:30.111418+00:00 ---
2024-02-27T22:00:30.112608+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-27T22:00:30.155065+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-27T22:00:30.158329+00:00 ---
2024-02-27T22:00:30.159762+00:00 [Parlour heating control] Triggered by: warmup_timer_end
2024-02-27T22:00:30.199954+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 12.0
2024-02-27T22:00:30.203240+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' is already set to 12.0
2024-02-27T22:00:30.205153+00:00 [Parlour heating control] New state: Set to 12.0 by calendar event 'Parlour Night' until Wed 28 Feb 2024 at 07:30.
2024-02-27T22:00:34.333885+00:00 ---
2024-02-27T22:00:34.340983+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-27T22:00:34.383639+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-27T22:01:00.011257+00:00 ---
2024-02-27T22:01:00.012819+00:00 [Parlour heating control] Triggered by: echoblock_timer_end
2024-02-27T22:01:00.055970+00:00 [Parlour heating control] The thermostat 'Parlour north TRV' is set correctly.
2024-02-27T22:01:00.058758+00:00 [Parlour heating control] The thermostat 'Parlour south TRV' is set correctly.
2024-02-28T07:30:00.015433+00:00 ---
2024-02-28T07:30:00.025182+00:00 [Parlour heating control] Triggered by: calendar_event_start
2024-02-28T07:30:04.759621+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' set to 21.0
2024-02-28T07:30:10.083307+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 21.0
2024-02-28T07:30:10.098945+00:00 [Parlour heating control] New state: Set to 21.0 by calendar event 'Parlour Daytime' until Wed 28 Feb 2024 at 18:30.
2024-02-28T07:30:10.101409+00:00 ---
2024-02-28T07:30:10.102720+00:00 [Parlour heating control] Triggered by: calendar_event_end
2024-02-28T07:30:10.149496+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 21.0
2024-02-28T07:30:10.151623+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' is already set to 21.0
2024-02-28T07:30:10.153771+00:00 [Parlour heating control] New state: Set to 21.0 by calendar event 'Parlour Daytime' until Wed 28 Feb 2024 at 18:30.
2024-02-28T07:30:10.157245+00:00 ---
2024-02-28T07:30:10.158888+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-28T07:30:10.194724+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-28T07:30:10.197321+00:00 ---
2024-02-28T07:30:10.198439+00:00 [Parlour heating control] Triggered by: warmup_timer_end
2024-02-28T07:30:10.240994+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 21.0
2024-02-28T07:30:10.243243+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' is already set to 21.0
2024-02-28T07:30:10.246427+00:00 [Parlour heating control] New state: Set to 21.0 by calendar event 'Parlour Daytime' until Wed 28 Feb 2024 at 18:30.
2024-02-28T07:30:15.093700+00:00 ---
2024-02-28T07:30:15.094737+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-28T07:30:15.133083+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-28T07:30:40.007602+00:00 ---
2024-02-28T07:30:40.008518+00:00 [Parlour heating control] Triggered by: echoblock_timer_end
2024-02-28T07:30:40.061523+00:00 [Parlour heating control] The thermostat 'Parlour north TRV' is set correctly.
2024-02-28T07:30:40.066456+00:00 [Parlour heating control] The thermostat 'Parlour south TRV' is set correctly.
2024-02-28T18:30:00.010891+00:00 ---
2024-02-28T18:30:00.013384+00:00 [Parlour heating control] Triggered by: calendar_event_start
2024-02-28T18:30:04.206154+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' set to 22.0
2024-02-28T18:30:09.924292+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 22.0
2024-02-28T18:30:09.939754+00:00 [Parlour heating control] New state: Set to 22.0 by calendar event 'Parlour evening ' until Wed 28 Feb 2024 at 22:00.
2024-02-28T18:30:09.942450+00:00 ---
2024-02-28T18:30:09.944293+00:00 [Parlour heating control] Triggered by: calendar_event_end
2024-02-28T18:30:10.008756+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 22.0
2024-02-28T18:30:21.742637+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 22.0
2024-02-28T18:30:21.757913+00:00 [Parlour heating control] New state: Set to 22.0 by calendar event 'Parlour evening ' until Wed 28 Feb 2024 at 22:00.
2024-02-28T18:30:21.764873+00:00 ---
2024-02-28T18:30:21.769632+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-28T18:30:21.826857+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-28T18:30:21.829936+00:00 ---
2024-02-28T18:30:21.831264+00:00 [Parlour heating control] Triggered by: warmup_timer_end
2024-02-28T18:30:21.872852+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 22.0
2024-02-28T18:30:21.875211+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' is already set to 22.0
2024-02-28T18:30:21.876652+00:00 [Parlour heating control] New state: Set to 22.0 by calendar event 'Parlour evening ' until Wed 28 Feb 2024 at 22:00.
2024-02-28T18:30:21.878782+00:00 ---
2024-02-28T18:30:21.880169+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-28T18:30:21.916086+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-28T18:30:51.014656+00:00 ---
2024-02-28T18:30:51.018545+00:00 [Parlour heating control] Triggered by: echoblock_timer_end
2024-02-28T18:30:51.061281+00:00 [Parlour heating control] The thermostat 'Parlour north TRV' is set correctly.
2024-02-28T18:30:51.063501+00:00 [Parlour heating control] The thermostat 'Parlour south TRV' is set correctly.
2024-02-28T22:00:00.014070+00:00 ---
2024-02-28T22:00:00.038935+00:00 [Parlour heating control] Triggered by: calendar_event_start
2024-02-28T22:00:06.103095+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' set to 12.0
2024-02-28T22:00:13.712699+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 12.0
2024-02-28T22:00:13.717110+00:00 [Parlour heating control] New state: Set to 12.0 by calendar event 'Parlour Night' until Thu 29 Feb 2024 at 07:30.
2024-02-28T22:00:13.719742+00:00 ---
2024-02-28T22:00:13.721198+00:00 [Parlour heating control] Triggered by: calendar_event_end
2024-02-28T22:00:13.765074+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 12.0
2024-02-28T22:00:16.449866+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' set to 12.0
2024-02-28T22:00:16.454016+00:00 [Parlour heating control] New state: Set to 12.0 by calendar event 'Parlour Night' until Thu 29 Feb 2024 at 07:30.
2024-02-28T22:00:16.456211+00:00 ---
2024-02-28T22:00:16.458077+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-28T22:00:16.496773+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-28T22:00:16.499232+00:00 ---
2024-02-28T22:00:16.500812+00:00 [Parlour heating control] Triggered by: warmup_timer_end
2024-02-28T22:00:16.540195+00:00 [Parlour heating control] Thermostat 'Parlour north TRV' is already set to 12.0
2024-02-28T22:00:16.542812+00:00 [Parlour heating control] Thermostat 'Parlour south TRV' is already set to 12.0
2024-02-28T22:00:16.544741+00:00 [Parlour heating control] New state: Set to 12.0 by calendar event 'Parlour Night' until Thu 29 Feb 2024 at 07:30.
2024-02-28T22:00:21.082915+00:00 ---
2024-02-28T22:00:21.084223+00:00 [Parlour heating control] Triggered by: set_temperature_change
2024-02-28T22:00:21.130322+00:00 [Parlour heating control] Set temperature ignored during echo block period
2024-02-28T22:00:46.015276+00:00 ---
2024-02-28T22:00:46.019413+00:00 [Parlour heating control] Triggered by: echoblock_timer_end
2024-02-28T22:00:46.058860+00:00 [Parlour heating control] The thermostat 'Parlour north TRV' is set correctly.
2024-02-28T22:00:46.061249+00:00 [Parlour heating control] The thermostat 'Parlour south TRV' is set correctly.

By default logging is turned off. See the updated guide “Smart Heat Your Home with Heating X2 (v2.2)” (bundled with the code generator) for details of how to set up logging.

Thx, I should have read the **** manual :slight_smile:

1 Like

You need to optimize the blueprint optic :see_no_evil:

What do you mean by ‘blueprint optic’?

The Look of the blueprint, to overload in first look in my oppinion.

Check Cover Control or advanced heating

1 Like

Indeed the deletion of empty lines helps - ignore my issue :slight_smile:

1 Like

It is a large blueprint (over 1000 lines now) and precisely for that reason I have laid it out to be easily legible (for me). Of course you can delete blank lines and comments if you wish, but I do not see how that is an improvement? :thinking:

What I have done in an effort to improve comprehensibility is add an overview in the comments at the start of the file:

### OVERVIEW 
### The main action steps are as follows. 
### The numbering correspnds to that used by the system log for error messages.  
### ACTION[0] -- LOG THE TRIGGER. Starts a new log file entry by writing a bank line and the trigger id 
### ACTIONS[1-3] -- FETCH THE CURRENT AND NEXT CALENDAR EVENTS 
###              Calls calendar.get_events twice, then sets local variables for later use 
### ACTION[4] -- RESPOND TO TRIGGERS WHERE NECESSARY. A big choose statement on the trigger_id. 
### ACTION[5] -- DETERMINE THE REQUIRED TEMPERATURE ACCORDING TO THE STATE. A big chooose statement on the relevant states variables.
###              Decides what teperature is required and why. Sets the 'required temperature' helper and the 'reason test' helper. 
### ACTION[6] -- SEND TEMPERATURE CHANGE TO THE THERMOSTATS
###              Loops through all the thermostats for the room. If the required temperature is 
###              different from the actual one, the service call to change it is invoked and the echoblock (response timerout) timer started. 
### ACTION[7] -- LOG THE REASON. Writes the last line of the log file entry 

You also get a nice picture of how it works if you look at the trace of one of the automations that use it.

Does that help?


 nevertheless, for anyone else who misses this, I have now added code to check whether the max length is set to 255 before attempting to write anything. If it is less than 255, an error messge is written to the ‘setting reason’ instead. :upside_down_face:

Minor updates to version 2.2.

None of these affect the basic functionality. Following a period of beta-testing, measures are taken to increase robustness in case of device failures and anomalies, i.e. avoid automation failures and system log errors, improve notifications and logging.

  • 01-Mar-2024: 2.2.01. Code added to check that the ‘setting reason’ input_text helper has a max length of 255 characters. Default is 100, which is too short. If not set to 255, an error message is written into the ‘setting reason’.
  • 02-Mar-2024: 2.2.02. Added an id to the away_switch_on and _off triggers, now separated, for logging purposes
  • 05-Mar-2024: 2.2.03. Added detail to the trigger line of the log entries
  • 08-Mar-2024: 2.2.04. Correct trigger line of the log entries when calendar event triggers have no entity_id
  • 09-Mar-2024: 2.2.05. Tidied up logic of ACTION[6] using choose, to ensure there is always a log message
  • 09-Mar-2024: 2.2.06. Warmup timer reset only if nothing is scheduled (previously sometimes premature with consecutive events)
  • 09-Mar-2024: 2.2.07. Improved notifications. Additional unknown and offline every time a setting is needed. Dismissed when online. Only ever one notification per device.
  • 09-Mar-2024: 2.2.08. Now ignores false ‘set temperature change’ from a device when it goes unavailable, and other out of range (false) temperature settings
  • 13-Mar-2024: 2.2.09. Added ‘continue_on_error’ and ‘parallel’ to thermostat service call, ‘continue_on_error’ to logs and notifications to better cope with device errors
  • 14-Mar-2024: 2.2.10 Thermostat available trigger time increased and now resets manual override, because sometimes TRVs go offline for just a few seconds (might be a ZHA glitch?)
1 Like