Thanks for your help, trying to be as consistent as possible while trying many things to make this works. I did shortcuts that assume would be understood, but you are not me and I’m not you. Errors are part of the human nature, as well as frustration. Writing not helping here, it removes a lot of the human interactions that would have helped understanding each others
Anyway, thanks to your help to put me on track, I think I’ve found the problem!
For what I can see and understand, there is no way of changing away_temp dynamically.
Looking at the logs show this (doing two changes one after the other to gather more logs):
2021-02-10 11:22:32 INFO (MainThread) [homeassistant.components.automation.updating_thermostat_away_temp_value_when_input_temp_absent_is_changed] Updating Thermostat away_temp value when input "Temp Absent" is changed: Running automation actions
2021-02-10 11:22:32 INFO (MainThread) [homeassistant.components.automation.updating_thermostat_away_temp_value_when_input_temp_absent_is_changed] Updating Thermostat away_temp value when input "Temp Absent" is changed: Executing step call service
2021-02-10 11:22:32 INFO (SyncWorker_1) [homeassistant.components.python_script] Executing set_state_or_attr.py: {'entity_id': 'climate.thermostat_chambres', 'away_temp': 19.5}
2021-02-10 11:22:32 DEBUG (SyncWorker_1) [homeassistant.components.python_script.set_state_or_attr.py] inputStateObject = <state climate.thermostat_chambres=heat; hvac_modes=['cool', 'heat', 'off'], min_temp=14.0, max_temp=28.0, preset_modes=['none', 'away'], current_temperature=18.7, temperature=18.0, hvac_action=heating, preset_mode=away, friendly_name=Thermostat Chambres, supported_features=17, away_temp=20.0 @ 2021-02-10T11:00:54.029532+01:00>
2021-02-10 11:22:32 DEBUG (SyncWorker_1) [homeassistant.components.python_script.set_state_or_attr.py] inputState = heat
2021-02-10 11:22:32 DEBUG (SyncWorker_1) [homeassistant.components.python_script.set_state_or_attr.py] inputAttributesObject = {'hvac_modes': ['cool', 'heat', 'off'], 'min_temp': 14.0, 'max_temp': 28.0, 'preset_modes': ['none', 'away'], 'current_temperature': 18.7, 'temperature': 18.0, 'hvac_action': 'heating', 'preset_mode': 'away', 'friendly_name': 'Thermostat Chambres', 'supported_features': 17, 'away_temp': 20.0}
2021-02-10 11:22:32 DEBUG (SyncWorker_1) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: item = entity_id
2021-02-10 11:22:32 DEBUG (SyncWorker_1) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: item = entity_id; value = climate.thermostat_chambres
2021-02-10 11:22:32 DEBUG (SyncWorker_1) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: item = away_temp
2021-02-10 11:22:32 DEBUG (SyncWorker_1) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: item = away_temp; value = 19.5
2021-02-10 11:22:32 DEBUG (SyncWorker_1) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: inputAttributesObject[item] = 19.5
2021-02-10 11:22:38 INFO (MainThread) [homeassistant.components.automation.updating_thermostat_away_temp_value_when_input_temp_absent_is_changed] Updating Thermostat away_temp value when input "Temp Absent" is changed: Running automation actions
2021-02-10 11:22:38 INFO (MainThread) [homeassistant.components.automation.updating_thermostat_away_temp_value_when_input_temp_absent_is_changed] Updating Thermostat away_temp value when input "Temp Absent" is changed: Executing step call service
2021-02-10 11:22:38 INFO (SyncWorker_3) [homeassistant.components.python_script] Executing set_state_or_attr.py: {'entity_id': 'climate.thermostat_chambres', 'away_temp': 19.0}
2021-02-10 11:22:38 DEBUG (SyncWorker_3) [homeassistant.components.python_script.set_state_or_attr.py] inputStateObject = <state climate.thermostat_chambres=heat; hvac_modes=['cool', 'heat', 'off'], min_temp=14.0, max_temp=28.0, preset_modes=['none', 'away'], current_temperature=18.7, temperature=18.0, hvac_action=heating, preset_mode=away, friendly_name=Thermostat Chambres, supported_features=17, away_temp=19.5 @ 2021-02-10T11:00:54.029532+01:00>
2021-02-10 11:22:38 DEBUG (SyncWorker_3) [homeassistant.components.python_script.set_state_or_attr.py] inputState = heat
2021-02-10 11:22:38 DEBUG (SyncWorker_3) [homeassistant.components.python_script.set_state_or_attr.py] inputAttributesObject = {'hvac_modes': ['cool', 'heat', 'off'], 'min_temp': 14.0, 'max_temp': 28.0, 'preset_modes': ['none', 'away'], 'current_temperature': 18.7, 'temperature': 18.0, 'hvac_action': 'heating', 'preset_mode': 'away', 'friendly_name': 'Thermostat Chambres', 'supported_features': 17, 'away_temp': 19.5}
2021-02-10 11:22:38 DEBUG (SyncWorker_3) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: item = entity_id
2021-02-10 11:22:38 DEBUG (SyncWorker_3) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: item = entity_id; value = climate.thermostat_chambres
2021-02-10 11:22:38 DEBUG (SyncWorker_3) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: item = away_temp
2021-02-10 11:22:38 DEBUG (SyncWorker_3) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: item = away_temp; value = 19.0
2021-02-10 11:22:38 DEBUG (SyncWorker_3) [homeassistant.components.python_script.set_state_or_attr.py] LOOP: inputAttributesObject[item] = 19.0
‘current_temperature’: 18.7, ‘temperature’: 18.0, ‘hvac_action’: ‘heating’, ‘preset_mode’: ‘away’, ‘friendly_name’: ‘Thermostat Chambres’, ‘supported_features’: 17, ‘away_temp’: 19.5
Using developper tools when in “away” to check entity_state gives me those informations:
hvac_modes:
- cool
- heat
- 'off'
min_temp: 14
max_temp: 28
preset_modes:
- none
- away
current_temperature: 19.1
temperature: 18
hvac_action: idle
preset_mode: away
friendly_name: Thermostat Chambres
supported_features: 17
“away_temp” is not known by the entity “climate.thermostat_chambres”. The only known temperature relative value is “temperature”
using template editor with:
{{ states[climate.thermostat_chambres] }}
Gives me:
"UndefinedError: 'climate' is undefined"
But using:
{{ states(‘climate.thermostat_chambres’) }}
Gives me:
heat
"18.0"
What I understand is that: the temperature hardcoded in the dualmode_generic thermostat is used when switching to “away” by copying it to the “temperature” variable. The fact to set “away_temp” in the entity “climate.thermostat_chambres” does add it into it, but is not used by the away mode functionnality that keeps using the “away_temp” variable hardcoded in the yaml file where the termostat is created.
The only way I see to do what I want is then to modify the dualmode_generic thermostat to add an “away_temp_cool” variable, and use this variable when the thermostat is in “cool” mode instead of “away_temp”. “away_temp” would be the “away” value for “heat” mode only…
Now that I know it is working for you, and knowing that the only difference we have is this “dualmode_generic” dual thermostat. I have tried to create a “test” thermostat using generic_thermostat like you, and do the test again. But the result is the same: not working! the “temperature” value is still the one hardcoded in “away_temp”.