- alias: Heating off when no one is at home #works
initial_state: True
hide_entity: False
# Condition missing: check if away_mode is not already active
trigger:
platform: state
entity_id: device_tracker.94652d8060fc
to: 'not_home'
action:
- service: climate.set_away_mode
data:
entity_id: climate.heating
away_mode: 'on'
- alias: Heating on when Lukas arrives #works
initial_state: True
hide_entity: False
trigger:
platform: state
entity_id: device_tracker.94652d8060fc
to: 'home'
action:
- service: climate.set_away_mode
data:
entity_id: climate.heating
away_mode: 'off'
- alias: Heating to away_mode at 23:00 #check this!!!
initial_state: True
hide_entity: False
trigger:
platform: time
at: '23:00:00'
condition:
#here we have the problem: When I do not check for availability and just set away_mode, it overwrites the flag when 94652d8060fc is not present.
condition: and
conditions:
- condition: state
entity_id: device_tracker.94652d8060fc
state: 'home'
- condition: state
entity_id: 'binary_sensor.workday_sensor'
state: 'on'
action:
- service: climate.set_away_mode
data:
entity_id: climate.heating
away_mode: 'on'
- alias: Heating back from away_mode at 09:00 #check this!!!
initial_state: True
hide_entity: False
trigger:
platform: time
at: '9:00:00'
# at: '{{ input_datetime.input_startheating_workdays }}'
condition:
condition: and
conditions:
- condition: state
entity_id: device_tracker.94652d8060fc #Lukas
state: 'home'
- condition: state
entity_id: 'binary_sensor.workday_sensor'
state: 'on'
action:
- service: climate.set_away_mode
data:
entity_id: climate.heating
away_mode: 'off'
is never firing if you aren’t at home, because that is in your condition. Unless I’m confused, the only automation that would occur if you aren’t at home is
So, this looks like it is working as expected. I may be following the logic wrong though. One thing to note as well, you don’t have a from: ‘home’ and to: ‘not_home’. This may be needed depending on your presence detection. Some presence detection devices, like owntracks, will report changes in your location whenever you move. So you’ll get from: “not_home”, to “not_home” events. Super annoying if you ask me. You may want to filter those out. That also may be the cause of your oddities.
If you want to check the status of away mode, you can use a conditional template:
away_mode is going to be platform specific. I can set away_mode as many times as I want for ecobee and it makes no difference.
If you really want to know how a specific platform works, click on the component and then click the source code and just search for “turn_away_mode_on” and start from there.
Yes. I changed that to work around the problem at least when I’m at home.
- alias: Heating off when no one is at home #works
initial_state: True
hide_entity: False
If I leave after 2300, the _saved_target_temp is 16°C. I assume that’s the problem.
Plattform is generic_thermostat (misst that obviously)
I have two climate of generic_thermostat. And have the same issue with away_mode for both of them. The simplest way to reproduce the issue is to call climate.set_away_mode from Developer tool -> Services twice for the same climate entity. @LukasQ, did you managed to resolve an issue?
No need to check. The issue is still there. I created a pull request with fix.
Unless it will be merged, you can use a custom component for your generic thermostat. Just save this file to \custom_components\climate in your Home Assistant config directory.
I have not seen the need for away mode. I use automation to detect when people are away and change the setpoint on the thermostats. What does away mode add?
Ok, so it reverts to the previous setting when it’s turned off. I can see why this may be useful, instead of just forcing a new setting with an automation.
It will change current temperature as well as enabling away mode. So in fact it will change temperature for away mode, but only for current one. Next time you will enable away mode, the temperature will the same as in config away_temp
So I should detect away mode in my automation and then have multiple actions to put back to normal mode, change the temperature and then put back into away mode.
Well, in this case I have to change the target temp as fixed value and back. Thus, the thermostat is less flexible, as the target temperature is hardcoded in the automation.
Long story short, I worked around with
- condition: template
value_template: ‘{{states.climate.heater.attributes.away_mode == “off”}}’
But didn’t implement it as mentioned. I’ll wait for the merge