I am trying to switch the heating on when me or my wife is heading to home. Like a preheat function.
With no luck…
This is my configuration, please give me a feedback:)
in my config:
proximity:
norbert_home:
zone: home
devices: device_tracker.pixel_3a
tolerance: 50
unit_of_measurement: km
noemi_home:
zone: home
devices: device_tracker.mi_8
tolerance: 50
unit_of_measurement: km
This is my automation for turning the a heating to the away mode when we are away about 2km from the house.
alias: Tado AWAY mode when family leave
description: ''
trigger:
- platform: numeric_state
entity_id: proximity.noemi_home
above: '2'
- platform: numeric_state
entity_id: proximity.norbert_home
above: '2'
condition:
- condition: or
conditions:
- condition: and
conditions:
- condition: template
value_template: >-
{{ states.proximity.noemi_home.attributes.dir_of_travel ==
"away_from" }}
- condition: state
entity_id: device_tracker.mi_8
state: not_home
- condition: and
conditions:
- condition: template
value_template: >-
{{ states.proximity.norbert_home.attributes.dir_of_travel ==
"away_from" }}
- condition: state
entity_id: device_tracker.pixel_3a
state: not_home
action:
- device_id: device id
domain: climate
entity_id: climate.bedroom
type: set_preset_mode
preset_mode: away
mode: single
This would be the pre heat, when my wife or I is going home and the heating is start 5km before arrive:
alias: Tado HOME mode when family arrive
description: ''
trigger:
- platform: numeric_state
entity_id: proximity.noemi_home
below: '5'
- platform: numeric_state
entity_id: proximity.norbert_home
below: '5'
condition:
- condition: or
conditions:
- condition: and
conditions:
- condition: template
value_template: >-
{{ states.proximity.noemi_home.attributes.dir_of_travel ==
"towards" }}
- condition: state
entity_id: device_tracker.mi_8
state: not_home
- condition: and
conditions:
- condition: template
value_template: >-
{{ states.proximity.norbert_home.attributes.dir_of_travel ==
"towards" }}
- condition: state
entity_id: device_tracker.pixel_3a
state: not_home
action:
- device_id: device id
domain: climate
entity_id: climate.bedroom
type: set_preset_mode
preset_mode: home
mode: single
let’s start with the triggers. According to the documentation, the above and below attributes accept numeric values. You provide string values (‘5’). Don’t know, if there is some conversion, but removing the quotes should not harm.
Next, the template conditions can be evaluated in the Developer Tools -> Templates (Entwicklerwerzeuge -> Vorlage). You need to switch your user profile to Advanced Mode to see the developer tools.
Proximity will be hard to test, as you or Noemi need to drive/walk away from home to test. You can use the proximity entity’s history to check, if dir_of_travel and distance are properly reported. Maybe the Android app settings prevent continuous reporting, at least for iOS you need to allow background position tracking explicitely.
What is device id? Whatever it is it’s not named correctly (there is a space in it).
Why are you waiting until you are 2km away from home to shut down the climate? A condition for all relevant device_tracker state in not_home should suffice no?
condition:
- condition: state
entity_id: device_tracker.pixel_3a
state: not_home
- condition: state
entity_id: device_tracker.mi_8
state: not_home
Why is that? You can set the state of a proximity sensor with the Developer Tools States tool like any other entity. You just need to remember to set the direction of travel attribute at the same time.
When we are near to home or (for safeguard) when we are at home
alias: TADO Home mode ON when near
description: ''
trigger:
- platform: numeric_state
entity_id: proximity.home
below: '5'
condition:
- condition: and
conditions:
- condition: state
entity_id: group.csalad
state: not_home
- condition: template
value_template: '{{ states.proximity.home.attributes.dir_of_travel == "towards" }}'
action:
- device_id: device_id
domain: climate
entity_id: climate.living_room
type: set_preset_mode
preset_mode: home
mode: single
initial_state: 'on'
alias: TADO HOME mode ON (safeguard)
description: ''
trigger:
- platform: state
entity_id: group.csalad
to: home
condition:
- condition: state
entity_id: group.csalad
state: not_home
action:
- device_id: device_id
domain: climate
entity_id: climate.living_room
type: set_preset_mode
preset_mode: home
mode: single
initial_state: 'on'
The away mode:
alias: TADO AWAY mode when csalad leave
description: ''
trigger:
- platform: state
entity_id: group.csalad
to: not_home
condition: []
action:
- device_id: devide_id
domain: climate
entity_id: climate.living_room
type: set_preset_mode
preset_mode: away
mode: single