一个基于OpenTherm或EBUS协议的智能温控器。
- 使用TPI算法智能控制锅炉的出水温度,节约供暖系统功耗并让室温更稳定(对冷凝炉+地暖效果更加,常规炉或暖气散热片也可以使用)
- 支持高温、低温上限(DEADHAND),超过或不足时退出TPI算法转为通断控制
- 可适配HA中各类温控器协议的接入方式,但是要求必须能够支持打开/关闭加热以及出水温度设置功能,以及接入一个温度传感器
- 支持TPI参数自适应、自学习(试验功能)
将 custom_components文件夹拷贝到 home-assistant系统的/config目录下。
configuration.yaml的配置示例:
climate:
- platform: tpi_thermostat
name: heater_therm_new
unique_id: climate.thermostat_tpi_test
heater_switch: switch.thermostat_fake2
keep_alive:
minutes: 1
target_sensor: sensor.cgllc_cgd1st_4d9d_temperature
tempurature_input_entity: input_text.eb_ch_set
target_temp: 23.5
initial_hvac_mode: "off"
cold_tolerance: 0.5
hot_tolerance: 0.5
auto_tpi: false
tpi_kp: 0.966
tpi_ti: 1100.0
heater_temp_min: 40.0
heater_temp_max: 65.0
Key | Type | Required | Default | Description |
---|---|---|---|---|
heater_switch |
string(entity_id) | yes | - | 用于设置点火/供暖开关的switch entity |
target_sensor |
string(entity_id) | yes | - | 用于测量室温的温度传感器,必须是一个sensor entity |
heater_temp_topic |
string | yes1 | - | 用于设置水温的MQTT Topic名,如果设置了,就必须设置heater_temp_payload,如果设置了tempurature_input_entity 就不要填写。 |
heater_temp_payload |
string | yes1 | - | 用于设置水温的MQTT Payload内容,原则上水温数值会加入到Payload之后,如此项设置为 'chset',则将水温设置为55摄氏度系统会发送'chset55'到MQTT。如果设置了tempurature_input_entity 就不要填写。 |
tempurature_input_entity |
string(entity_id) | yes1 | - | 一个TEXT_INPUT的entity id。会通过set_value服务将水温设置进入。可通过另行配置自动化联动实际的水温设置逻辑。如果填写了heater_temp_topic 则此项无效。如果填写了此项,无需填写MQTT相关配置 |
max_temp |
float | no | - | 前端面板可设置的最高目标温度 |
min_temp |
float | no | - | 前端面板可设置的最低目标温度 |
name |
string | no | autogenerated | 温控器的显示名 |
unique_id |
string | no | autogenerated | 温控器在HA中的unique_id |
cold_tolerance |
float | no | 0.5 | 目标温度下的控制宽度,建议保留默认值 |
hot_tolerance |
float | no | 0.5 | 目标温度上的控制宽度,建议保留默认值 |
deadhand |
float | no | 2 | 高低温上限,当室温超过或低于 deadhand/2 的时候,会自动停止TPI |
auto_tpi |
boolean | no | true |
TPI参数(KP和TI)自动配置功能,实验室功能。如果开启,tpi_kp 与tpi_ti 参数会被忽略而通过一次通断控制自动测算 |
tpi_kp |
float | no | 0.966 | 建议参数为0.37-0.96之间,越是天气较冷或房屋保温效果较差的地方越大 |
tpi_ti |
float | no | 1100 | 建议参数为550-1100之间,越是天气较冷或房屋保温效果较差的地方越大 |
heater_temp_min |
float | no | 40 | 锅炉最低出水温度,地暖+冷凝炉建议设置为32-35度。常规炉建议设置在40-45度 |
heater_temp_max |
float | no | 70 | 锅炉最高出水温度,地暖建议设置为50-60度。常规炉+暖气片系统建议设置在60-70度 |
target_temp |
float | no | - | 系统重启时初始目标温度,根据需求设置。 |
keep_alive |
timedelta | no | 60 seconds | 每一轮的控制周期的时间间隔,一般无需修改。 |
TPI算法和自动调参方法受到Ali, Saqib的论文 Development of tpi temperature control algorithm for thermostat for maximum comfort and high energy efficency ( https://www.politesi.polimi.it/handle/10589/196985?mode=complete ) 的启发
A smart thermostat use tpi to control heater water temperature with EBUS or OpenTherm Protocal.
- Utilizes the TPI algorithm for intelligent control of the boiler's output water temperature, saving energy consumption in the heating system and stabilizing room temperature more effectively (especially beneficial for condensing boilers + underfloor heating, but also applicable to conventional boilers or radiators).
- Supports high and low-temperature limits (DEADHAND); exceeds or falls short, the system switches from the TPI algorithm to on/off control.
- Compatible with various thermostat protocols in HA (Home Assistant), requiring support for heating on/off and output water temperature setting, as well as integration with a temperature sensor.
- Supports adaptive and self-learning TPI parameters (experimental feature).
Copy the custom_components folder to the /config directory of your home-assistant system.
Example configuration in configuration.yaml:
climate:
- platform: tpi_thermostat
name: heater_therm_new
unique_id: climate.thermostat_tpi_test
heater_switch: switch.thermostat_fake2
keep_alive:
minutes: 1
target_sensor: sensor.cgllc_cgd1st_4d9d_temperature
tempurature_input_entity: input_text.eb_ch_set
target_temp: 23.5
initial_hvac_mode: "off"
cold_tolerance: 0.5
hot_tolerance: 0.5
auto_tpi: false
tpi_kp: 0.966
tpi_ti: 1100.0
heater_temp_min: 40.0
heater_temp_max: 65.0
Key | Type | Required | Default | Description |
---|---|---|---|---|
heater_switch | string(entity_id) | yes | - | The switch entity for setting the ignition/heating switch. |
target_sensor | string(entity_id) | yes | - | The temperature sensor entity for measuring room temperature. |
heater_temp_topic | string | yes1 | - | The MQTT Topic name for setting water temperature. If set, heater_temp_payload must also be set; if temperature_input_entity is used, do not fill this. |
heater_temp_payload | string | yes1 | - | The MQTT Payload for setting water temperature. The temperature value is appended to the Payload; if set as 'chset', setting the temperature to 55°C would send 'chset55' to MQTT. If temperature_input_entity is used, do not fill this. |
temperature_input_entity | string(entity_id) | yes1 | - | A TEXT_INPUT entity id. The water temperature is set via the set_value service. This can be linked with automation for actual water temperature setting logic. If heater_temp_topic is filled, this is ignored. If filled, MQTT configuration is not needed. |
max_temp | float | no | - | The maximum target temperature that can be set from the frontend. |
min_temp | float | no | - | The minimum target temperature that can be set from the frontend. |
name | string | no | autogenerated | The display name of the thermostat. |
unique_id | string | no | autogenerated | The unique_id of the thermostat in HA. |
cold_tolerance | float | no | 0.5 | The control width below the target temperature, default value is recommended. |
hot_tolerance | float | no | 0.5 | The control width above the target temperature, default value is recommended. |
deadhand | float | no | 2 | The high/low temperature limits. When room temperature exceeds or falls below half of deadhand, TPI stops. |
auto_tpi | boolean | no | true | Automatic configuration of TPI parameters (KP and TI), an experimental feature. If enabled, tpi_kp and tpi_ti are ignored and calculated automatically through a control cycle. |
tpi_kp | float | no | 0.966 | Recommended parameter between 0.37-0.96, higher values for colder weather or less insulated homes. |
tpi_ti | float | no | 1100 | Recommended parameter between 550-1100, higher values for colder weather or less insulated homes. |
heater_temp_min | float | no | 40 | The minimum output water temperature for the boiler. For underfloor heating + condensing boilers, 32-35°C is recommended. For conventional boilers, 40-45°C. |
heater_temp_max | float | no | 70 | The maximum output water temperature for the boiler. For underfloor heating, 50-60°C is recommended. For conventional boilers + radiators, 60-70°C. |
target_temp | float | no | - | The initial target temperature when the system restarts. Set according to needs. |
keep_alive | timedelta | no | 60 seconds | The time interval for each control cycle, usually does not need modification. |
The TPI algorithm and automatic tuning method were inspired by the paper by Ali, Saqib titled "Development of tpi temperature control algorithm for thermostat for maximum comfort and high energy efficiency" (https://www.politesi.polimi.it/handle/10589/196985?mode=complete).