Startup error: 'not set' cannot be processed as a number

getting a new startup error

Error initializing 'Marte bijna thuis' trigger: In 'numeric_state' condition: entity proximity.marte_home state 'not set' cannot be processed as a number

on this automation:

  - alias: Marte bijna thuis
    id: Marte bijna thuis
    trigger:
      platform: numeric_state
      entity_id: proximity.marte_home
      below: 1000
    condition:
      - >
        {{trigger.to_state is not none and
          trigger.from_state is not none and
          trigger.to_state.state != trigger.from_state.state}}
      - >
        {{states('proximity.marte_home') != 'not set'}}
      - >
        {{state_attr('proximity.marte_home','dir_of_travel') == 'towards' and
          states('device_tracker.life360_marte') != 'home'}}
      - condition: state
        entity_id: input_boolean.notify_presence
        state: 'on'
    action:
      service: notify.w_m
      data:
        message: >-
          Marte is op {{states('proximity.marte_home')}} meter van huis,
          en is over {{states('sensor.waze_marte_home')}} minuten thuis!

Maybe this is a new error, I havent touched these automations since forever… maybe an issue with Proximity? or with the treatment of numeric state?

maybe simply add:

    condition:
      - >
        {{is_number(trigger.to_state.state)}}

?

Please have a look if you can help me out here?
thanks!

not set has been on startup since the great folder migration in 2019. So it’s been like this for a long time now. Wrap it in a template sensor or ignore the error.

yes, Ive now found several extra mentions, but they all provide solutions I can no use… just restarted with the additional condition template doest help either.

which part do you mean here? a trigger, or condition?

like:

    trigger:
      platform: template
      value_template: >
        {{states('proximity.marte_home')|float(0) < 1000}}

a bit odd though to add a default 0 for it will trigger in that case…

and yet the error wasn’t there before… maybe the logging changed a bit. nvm, just like to solve it

then change the logic or the default so it doesn’t trigger.

I see that for the 6 family members, 2 dont throw the error, and they use a plain distance() template sensor. Or a Waze sensor, which ofc is in minutes, (so have different triggering attributes)

seems a better solution, though I really like the attributes the proximity provides us.

not really sure they are in the same unit, because frontend seems to auto format 1000 (m) to 1.02 km… will have to experiment (and correct the numeric trigger too, because it is incorrectly set to 1000 km in this case… only now do I see that.)

proximity:

  marte_home:
    zone: home
    devices:
      - device_tracker.life360_marte
    tolerance: 50
    unit_of_measurement: km

how odd this has triggered at all… .