🔥 Advanced Heating Control

Hey, sadly this is not part of this blueprint. Since every trv works different. Most tuya TRVs for example has an +/- 1.5°C window around the target temperature. It means if you targeting 20°C some TRVs close the valves at 18.5°C.

Some trvs provide the attribute of the valve position. (0-100%) If this is your case you can use it for an automation to toggle your boiler switch. Otherwise you have to use an external sensor or the current_temperature of your TRVs.

You can start with this for a new automation:

  1. Create an new automation, press the upper right button and enable yaml mode. Then copy paste this:
description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - sensor.livingroom_temperature
  - platform: state
    entity_id:
      - sensor.bathroom_temperature
condition: []
action:
  - if:
      - condition: numeric_state
        entity_id: sensor.bathroom_temperature
        below: input_number.bathroom_comfort_temperature
      - condition: numeric_state
        entity_id: sensor.livingroom_temperature
        below: input_number.livingroom_comfort_temperature
    then:
      - service: switch.turn_on
        data: {}
        target:
          entity_id: switch.boiler
    else:
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.boiler

Now you can switch back to UI-Mode. Try to understand the automation and just add/edit your entities. Hope it helps.

Thanks for taking the time to help me with this automation I really appreciate.

Currently I have Tuya TRVs, installing a Tuya thermostat on my boiler instead of my relay switch would allow me to fully use your blueprint?

You can keep your relay and create with help of an external temperature sensor a generic thermostat:

After its done you can add it to your automation based on this blueprint.
Dont use external sensor for calibration. This could result in errors. First have to check my code. If you want to use calibration you have to setup two automations. One for your trvs with calibration and one for your generic thermostat without calibration. Entities for temperature, scheduler and persons should be the same.

I understood well, thanks again for your time and your explanations!

I’ve updated the blueprint. Now the automation can handle climates with and without calibration entities. Feel free to test and have a look in your logs after some time. :wink:

1 Like

Hi!

I am quite new with HA and automations and just started a couple weeks ago. Your automation seems to work quite well, but I am wondering why the automation gets triggered/is running every 2 minutes.

Edit: sometimes it runs again after just a couple of seconds, sometimes after 3, 4 minutes.

Any suggestions are very much appreciated.

Cheers
Pete

1 Like

Thanks for your feedback! Since there are many optional entities I use template triggers, which trigger the automation every time state gets updated. I will check and optimize it. But I think it doesn’t have a disadvantage for battery e.g. battery life. Maybe I’ll have some time over the weekend.

Ah ok, sounds great. Thought I had done something wrong at my end (misconfig of HA, or something messed up in the automation).

Cheers
Pete

Hey, I’ve updated the blueprint. For some reason person entities get frequently status updates even if the state don’t changed. It’s now fixed.

UPDATE CHANGES

  • trigger optimization for minimized trigger frequency
  • set number service for calibration now only gets called when the old calibration value differs from the new
1 Like

First, thank you very much for this great Blueprint. It’s exactly what I was looking for. After implementing it for my TRV (Aqara) in the living room I found this in my Logs.

Is this something I should be afraid of or can it be ignored? :slight_smile:

Second question. How about different Time Schedules. Before I used four different Schedules per day. Night, Morning, Afternoon and Evening. During the night the TRVs are off, In the morning 22° Afternoon 20 and evening 18. With your Blueprint I can only have one temperature for one schedule which is actually 7:30-21 Uhr. I can adjust the schedule to different time slots but what happens if I want to have different temperatures over the day? Any ideas or tips?

thx for helping
Benjamin

Check your blueprint configuration. You have to provide an input_number helper for the comfort temperature. The state is in your case ‘unknown’.

That is maybe an solution for your 2nd problem. Just create an automation which sets the comfort temperature input_number dependent of time. Something like this (Create new Automation → dont save → open yaml mode and paste this → switch back to ui mode):

description: ""
mode: single
trigger:
  - platform: time
    at: "07:00:00"
    id: morning
  - platform: time
    at: "16:00:00"
    id: afternoon
condition: []
action:
  - if:
      - condition: trigger
        id: morning
    then:
      - service: input_number.set_value
        data:
          value: 22
        target:
          entity_id: input_number.erdgeschoss_wohlfuehltemperatur
  - if:
      - condition: trigger
        id: afternoon
    then:
      - service: input_number.set_value
        data:
          value: 20
        target:
          entity_id: input_number.erdgeschoss_wohlfuehltemperatur

Problem 1 solved. Reason was that I renamed the helper without changing it in the automation config.

Problem 2 solved. This works for me!

Question: I recognized that your Blueprint sets TRVs to “off” if a window is open. This works for my Aqara TRVs but not for my Eurotronics and Danfoss because they don’t have the “Off” Option. In NodeRed I solved this by setting the temperature as low as possible if a window is open. Could this maybe be also an option for your Blueprint?

Can you share the feature set of the entities from the developer tools?

E.G.

This is one of my Danfoss Ally thermostats. I also have a Eurotronics where off, auto, heat is available but Z2M shows an Error when trying to turn it off. I think this is more a Z2M Problem so it could be ignored here. But the Danfoss TRV is a good example for Thermostats which have only heat mode. maybe this is also because of the implementation in Z2M but. Don’t know.

Thank you very much. Installed the update. Will post, if I see something strange.

Need to figure out why the Fairphone of my girlfriend doesn‘t update localisation data.

Thanks again for the update.

1 Like

My wifes pixel 6a had problem with location service, too. Just clear data and cache in settings, uninstall, reinstall and check this guide. Hope it helps.

As a workaround you could use nmap or the router integration or other device tracker to scan for devices in your network. You can map that devices to persons, too. Or you create a 2nd virtual person for that case.

1 Like

Hey, checkout the blueprint again. Now the trvs will be seperated in a group with and without off mode. If mode is ‘off’ the trvs without off mode will be set to the min_temp, in your case 5 degrees.

UPDATE CHANGES

  • support for trvs without off mode → if off trvs will be set to minimum temperature
  • fix issue when scheduler turns off
2 Likes

Hi,

first thank you for this awesome automation. Just one Question regarding the off mode. I have Aqara TRVs and there is a off mode but it doesnt work (its a known problem). How can i force the automation to use the 5°C instead?

Kind regards
Sebastian

That shouldn’t be a big thing:

Check this out for testing.

If this works for you I gonna merge that into the main branch.
There is an additional option which let force all TRVs to min temperature if enabled and window is open.

Waiting for your feedback. :wink:

Thanks for the fast reply. Sadly it didnt work. I used the new switch to force the TRV to 5°C but nothing happens as soon as i open the window. When i switch it off, the TRV goes to “off” again as usual. Maybe this helps?

* Heating Control Test: If at step 1: If at step 1: Error executing script. Error for repeat at pos 1: Error rendering data template: ValueError: Template error: float got invalid input 'None' when rendering template '{{ off_temperature | float }}' but no default was specified
* Heating Control Test: If at step 1: Error executing script. Error for if at pos 1: Error rendering data template: ValueError: Template error: float got invalid input 'None' when rendering template '{{ off_temperature | float }}' but no default was specified
* Heating Control Test: Error executing script. Error for if at pos 1: Error rendering data template: ValueError: Template error: float got invalid input 'None' when rendering template '{{ off_temperature | float }}' but no default was specified```