Strange state regarding GPS coordinates (Away = not at home and visa versa)

Dear forum readers,

I’m using the latest release of HA on a RPI4 and I’m trying to automate something basic.

My use case:
Based on my GPS coordinates from my smartphone (this works, coordinates are changing; 0 = home)

  • Leave home → Lights out
  • Enter home → Light on

I followed a lot of YouTube instructions, but nothing really seems to work fine for me.
This also because the interface/options from HA is changing or the use case is more complex than mentioned above.

My problem:
When I change parameters in Automations the parameters from/to changes from Away to Not_Home or visa. I don’t get it….
When I enter home the lights turn on, but when I leave nothing happens…

Can anybody help me please?

Thank you in advance.

Hans

`
alias: Home
description: “”
trigger:

  • platform: state
    entity_id:
    • device_tracker.smartphone_hans
      to: home
      alias: home
      for:
      hours: 0
      minutes: 0
      seconds: 1
      condition: []
      action:
  • service: light.turn_on
    data: {}
    target:
    area_id: hallway
    device_id: 2239e13244b3adb63ea40121edcc1904
    entity_id: light.light_hallway_light
  • service: notify.mobile_app_smartphone_hans
    data:
    message: Home
    title: Home
    mode: single
    `

`
alias: Not home
description: “”
trigger:

  • platform: state
    entity_id:
    • device_tracker.smartphone_hans
      to: Away
      alias: Away
      for:
      hours: 0
      minutes: 0
      seconds: 0
      from: home
      condition: []
      action:
  • service: light.turn_off
    data: {}
  • service: notify.mobile_app_smartphone_hans
    data:
    message: Not home
    title: "Not home "
    mode: single
    `