šŸ”„ Advanced Heating Control

@panhans First Iā€˜m appreciate your great workā€¦
Honestly Iā€™m still not very familiar with HAS and even if I setup some automations and stuff like that I guess thereā€™s is a lot more what I need to learn.

Iā€™m preparing my TRVā€™s to push them to the next level and would like to automate them completely. Iā€™m using the HomeaticIP with Raspberrymatic and the HomematicIP (Local) integration.

I have some questions about your blueprint.
I have installed an outdoor temperature sensor. I could set a temperature when the heating should start if the temperature is below 15Ā°C it should start heating.
My question is, is it possible to set a delay for, letā€™s say 2 days?
So if the temperature falls below to 15Ā°C and stay for 2 days then heating will start. The reason is to prevent that the TRVā€™s not going on or off all the time when the temperature just stays for one day below the given threshold.

Second question is: I have also room temperature sensors and I would like that the Hmip TRVā€™s goes off if the room temperature sensor reached the given room temperature set in the Comfort or Eco mode. As I understand this is part of calibration. The Hmip thermostat doesnā€™t have a calibration entity nor offset entities. Is there another possibility to implement that the heating start / stop depending of the room temperature sensor?

Sorry for my worse English but I hope you got a clue of what Iā€™m talking about. Thanks in advance. Thanks for the great work

I would setup the selector with general name like

  • Holiday
  • General

For switching the schedule the name only have to match partially. For your Office

  • Office General
  • Office Holiday

For livingroom:

  • Livingroom General
  • Livingroom Holiday

If the selector doesnā€™t match the automation should fallback to the first specified scheduler. Like this you can setup on selector for room dependent schedules.

1 Like

Atm. this is not possible but still a good idea. There is one reason why this is difficult and this is related to how home assistant sets entity attributes like last_changed or last_updated. The problem is with every restart these two attributes will be set to the current time. So the automation will start counting the days from zero with every restart.

The only way to realize this is to setup a binary template sensor which checks the temperature like {{ states('sensor.your_temp_sensor') < 15 }}. Count the days by using a history stats sensor which measures the duration of your template sensor if itā€™s on (below 15Ā°) :

platform: history_stats
name: Days Below 15
entity_id: binary_sensor.your_new_template_sensor
state: "on"
type: time
start: "{{ now() - timedelta(days=2) }}"
end: "{{ now() }}"

And then you need another template sensor that checks the state of your history sensor again {{ state('sensor.your_history_sensor') >= now() - (now() - timedelta(days=2)) }}

And this 3rd sensor can be used as the boolean entity to toogle you automation. A little bit complicated but possible.

You can enable generic calibration so the difference will be added directly to the target temperature. So if your thermostat is set to 20Ā° but there is a difference to your room sensor (22Ā°) of 2Ā° your thermostat temperature will be corrected to 18Ā°C. Thatā€™s something you have to keep in mind.

1 Like

@panhans

Blockquote
And this 3rd sensor can be used as the boolean entity to toogle you automation. A little bit complicated but possible.

I was guessing that this will not be an easy task. Any chance to get this implentet in a future
version of your Blueprint? :stuck_out_tongue:

Blockquote
You can enable generic calibration so the difference will be added directly to the target temperature. So if your thermostat is set to 20Ā° but there is a difference to your room sensor (22Ā°) of 2Ā° your thermostat temperature will be corrected to 18Ā°C. Thatā€™s something you have to keep in mind.

Not sure if o got it right, so it means if the room temperature sensor measures 22Ā° and the thermostat is set to 20Ā° the heating temperature will set to 18Ā°?

But if i set the temperature to 22Ā° but the room temperature is, lets say 18Ā° it will heat until the room temperature measure 22Ā° room temperature?

Nope, there is no way to get into the history data of a sensor using templates (blueprint code). But with the next release statistics sensors can be added over the UI. That means:

  1. You can easily setup a sensor that holds the maximum temperature in a time window for the last two days.

  2. Then you can add a binary sensor (also in the helper section) based on a threshold easily, e.g. on if the maximum is lower than 15Ā°C

And this 2nd sensor can be used as the on/off entity for your automations. So wait until the next release and if you need help just get in touch with me.

There are these values:

  • Thermostat Temperature Sensor Tthermostat
  • External Temperature Sensor Texternal
  • Target Temperature: Ttarget

If you set a new target temperature the difference between the two sensor values will be calculated:

Tdif = Tthermostat - Texternal

e.g.

Tthermostat = 20
Texternal = 22
Tdif = 20 - 22
Tdif = -2

This difference will be added to your target temperature and will be used for the set temperatureof your thermostats.

TnewTarget = Ttarget + Tdif

e.g.

Ttarget = 20
TnewTarget = 20 + (-2)
TnewTarget = 18

Since your room is at 22Ā° with a target of 20Ā° the new target temperature will be corrected to 18Ā°. This will be checked with every change of Texternal or Tthermostat. So every time the values of the sensors change.

Hello,
I would like to say ā€œTHANKS A LOTā€ for your effort and dedication!

I am relatively new to home assistant and more so to AHC, so I have some questions even after trying to follow this long post and the documentation.
I am using the Version 4.2.9

  1. I would like to change the Eco temp when I am on vacation and away for a longer time. But I was not able to select an input_number entity in the Eco temp field.
    (the entity I made could however be selected in the comfort temp field).
    Did I overlook something?
  2. Do I need this at all or would the Frost protection work for me already setting this to the desired away temp of say 15Ā° ( to protect from mold), as persons are defined but no presence detection or proximity?
  3. The Log Level currently defaults to ā€œdebugā€, should I leave it there or better change the setting?
  4. I would be interested in a function to move the valves of the thermostat during the non-heating time. Is it worth to spend the time to generate an automation using ā€œForce Max Tempā€, or is that function on the way already anyways (was requested by someone else already).
  5. I would like the heating to use the same schedule on national holidays as on Sundays. Is there a simple way to get to this?
    Currently I am using a separate scheduler with the same setting every day, that I have in the normal schedule on Sundays. Selection is done by a sensor based on the workday integration.

I would be very glad to get some help.
Best regards,
Martin

I have an additional question, I just figured out, that my automation from point 1. above does only partly work. It changes number but not input_number

alias: Urlaub
description: ""
trigger:
  - platform: calendar
    event: start
    entity_id: calendar.urlaub
condition: []
action:
  - if:
      - condition: template
        value_template: "{{ 'Urlaub' in trigger.calendar_event.summary }}"
    then:
      - service: number.set_value
        data:
          value: "16"
        target:
          entity_id:
            - number.thermostat_bad_eco_temperature
            - input_number.heizung_in_eco_oder_urlaub
    else:
      - service: number.set_value
        data:
          value: "17"
        target:
          entity_id:
            - number.thermostat_bad_eco_temperature
            - input_number.heizung_eco_oder_urlaub        
mode: single

this will change the value of
number.thermostat_bad_eco_temperature
but not of
input_number.heizung_eco_oder_urlaub
why is that the case?

Hi and youā€™re welcome. :slight_smile:

I can not reproduce this behavior. Iā€™d also double checked the blueprint selector and everything seems fine. Did you tried it after a home assistant restart, too?

Frost protection will work for you. No need for proximity or presence detection. If you select persons and setup your frost protection temperature and duration the target will be set if nobody is home for the selected duration.

Thanks for the hint. I fixed this and set the default log level warning.

Atm this is not planned till the most thermostats do this by itā€™s own. (except generic, diy ones) Which thermostats do you use? Maybe I should put this to the planned feature list again. (?)

I would suggest a calendar based selector. Just have a look in the first post of this thread. There is an example to setup a calendar based sensor. But you have to setup an sensor and not a binary_sensor. Let me know if I can help:

If there is no event ā†’ default schedule is selected
If there is an event partly matches ā€œholidayā€ ā†’ holiday scheduler is selected
If there is an event from the national holiday calender ā†’ national holiday scheduler is selected (configured like yours - same schedule for each day)

Thanks for your fast reply.

I thought I did restart, but as it now works, perhaps I did not.
So fixed!

Great, one headache less!

I have Tuya TV02-Zigbee.
If they have this function, than another headache less.

OK, I will give it a go.
How did you get the entries for the national holidays in your calendar?

Best regards,
Martin

Regarding this manual there is an anti-calcification protection.

I personally use the google calendar integration. But this should work with other calendar integrations, too. So I simply opened up google calendar in my desktop browser. You can find many ICS based calendars for state/nation dependent holidays in the internet.
You just have to import it into your calendar and after a home assistant synchronization it appears in home assistant automatically.

Thanks.
I had a look at the manual, but have clearly missed it (8.10).

OK, I am already using a local calendar for waste, which is automatically updated.
Will try the same approach here.

1 Like

Hello, I would like to create a heating program for my different radiators.

I want the temperature program to be set in the lovelace UI Dashboard (and not in automation).

Iā€™m creating a view that shows the program for all the rooms.

My idea would be to take the ā€œAdvanced HEating controlā€ automation as a base, and to take the ā€œScheduleā€ Custum Card, so as to be able to enter the various values in an internal variable and enter it in ā€œAdvanced HEating controlā€.

For example, the schedule would be for:

Monday to Thursday heating (20Degrees) from 16h to 22h, from 22h to 6h 18degrees ; 6h to 8h 20 Degrees 8h to 16 16 Degrees ( 3 temperature possibilities)

Friday heating (20Degrees)from 12h to 8h

Samedia Dimache (20Degrees) all day

Iā€™d like the clearest possible view of ā€œlovelaceā€ (which is not yet the case).

If you have any ideas, Iā€™d love to hear from you:

This custom schedule component isnā€™t supported by this blueprint. But there is a possibility to use it.
At least you have to decide if you go person or/and presence based. Setup your automation without any scheduler but with entities for comfort and if you want eco temperature.
You can set this entities using the custom schedule component. If you just want static heating without any detection you can simply setup an entity for eco temperature only or go with an entity for comfort heating and set a boolean entity for presence detection that is always on.

Thanks for the quick reply :slight_smile:

As you can see in the screenshot above left, itā€™s a bit of a disaster on the dashboard view.
For a single thermostat, I have a large card that takes up too much space and doesnā€™t have a nice overview. The view of the card is really strange on my dashboard :confused:

1 more question:
How do you proceed at night if you want to lower the bedroom by 2 degrees when you sleep and also lower the unoccupied rooms by 4 degrees, for example?

thx !

Hiā€¦I need to understand how the eco temperature and comfort temperature workā€¦could someone explain to me?

Okay, that clarify everything. Sorry for the delay but my job occupied me all the time. So I will wait for the next stable release and if I run in problems, Iā€™ll let you know.

Thank you for your support and patience

Iā€™ve created this blueprint to forget about my heating plans. I personally just provide a slider for the comfort temperature in the ui. Everything else is controlled dynamically by the blueprint based automation. I set it up once and forget about it.

I go for scheduled heating till the early evening and switch over to presence based heating until the morning. Both methods combined with person detection using our smartphones. As a presence sensor I just check if lights still on in the specific rooms. When turning the lights off when going to bed, heating falls back to eco temperature. Iā€™ve set up one automation per room.

The automation set this two temperatures as target temperature depending to your setup.

Person based:

  • is somebody home ā†’ comfort is set
  • nobody is home ā†’ eco is set

Same for presence or time scheduled configuration.

Oh, itā€™s already there. :wink:

Thx for answer

Witsch card on the dashboard do you use for the ā€œscheduled heatingā€ ?
Can you send me screenshot to see that ?

for me, a presence heater is not too suitable because you have to wait a bit for the heater to reach temperature, and small children donā€™t have smartphones yet.

As I said. I donā€™t integrate the schedulers in the UI. I also donā€™t use the custom schedule component and go with the schedule entities that comes with home assistant out of the box. There is no need to change the schedule when the automation compensates changes automatically.

At least you can go with a device that is just on when your kids at home. Or you just go with scheduled heating for that rooms and opt out with help of calendar entries. You need an idea how your heating plan should work, if it should react dynamically if someone is or is not in the room and how you can figure out if a room is occupied.

Hello, ive just updated to version 4.2.9 and now my Logs are full of entrys. Can Someone tell me what it means:

Logger: blueprints.panhans.heatingcontrol
Quelle: components/system_log/__init__.py:333
Erstmals aufgetreten: 19:06:38 (96 Vorkommnisse)
Zuletzt protokolliert: 19:11:11

AHC REF CHANGES: climate.thermostat_bad_ug -> off -> 17.0
AHC REF TRIGGER is_calibration: False is_changes: True is_reset: False is_refresh_comfort_entity: False proximity: is_somebody_on_way_home_state: False proximity_entities: [] entry: {'time': '19:00', 'comfort': '17'} entry_time: 2024-07-08 19:00:00+02:00 entry_comfort_temp: 17 new_comfort_temperature: None is_refresh_comfort_entity: False state_mode_winter: True state_mode_party: False state_mode_guest: False state_outside_temp: False state_force_max_temperature: False state_window: False state_temperature_comfort: 17.0 active_scheduler: None is_person_based: False is_anybody_home: False is_somebody_on_way_home_state: False is_presence_sensor_defined: True is_presence_scheduler_defined: False state_presence_sensor: True state_presence_scheduler: False is_presence_on: True is_scheduled_heating: False state_scheduler: False is_scheduled_heating_on: False is_somebody_on_way_home: False is_frost_protection: False state_temperature_min: 17.0 set_comfort: True mode: off temperature: 17.0 is_physical_change: False is_calibration: False changes: {'climate.thermostat_buero': [{'mode': 'off', 'temp': 17.0}]} valves_tado: [] calibration_tado: {} valves_xiaomi: [] calibration_xiaomi: {} valves_external_sensor: [] calibration_external_sensor: {} valves_calibration_common: ['climate.thermostat_buero'] calibration_common: {} is_heating: False is_metric: True input_hvac_mode in ['cool','heat']: True
AHC REF change_count: 1 changes: {'climate.thermostat_buero': [{'mode': 'off', 'temp': 17.0}]}
thermostat: climate.thermostat_buero mode: off new_target: 17.0 current_target: 13.0
AHC REF CHANGES: climate.thermostat_buero -> off -> 17.0
1 Like