Simple sun condition not working in automation

I want to use the state for sun.sun entity as a condition in an automation. However, whatever I set according to https://www.home-assistant.io/docs/scripts/conditions/, somehow the condition always ends up being TRUE.

So I created a simple Sun Test Automation, to check if the sun condition works :

- id: '123'
  alias: test sun
  description: ''
  trigger: []
  condition:
  - condition: state
    entity_id: sun.sun
    state: below_horizon
  action:
  - service: notify.mobile_app
    data:
    message: sun test done
    mode: single

What ever I use, like a not condition: above_horizon, or include state with ‘quotes’, it just doesn’t work. The condition keeps on being TRUE, so action is triggered :frowning:

And for the funny guys; yes, the state for entity sun.sun is above_horizon :crazy_face:

Help me out, because I asume it is a simple stupid mistake I am making…

You don’t have any trigger in your automatiom,so I assume you execute it manually? If so, that’s expected behaviour, when an automation is ececuted manually, all triggers and conditions are ignored and it goes straight to the action part.

Yeah, just learned that from a friend… :grimacing:

Thanks man, “problem” solved… :rofl: :rofl: :rofl: