Closed tttopuz closed 1 month ago
So I did some more testing, and it seems that VT does not read out the current temp of the TRV in the right way. Disabling the option "use internal temp of underlying" does somehow provide better results, because it ignores the current temp. I want to test what current temp VT is using in its calculations, but I'm not sure how to.
If I look at your attribute, I see that you don't use the internal temp of the underlying: auto_regulation_use_device_temp: false
.
But you tells in your last post that : "when turned off, it is better". But it is already off.
When reading the first post, I would tell: "turn the use of internal temp" to on. Maybe I don't understand exactly what you mean.
In a general manner, when you need to tune your VTherm, I need some regulation curve like explain in the template of the issue. Without it I can't do anything.
If it is releveant to regulation performance or optimisation some curves are needed
To have a great curves demonstrating what you think is a problem, please install and configure what is described here: [Even better with Plotly to tune your Thermostat](https://github.com/jmcollin78/versatile_thermostat/issues/535#even-better-with-plotly-to-tune-your-thermostat)
Thank you for your answer and your time.
These new TRV's have an internal temperature that are a lot (4 degrees or more) lower than the real temperature. In some way it seems that the VTherm has a hard time with this.
In this example and the example in the first post, the heating should be off because the actual room temperature is 19.2 and the set temperature is 18.2. However, the value that is given to the underlying TRV is 17,5, which is higher than the internal temperature of 16. At the end of the post I will write the attributes, to see that I am using the option of use internal temperature.
hvac_modes: off, heat
min_temp: 7
max_temp: 35
target_temp_step: 0.2
preset_modes: none, frost, eco, comfort, boost
current_temperature: 19.2
temperature: 18.2
hvac_action: heating
preset_mode: none
is_on: true
hvac_mode: heat
type: null
is_controlled_by_central_mode: true
last_central_mode: null
frost_temp: 7
eco_temp: 12
boost_temp: 7
comfort_temp: 18
frost_away_temp: 0
eco_away_temp: 0
boost_away_temp: 0
comfort_away_temp: 0
power_temp: null
target_temperature_step: 0.2
ext_current_temperature: 10.7
ac_mode: false
current_power: null
current_power_max: null
saved_preset_mode: comfort
saved_target_temp: 17.90000000000001
saved_hvac_mode: null
motion_sensor_entity_id: null
motion_state: null
power_sensor_entity_id: null
max_power_sensor_entity_id: null
overpowering_state: null
presence_sensor_entity_id: null
presence_state: null
window_state: off
window_auto_state: off
window_bypass_state: false
window_sensor_entity_id: null
window_delay_sec: null
window_auto_enabled: false
window_auto_open_threshold: null
window_auto_close_threshold: null
window_auto_max_duration: null
window_action: window_turn_off
security_delay_min: 60
security_min_on_percent: 0.5
security_default_on_percent: 0.1
last_temperature_datetime: 2024-10-13T20:47:38.784299+02:00
last_ext_temperature_datetime: 2024-10-13T20:40:34.173843+02:00
security_state: false
minimal_activation_delay_sec: 299
device_power: 1
mean_cycle_power: null
total_energy: 15.41
last_update_datetime: 2024-10-13T20:49:08.475747+02:00
timezone: Europe/Amsterdam
temperature_unit: °C
is_device_active: true
ema_temp: 18.86
is_used_by_central_boiler: false
is_over_climate: true
start_hvac_action_date: 2024-10-13T20:44:57.738837+02:00
underlying_climate_0: climate.trv_kinderkamer_thermostat
underlying_climate_1: climate.trv_kinderkamer_voor_thermostat
underlying_climate_2: null
underlying_climate_3: null
is_regulated: true
regulated_target_temperature: 17.5
auto_regulation_mode: auto_regulation_strong
regulation_accumulated_error: -7.298828124999986
auto_fan_mode: auto_fan_none
current_auto_fan_mode: auto_fan_none
auto_activated_fan_mode: null
auto_deactivated_fan_mode: null
auto_regulation_use_device_temp: true
friendly_name: Kinderkamer Thermostaat
supported_features: 401
Luckily, I have found an option to change the offset of the current temperature in the entity of the TRV in Home Assistant itself. Now the current temperature shows as an higher value, closer to the real room temperature. VTherm handles this better somehow and the TRV is off when it should be off. See picture below.
Still, there is an additional problem that the TRV is not heating if the set temperature is only a little bit above the current temperature. As you can see in the picture below, the Vtherm does set the TRV set temperature, at around 00:00, 2:00 and 5:00. However, the TRV itself is not heating. This is maybe because the difference is too low? Is there a way to increase/exaggerate this value to force the TRV to heat?
An additional problem here, is that there are two TRV's in this room, and I would like to either have them both on or both off, to increase efficiency of the heating system. Is there a way to enforce this? Because in this example, the other TRV was heating at the times that the difficult TRV was not.
This is the history of the VTherm itself:
Hello,
With this attribute auto_regulation_use_device_temp: true
, this should not be an issue for VTherm that internal temperature is wrong.
Maybe you should use the VTherm card https://github.com/jmcollin78/versatile-thermostat-ui-card (available in HACS) so that you will instant access to the regulated temperature calculated by VTherm.
This is maybe because the difference is too low? Is there a way to increase/exaggerate this value to force the TRV to heat?
You have 2 threshold to avoid sending too much command to your TRV and empty the battery. It is named regulation threshold and minimal period of regulation:
But use it carfully else you will drawn your battery in one week. With over_climate
(your case) you have to do a compromise between comfort (and temperature stabilization) and battery saving.
An additional problem here, is that there are two TRV's in this room, and I would like to either have them both on or both off, to increase efficiency of the heating system. Is there a way to enforce this? Because in this example, the other TRV was heating at the times that the difficult TRV was not.
VTherm can control up to 4 devices. You can configure that in the 'underlying' configuration page. It should does exactly what you need: control the both with exaclty the same target temp.
Hello,
With this attribute
auto_regulation_use_device_temp: true
, this should not be an issue for VTherm that internal temperature is wrong. Maybe you should use the VTherm card https://github.com/jmcollin78/versatile-thermostat-ui-card (available in HACS) so that you will instant access to the regulated temperature calculated by VTherm.
Thank you so much again for your answer and your time.
I have installed the card you mentioned to see the regulated temperature. In the following screenshot it is seen that the regulated temp is not adjusted in a right way to the internal temp for the second middle trv. It should be set to under the internal temp of the TRV as there is no heating requested.
When I adjust the offset of the internal temperature of the TRV in the device settings of HA, VTherm does the right thing. (see below).
An additional problem here, is that there are two TRV's in this room, and I would like to either have them both on or both off, to increase efficiency of the heating system. Is there a way to enforce this? Because in this example, the other TRV was heating at the times that the difficult TRV was not.
VTherm can control up to 4 devices. You can configure that in the 'underlying' configuration page. It should does exactly what you need: control the both with exaclty the same target temp.
I have grouped the two TRV's in the same Vtherm. Vtherm does send the target temp to both TRV's. My observation is that the TRV's respond diffently to the target temp. It can be the case that one TRV is heating and the other one is not, as seen in the screenshots. For multiple TRV's in the same room it is optimal to be both on or both off. Is there a way to enforce this?
Maybe a check if one of them is heating, to increase the target temp of the other TRV in the group?
This is maybe because the difference is too low? Is there a way to increase/exaggerate this value to force the TRV to heat?
You have 2 threshold to avoid sending too much command to your TRV and empty the battery. It is named regulation threshold and minimal period of regulation:
But use it carfully else you will drawn your battery in one week. With
over_climate
(your case) you have to do a compromise between comfort (and temperature stabilization) and battery saving.
Thank you for pointing out these settings. I will try to optimize them. I'm sorry that I didn't communicate clearly. I will try again.
The TRV seems to be stay at idle (not heating) with a low difference of target temp and internal temp, which can be seen in the graph below around 0:00, 2:00 and 4:00. The difference at these times was only 0,5 degrees, which was apperantly not enough for the TRV to switch to heating. I was wondering if it would be possible to increase this target temp if the TRV does not switch to heat to for example 1 degree or more.
For multiple TRV's in the same room it is optimal to be both on or both off. Is there a way to enforce this?
Sadly not because, the regulation is done by your heater itself in over_climate
. The only thing that does VTherm is to send a regulated target temperature to the underlying which controls your TRV. There is no way to force a heating or not with this type of VTherm. I wish you can control directly the TRV openess and use the over_valve
VTherm (the best performance), but sadly you don't have this. over_climate
is the choice when you cannot do anything else and have a poor control of your device. With Shelly TRV you can control directly the valve openess and then have a full control.
Maybe a check if one of them is heating, to increase the target temp of the other TRV in the group?
No, I cannot do that simply. For the reason I explain above.
the graph below around 0:00, 2:00 and 4:00
It seems there no need of heating at this hours:
Note : I don't have the legend, so I'm not sure of what I see exactly, but if I suppose it is target_temp and current_temp, I don't see any issue. Target seems near the current temp. Right ?
In over_climate
with self-regulation, you have to wait a few before the stabilization. It mainly depends on the regulation algorithm of your underlying device but normally it will converge.
I think we lost the initial question. When you check the 'use the internal temperature', VTherm reads an attribute named: current_temperature
. Does your AVATTO TRV06 have this attribute exposed ?
If you want to sure of what is read by VTherm, you can put VTherm is debug (see README), and check for logs like this one:
"
Then you will have the internal temp measured by VTherm.
Note: don't stay in debug too long, those logs are very verbose.
In the example below the regulated temp sent to both TRV's should be adjusted to internal temp of the TRV. There is no heating requested as the room temperature (17,5) is high enough.
I expect the second calculation to adjusted the regulated temp of 15.2 to the internal temperature of 14, so that is actually below 14. I believe it is because device offset temp is calculated to 0 in both calculations.
2024-10-16 08:59:23.895 INFO (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Kinderkamer Thermostaat - Set target temp: 17.0
2024-10-16 08:59:23.896 INFO (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - Calling ThermostatClimate._send_regulated_temperature force=True
2024-10-16 08:59:23.896 INFO (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - regulation calculation will be done
2024-10-16 08:59:23.896 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - usage regulation_step: 0.20
2024-10-16 08:59:23.896 DEBUG (MainThread) [custom_components.versatile_thermostat.pi_algorithm] PITemperatureRegulator - Error: -0.50 accumulated_error: -20.47 offset: -1.84 offset_ext: 0.00 target_tem: 17.0 regulatedTemp: 15.2
2024-10-16 08:59:23.897 INFO (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - Regulated temp have changed to 15.2. Resend it to underlyings
2024-10-16 08:59:23.897 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - The device offset temp for regulation is 0.00 - internal temp is 18.20. New target is 15.20
2024-10-16 08:59:23.914 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - The device offset temp for regulation is 0.00 - internal temp is 14.00. New target is 15.20
2024-10-16 08:59:23.917 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - recalculate all
2024-10-16 08:59:23.919 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - Calling update_custom_attributes: {'is_on': True, 'hvac_action': <HVACAction.IDLE: 'idle'>, 'hvac_mode': 'heat', 'preset_mode': 'none', 'type': None, 'is_controlled_by_central_mode': True, 'last_central_mode': None, 'frost_temp': 7.0, 'eco_temp': 12.0, 'boost_temp': 7.0, 'comfort_temp': 18.0, 'frost_away_temp': 0, 'eco_away_temp': 0, 'boost_away_temp': 0, 'comfort_away_temp': 0, 'power_temp': None, 'target_temperature_step': 0.5, 'ext_current_temperature': 11.9, 'ac_mode': False, 'current_power': None, 'current_power_max': None, 'saved_preset_mode': 'eco', 'saved_target_temp': 18.0, 'saved_hvac_mode': None, 'motion_sensor_entity_id': None, 'motion_state': None, 'power_sensor_entity_id': None, 'max_power_sensor_entity_id': None, 'overpowering_state': None, 'presence_sensor_entity_id': None, 'presence_state': None, 'window_state': 'off', 'window_auto_state': 'off', 'window_bypass_state': False, 'window_sensor_entity_id': None, 'window_delay_sec': 30, 'window_auto_enabled': False, 'window_auto_open_threshold': None, 'window_auto_close_threshold': None, 'window_auto_max_duration': None, 'window_action': 'window_eco_temp', 'security_delay_min': 120, 'security_min_on_percent': 0.8, 'security_default_on_percent': 0.0, 'last_temperature_datetime': '2024-10-16T08:51:00.806200+02:00', 'last_ext_temperature_datetime': '2024-10-16T08:51:00.806200+02:00', 'security_state': False, 'minimal_activation_delay_sec': 30, 'device_power': 1.0, 'mean_cycle_power': None, 'total_energy': 19.4, 'last_update_datetime': '2024-10-16T08:59:23.918018+02:00', 'timezone': 'Europe/Amsterdam', 'temperature_unit': <UnitOfTemperature.CELSIUS: '°C'>, 'is_device_active': False, 'ema_temp': 17.5, 'is_used_by_central_boiler': False, 'is_over_climate': True, 'start_hvac_action_date': None, 'underlying_climate_0': 'climate.trv_kinderkamer_thermostat', 'underlying_climate_1': 'climate.trv_kinderkamer_voor_thermostat', 'underlying_climate_2': None, 'underlying_climate_3': None, 'is_regulated': True, 'regulated_target_temperature': 15.2, 'auto_regulation_mode': 'auto_regulation_strong', 'regulation_accumulated_error': -20.4717529296875, 'auto_fan_mode': 'auto_fan_none', 'current_auto_fan_mode': 'auto_fan_none', 'auto_activated_fan_mode': None, 'auto_deactivated_fan_mode': None, 'auto_regulation_use_device_temp': True}
It does however do the calculations correct if regulated temp is higher than room temperature and heating is requested. In the example below the device offset calculations are done correctly.
2024-10-16 09:11:09.306 INFO (MainThread) [custom_components.versatile_thermostat.base_thermostat] VersatileThermostat-Kinderkamer Thermostaat - Set target temp: 18.0
2024-10-16 09:11:09.306 INFO (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - Calling ThermostatClimate._send_regulated_temperature force=True
2024-10-16 09:11:09.307 INFO (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - regulation calculation will be done
2024-10-16 09:11:09.307 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - usage regulation_step: 0.20
2024-10-16 09:11:09.307 DEBUG (MainThread) [custom_components.versatile_thermostat.pi_algorithm] PITemperatureRegulator - Error: 0.50 accumulated_error: -10.24 offset: -0.62 offset_ext: 0.00 target_tem: 18.0 regulatedTemp: 17.4
2024-10-16 09:11:09.307 INFO (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - Regulated temp have changed to 17.4. Resend it to underlyings
2024-10-16 09:11:09.308 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - The device offset temp for regulation is 0.70 - internal temp is 18.20. New target is 18.00
2024-10-16 09:11:09.318 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - The device offset temp for regulation is -3.50 - internal temp is 14.00. New target is 14.00
2024-10-16 09:11:09.321 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - recalculate all
2024-10-16 09:11:09.324 DEBUG (MainThread) [custom_components.versatile_thermostat.thermostat_climate] VersatileThermostat-Kinderkamer Thermostaat - Calling update_custom_attributes: {'is_on': True, 'hvac_action': <HVACAction.HEATING: 'heating'>, 'hvac_mode': 'heat', 'preset_mode': 'none', 'type': None, 'is_controlled_by_central_mode': True, 'last_central_mode': None, 'frost_temp': 7.0, 'eco_temp': 12.0, 'boost_temp': 7.0, 'comfort_temp': 18.0, 'frost_away_temp': 0, 'eco_away_temp': 0, 'boost_away_temp': 0, 'comfort_away_temp': 0, 'power_temp': None, 'target_temperature_step': 0.5, 'ext_current_temperature': 12.1, 'ac_mode': False, 'current_power': None, 'current_power_max': None, 'saved_preset_mode': 'eco', 'saved_target_temp': 18.0, 'saved_hvac_mode': None, 'motion_sensor_entity_id': None, 'motion_state': None, 'power_sensor_entity_id': None, 'max_power_sensor_entity_id': None, 'overpowering_state': None, 'presence_sensor_entity_id': None, 'presence_state': None, 'window_state': 'off', 'window_auto_state': 'off', 'window_bypass_state': False, 'window_sensor_entity_id': None, 'window_delay_sec': 30, 'window_auto_enabled': False, 'window_auto_open_threshold': None, 'window_auto_close_threshold': None, 'window_auto_max_duration': None, 'window_action': 'window_eco_temp', 'security_delay_min': 120, 'security_min_on_percent': 0.8, 'security_default_on_percent': 0.0, 'last_temperature_datetime': '2024-10-16T08:51:00.806200+02:00', 'last_ext_temperature_datetime': '2024-10-16T09:00:45.962108+02:00', 'security_state': False, 'minimal_activation_delay_sec': 30, 'device_power': 1.0, 'mean_cycle_power': None, 'total_energy': 19.4, 'last_update_datetime': '2024-10-16T09:11:09.322456+02:00', 'timezone': 'Europe/Amsterdam', 'temperature_unit': <UnitOfTemperature.CELSIUS: '°C'>, 'is_device_active': True, 'ema_temp': 17.5, 'is_used_by_central_boiler': False, 'is_over_climate': True, 'start_hvac_action_date': datetime.datetime(2024, 10, 16, 8, 59, 29, 422081, tzinfo=zoneinfo.ZoneInfo(key='Europe/Amsterdam')), 'underlying_climate_0': 'climate.trv_kinderkamer_thermostat', 'underlying_climate_1': 'climate.trv_kinderkamer_voor_thermostat', 'underlying_climate_2': None, 'underlying_climate_3': None, 'is_regulated': True, 'regulated_target_temperature': 17.4, 'auto_regulation_mode': 'auto_regulation_strong', 'regulation_accumulated_error': -10.23587646484375, 'auto_fan_mode': 'auto_fan_none', 'current_auto_fan_mode': 'auto_fan_none', 'auto_activated_fan_mode': None, 'auto_deactivated_fan_mode': None, 'auto_regulation_use_device_temp': True}
Huuum this is interesting. I think you find something... I will have a look.
You are totally right. Here is how the offset is calculated:
offset_temp = 0
device_temp = 0
if (
# current_temperature is set
self.current_temperature is not None
# regulation can use the device_temp
and self.auto_regulation_use_device_temp
# and we have access to the device temp
and (device_temp := under.underlying_current_temperature) is not None
# and target is not reach (ie we need regulation)
and (
(
self.hvac_mode == HVACMode.COOL
and self.target_temperature < self.current_temperature
)
or (
self.hvac_mode == HVACMode.HEAT
and self.target_temperature > self.current_temperature
)
)
):
offset_temp = device_temp - self.current_temperature
In Heat mode, the target_temp should be > the current_temp to be applied. I have to admit it seems to be erroneous for typically your case. The comment says "only if we need regulation", but this is a wrong assumption.
I remember a discussion where people says offset should always been applied: https://github.com/jmcollin78/versatile_thermostat/issues/467
I didn't realize this when I read the original post but now it seems obvious to remove the test as suggested in #467.
I will do a beta release. Can you give it a try ?
transfered to issue #467 (same issue but much clearer in 467).
I'm honestly surprised it took this long for the regulation issue to be resolved. Good to see the changes made.
My fault. I didn't give the attention it was needed.
Thank you for your quick reponse. I am very happy we figured it out. To test the beta, do I just copy the folder versatile_thermostat to custom_components in HA and restart?
Thank you for your quick reponse. I am very happy we figured it out. To test the beta, do I just copy the folder versatile_thermostat to custom_components in HA and restart?
That would work, but if you use HACS, you can go to redownload, and manually select the beta version.
Thanks for pointing it out @mag2352 .
Tested the new release, all looks fine. Device offset is calculated in both cases. Thanks for the quick fix.
I have recently added Avatto TRV06 to my setup. When I try to control them by Versatile Thermostat in a climate, it does control the TRV to open or closes. The issue is that the set temperature does not take the current temperature of the TRV into account.
This causes the TRV to be heating while it should not (see photo). In this case the set temperature of the TRV should be set lower than the current temperature (around 16 degrees).
Maybe it has something to do with the regulation parameters, but I have tried several combinations and they all show not success. Let me know if you need more information.
Version of the custom_component
6.3.0
Configuration
My VTherm attributes are the following:
If it is releveant to regulation performance or optimisation some curves are needed
To have a great curves demonstrating what you think is a problem, please install and configure what is described here: Even better with Plotly to tune your Thermostat
Describe the bug
A clear and concise description of what the bug is.
I'm trying to set the temperature on the thermostat to lower than actual temperature of the room, but the temperature of the TRV is set higher than the actual temperature of the TRV.
Debug log