Sun elevation not working

I want to trigger my lights when it gets to dark and do this by running the sun attribute ‘elevation’, but it doesn’t seem to work. I can’t find what is wrong with the script. when I check the sun.sun elevation values I can see it go, for example, from 2,12 to 1,67 but the script doesn’t run.

triggers:
  - trigger: numeric_state
    entity_id:
      - sun.sun
    attribute: elevation
    below: "2"

Sorry, tried to quote some old syntax here initially - but do you really need the quotes around the number?

When I set it up in my GUI, it shows like this in the ‘Edit YAML’ view:

triggers:
  - trigger: numeric_state
    entity_id:
      - sun.sun
    attribute: elevation
    below: 2