Hi Jim et al,
First, thank you so much for making all of your code available, this is a really nice project from which i’m already using some parts for the better part of a year!
I managed to solve most of my problems with the excellent discussions in this forum but I’m struggling with the thermostat setup (i’m using the thermostat card, not the add-on).
Background:
- Home Assistant 2023.1.2
- Supervisor 2022.12.1
- Operating System 9.4
- Frontend 20230104.0 - latest
- Latest homekit infused (6.3)
- Using nearly all of the pre-defined stuff from the repository from Jim
The problem:
In a nutshell, i have 3 climate components:
- CV - manually defined with ebusd / mqtt polling from a vaillant boiler/thermostat
mqtt:
climate:
- name: CV
max_temp: 25
min_temp: 15
precision: 0.1
temp_step: 0.5
modes:
- auto
- heat
- cool
- 'off'
mode_state_template: >-
{% set values = { 'auto':'auto', 'day':'heat', 'night':'cool', 'off':'off'} %}
{{ values[value] if value in values.keys() else 'off' }}
mode_state_topic: "ebusd/700/z1OpMode"
mode_command_template: >-
{% set values = { 'auto':'auto', 'heat':'day', 'cool':'night', 'off':'off'} %}
{{ values[value] if value in values.keys() else 'auto' }}
mode_command_topic: "ebusd/700/z1OpMode/set"
temperature_state_topic: "ebusd/700/z1ActualRoomTempDesired"
temperature_low_state_topic: "ebusd/700/z1NightTemp"
temperature_high_state_topic: "ebusd/700/z1DayTemp"
temperature_low_command_topic: "ebusd/700/z1NightTemp/set"
temperature_high_command_topic: "ebusd/700/z1DayTemp/set"
current_temperature_topic: "ebusd/700/z1RoomTemp"
State attributes in developer tools:
hvac_modes:
- auto
- heat
- cool
- 'off'
min_temp: 15
max_temp: 25
target_temp_step: 0.5
current_temperature: 19.1
temperature: 19
target_temp_high: 19
target_temp_low: 17
friendly_name: CV
supported_features: 3
- Boiler - manually defined with ebusd / mqtt polling from a vaillant boiler/thermostat
mqtt:
climate:
- name: Boiler
max_temp: 100
min_temp: 20
precision: 0.5
temp_step: 1
modes:
- auto
- heat
- 'off'
mode_state_template: >-
{% set values = { 'auto':'auto', 'day':'heat', 'off':'off'} %}
{{ values[value] if value in values.keys() else 'off' }}
mode_state_topic: "ebusd/700/HwcOpMode"
mode_command_template: >-
{% set values = { 'auto':'auto', 'heat':'day', 'off':'off'} %}
{{ values[value] if value in values.keys() else 'auto' }}
mode_command_topic: "ebusd/700/HwcOpMode/set"
temperature_state_topic: "ebusd/700/HwcTempDesired"
# temperature_low_state_topic: "ebusd/700/z1NightTemp"
temperature_high_state_topic: "ebusd/700/HwcTempDesired"
# temperature_low_command_topic: "ebusd/700/z1NightTemp/set"
temperature_high_command_topic: "ebusd/700/HwcTempDesired/set"
current_temperature_topic: "ebusd/700/HWCwatertempcorrected"
State attributes in developer tools:
hvac_modes:
- auto
- heat
- 'off'
min_temp: 20
max_temp: 100
target_temp_step: 1
current_temperature: 63
temperature: 65
target_temp_high: 65
target_temp_low: 21
friendly_name: Boiler
supported_features: 3
- Airco - this climate entity was autofilled by the daikin integration but i see the following state attributes in developer tools:
hvac_modes:
- fan_only
- dry
- cool
- heat
- heat_cool
- 'off'
min_temp: 7
max_temp: 35
target_temp_step: 1
fan_modes:
- Auto
- Silence
- '1'
- '2'
- '3'
- '4'
- '5'
preset_modes:
- none
- away
- eco
- boost
swing_modes:
- 'Off'
- Vertical
- Horizontal
- 3D
current_temperature: 19
temperature: 20
fan_mode: '3'
preset_mode: none
swing_mode: 'Off'
friendly_name: Airco kamer ouders
supported_features: 57
While some states are represented correct
=> Off-state:
Or semi-correct:
=> heat state
others are apparently not:
=> auto state (for CV and boiler) and heat/cool for the airco:
Although i’m not a template specialist nor a Jinja2 specialist, I’m thinking the issue lies within the thermostat custom-button template, specifically this part (i already modified it by adding more states to the label part)
label: "[[[ if (states['{{entity}}'].state == 'heat_cool') return `${states['{{entity}}'].attributes.temperature}°`; if (states['{{entity}}'].state == 'auto') return `${states['{{entity}}'].attributes.temperature}°`; if (states['{{entity}}'].state == 'heat') return `${states['{{entity}}'].attributes.temperature}°`; if (states['{{entity}}'].state == 'cool') return `${states['{{entity}}'].attributes.temperature}°`; else return `--` ]]]"
{% if ((attribute is defined) and (attribute == 'state')) %}
state_display: "[[[ if (states['{{entity}}'].state == 'off') return `Off`; else return `${states['{{entity}}'].state}` ]]]"
{% else %}
state_display: "[[[ if (states['{{entity}}'].state == 'off') return `Off`; else return `${states['{{entity}}'].attributes.hvac_action}` ]]]"
{% endif %}
Most of the above I understand, but I dont understand this part (nor can i find anything about it online) and I think this is also part of the problem:
{% if ((attribute is defined) and (attribute == 'state')) %}
Another thing I noticed is that the CV and boiler climates do not have an hvac_action attribute, whereas certain modes of the Airco also do not (eg the heat/cool that doesn’t work properly).
Apologies for the long post; hopefully someone is able to help out!
Kind regards,
Ben