🔥 Advanced Heating Control

i tested it without the calibration, and the result is the same, looks like that the calibration didn’t work for me! And it looks like that the external sensor wouldn’t be used! If i set the target temp to 22 and the temperature sensor of the trv say 22 than the valve close, indipendently if the roomsensor is 18 or 20 or something else!

Could you update the dev blueprint, refresh your automations and share a trace again?

I switched one room to generic calibration for a test and it works immediately. I want to know what the difference is. :smiley:

installed the new dev and created a trace for you :slight_smile: https://file.io/Jfbe8gG82BrT
IT seems that nothing changed!

1 Like

Did you enabled :arrow_up_down: Off If Above/Below Room Temperature? If not could you upload a trace log again?

//EDIT: Could you paste following code into your template editor, please? And edit your thermostat and key word for the calibration entity. (Just the first two lines.)

{% set valves = ['climate.YOUR_THERMOSTAT'] %}
{% set input_calibration_key_word = 'YOUR_KEY_OF_CALIBRATION_ENTITY' %}

{% set manufacturer = 'Danfoss' %}
{% set value_temperature_sensor = 5 %}
{% set is_difference_popp_calibration = true %}
{% set is_periodical_popp_calibration = true %}
{% set current_time_stamp = now() %}
{% set is_rounded_values = false %}
{% set is_aggressive_mode_calibration = false %}

{% set valves_danfoss = valves | select('is_device_attr', 'manufacturer', manufacturer) | list %}

{% set n = namespace(dict=[]) %}

{% for valve in valves_danfoss %}

  {% set calibration_entity = device_entities(device_id(valve)) |
                              expand | selectattr('domain','in','number') |
                              selectattr('entity_id', 'search', input_calibration_key_word) |
                              map(attribute='entity_id') | first %}

  {% set min_val = state_attr(calibration_entity,'min')%}
  {% set max_val = state_attr(calibration_entity,'max')%}
  {% set step = state_attr(calibration_entity,'step')%}
  {% set current_temp = state_attr(valve,'current_temperature') | float(20) %}

  {% set new_state = value_temperature_sensor | float(current_temp) %}
  {% set old_state = states(calibration_entity) | float %}

  {% if is_aggressive_mode_calibration %}           
    {% set temp_diff = state_attr(valve,'temperature') | float(temperature) - value_temperature_sensor %}

    {% if temp_diff * factor < input_aggressive_mode_range * -1 %}
      {% set new_state = new_state + input_aggressive_mode_offset * factor %}
    {% elif temp_diff * factor > input_aggressive_mode_range %}
      {% set new_state = new_state - input_aggressive_mode_offset * factor %}
    {% endif %}
  {% endif %}

  {% if step <= 1 and max_val | string | count < 4 %}
    {% set round_size = iif('.' in (step | string) and not is_rounded_values, (step | string).split('.')[1] | length, 0) %}
    {% set new_state = ((new_state | float(0) / step) | round(0) * step) | round(round_size) | float %}
  {% else %}
    {% set new_state = new_state * 100 | int %}
    {% set old_state = old_state | int %}
  {% endif %}

  {% set update_calibration = false %}

  {% if is_periodical_popp_calibration %}
    {% set last_updated = [calibration_entity] | expand | map(attribute='last_updated') | first %}
    {% set update_calibration = as_datetime(current_time_stamp) - timedelta(minutes=20) >= last_updated %}
  {% endif %}

  {% if is_difference_popp_calibration %}
    {% set update_calibration = old_state != new_state %}
  {% endif %}

  {% if update_calibration %}
    {% set n.dict = n.dict + [(calibration_entity, [{'value': new_state, 'valve': valve}])] %}
  {% endif%}

{% endfor %}

Danfoss Thermostats: {{ valves_danfoss | join(',') }}
Calibration Changes: {{ n.dict }}
Calibration Entity: {{ device_entities(device_id(valves_danfoss | first)) |
                        expand | selectattr('domain','in','number') |
                        selectattr('entity_id', 'search', input_calibration_key_word) |
                        map(attribute='entity_id') | first}}
1 Like

I have had an instance of it jumping to 5C as well (Min instead of Off is activated as well) when I arrived home yesterday (People sensor).
I blamed the ‘Sync’ feature for it, but was not able to reproduce yet.

image

Sry, I’ forget to push the changes. Could you do it again?

Im Testing the aggressiv Mode, but the value dont be added, trace follows tomorrow (blueprint up2date)

Ok, I currently did a change to generic calibration / aggressives mode reference temperature. Tests were positive. Feel free to update, check and give feedback.

ok, here is it again (with the dev from 19:33) :slight_smile: https://file.io/n8p9Pm2GkVxQ
And as i can see now it looks much better :slight_smile:

1 Like

Finally! :sweat_smile:

Not for me ^^

1 Like

as i can say the calibration delta (0,3) didn’t trigger the automation!
actually the roomtemp is 21,6, comfort temp is set to 21,5. but the target temp is still 25!
aggressiv mode is disabled! her is a trace for that! https://file.io/bEMOmVfYosG7

1 Like

No, the “off if above” tweak is not activated.

Here’s the result:

Danfoss Thermostats: climate.thermostat_bad_thermostat_2
Calibration Changes: [('number.thermostat_bad_external_calibration', [{'value': 5.0, 'valve': 'climate.thermostat_bad_thermostat_2'}])]
Calibration Entity: number.thermostat_bad_external_calibration

And here’s the trace. I’m still on the previous dev version from late afternoon.
https://controlc.com/a8918e96

Thank you!

There is an issue with the liming protection where it is interpreting the set time the wrong way. When I set it to ‘12:00:00’ it goes off every hour at *:12:00 on the set day.

1 Like

Thanks for reporting. It’s fixed in the latest dev version.

Still did it.

1 Like

Can you post your blueprint configuration in yaml? Maybe home assistant shortens the time string. I need to check this.

alias: 🔥 Advanced Heating Control
description: ""
use_blueprint:
  path: panhans/advanced_heating_control_dev.yaml
  input:
    input_temperature_eco: input_number.temp_preset_eco
    input_trvs:
      - climate.0x54ef4410007f487b
    input_temperature_sensor: sensor.0x842712fffe387925_temperature
    input_temperature_comfort_static: 21
    input_temperature_eco_static: 16
    input_temperature_comfort: input_number.temp_preset_comfort
    input_min_instead_of_off: true
    input_persons:
      - person.person
    input_people_entering_home_duration:
      hours: 0
      minutes: 0
      seconds: 10
    input_people_leaving_home_duration:
      hours: 0
      minutes: 5
      seconds: 0
    input_presence_sensor: input_boolean.comfort_heating
    input_windows:
      - binary_sensor.fenster_contact
    input_windows_reaction_time_open:
      hours: 0
      minutes: 0
      seconds: 30
    input_windows_reaction_time_close:
      hours: 0
      minutes: 3
      seconds: 0
    input_calibration_delta: 0.1
    input_calibration_key_word: external
    input_mode_outside_temperature: weather.pirateweather
    input_window_legacy_restore: false
    input_window_open_temperature: 0
    input_physical_change: false
    input_liming_protection: false
    input_liming_protection_day: Fri
    input_liming_in_winter: true
    input_liming_protection_time: "12:00:00"

1 Like

Thank you just update the blueprint. Was my fault. :wink:

The delta has no impact when using generic calibration but there was an issue with the trigger evaluation. It’s fixed now. Please update the blueprint again! Sorry for that inconvenience.