Why this numeric state triggered?

Hey, I have stuck with strange automation trigger.

  trigger:
  - platform: numeric_state
    entity_id:
    - proximity.pre_home_armen
    - proximity.pre_home_gayane
    below: 3

Automation was triggered, but sensor has been at 0 for 11 hours… How is it possible?

One more thing to say, I had a restart around 3 hours ago (Home Assistant update). But it should not be a reason, should it?

P.S. It’s not the first time I see that exact thing. I just was never able to figure it out

I think that’s exactly the reason for the trigger. The state was unknown/unavailable during restart, then it got initialized with a value of 0,which is below 3 → trigger.
Did the trigger hapoen at around the same time as you restarted HA?

c8cf5601903a7ca4fb26c038fb59bc91995f78f3_2_690x381

1 Like

Restart was around 3 hours earlier, but as I see now, sensor was updated first time only after ≈ 3 hours. So you and @tom_l are right.

Now the only question is how to prevent that. I don’t see option like below 3 from != unknown in docs

Tray adding this condition to your automation.

condition:
  condition: template
  value_template: "{{ trigger.from_state not in ['unknown', 'unavailable', 'none'] }}"
2 Likes

I tried to emulate problematic situation in automation was not triggered, so your code seems to work. Thank you
Will check out for couple of days to make sure that it works