Problem with 'sun' sunset and 'after'

hi.
i have an automation which i want to trigger ONLY after sunset… but that of course recurring.
i think i may have a misunderstanding of sunset.

so the automation looks like the following

    platform: state
    entity_id: binary_sensor.aeotec_zw100_multisensor_6_sensor
    from: 'off'
    to: 'on'
  condition:
    - condition: sun
      after: sunset

and i want this to trigger whenever its after sunset and the sensor detects motion.
the first bit works… so the sensor is picking up and turns the light on (i also have one which turns the light off)
however this only works up till midnight :(.
so after midnight its a new day and doesnt work… (it would be my guess that this is normal and as its a new day - its no longer AFTER sunset on that day … although the sun icon still shows a moon…
so how should i do this… put in an ‘and’ which says ‘before: sunrise’ ? … this seems overkill to me…

I guess it works like this. There must be a point where it’s no longer ‘after sunset’ i suppose. But you can use a condition based on elevation.

condition: or
conditions:
  - condition: sun
    after: sunset 
  - condition: sun 
    before: sunrise 

i did exactlz that… but i had hoped to be able to just leave it at after: sunset … i had assumed ( making an “ass out of U an ME”) that sunset lasts till sunrise…
thanks though

You could also do this, which I’ve used and is a bit simpler:

condition:
  condition: state
  entity_id: sun.sun
  state: below_horizon
6 Likes