Proximity settings for heating pre heat and turn off

Hello,

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

Thank you for your help

Because:

  • proximity sensors do not work?
  • automation triggers do not work?
  • automation conditions do not work?
  • automation action sequence does not work?

Not sure.
The action is working fine, but the others dont know.

Additional: we both use the HA offical android app.

okay,

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.

image

2 Likes

Good to know. I didn’t until now.

Try removing the quotes from these.

tolerance: 50

Are you sure your GPS accuracy is always below 50? That’s pretty tight.

Ok I changed the away mode to this:

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

I a bit overthought and I dont need proximity for the away mode.

I dont put any quotes for the numbers, this is the webUI. going to remove them and will see

Found a solution on reddit https://www.reddit.com/r/homeassistant/comments/c9304k/beat_the_heat_this_summer_and_have_your_home/

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

and my config changed to this:

proximity:
  home:
    devices:
      - device_tracker.pixel_3a
      - device_tracker.mi_8
    tolerance: 100
    unit_of_measurement: km

In the Dev Tools its working fine, will see in the reality.

1 Like

I used this config in configuration.yaml and now dev tools is showing my proximity correctly. Thanks!