我是用海尔集成添加的热水器,你参考一下吧
climate:
- platform: climate_template
name: reshuiqi_xiaowu ##显示名
modes: ##空调模式还有吹风制冷除湿啥的
- "heat"
- "off"
unique_id: reshuiqi_xiaowu ##实体名
min_temp: 35 ##最高温度
max_temp: 75 ##最低温度
temp_step: 1
precision: 1
current_temperature_template: "{{ states('sensor.reshuiqi_xiaowu_dqwd') }}" ##当前温度传感器
target_temperature_template: "{{ states('number.reshuiqi_xiaowu_mbwd') }}" ##目标温度调节
hvac_mode_template: >
{% if is_state('switch.reshuiqi_xiaowu_kgjzt', 'on') %}
heat
{% else %}
off
{% endif %}
set_temperature:
service: number.set_value
target:
entity_id: number.reshuiqi_xiaowu_mbwd
data:
value: "{{ temperature }}"
set_hvac_mode:
- choose:
- conditions:
- condition: template
value_template: "{{ hvac_mode == 'off' }}"
sequence:
- service: switch.turn_off
target:
entity_id: switch.reshuiqi_xiaowu_kgjzt
- conditions:
- condition: template
value_template: "{{ hvac_mode == 'heat' }}"
sequence:
- service: switch.turn_on
target:
entity_id: switch.reshuiqi_xiaowu_kgjzt
- service: number.set_value
target:
entity_id: number.reshuiqi_xiaowu_mbwd
data:
value: "{{ temperature }}"
|