Motion sensor to action problem

Hi there…

Not sure exactly where you go wrong, but i can’t happen to notice a few ‘beginner’ mistakes:

And regarding your automation, have a look at the cookbook tip abt motion activated automations:

In your case, you can add the time condition to it, which would be as simple as:

conditions:
  - condition: sun
    before: sunrise
    before_offset: "00:30:00"
    after: sunset
    after_offset: "00:30:00"

NB: for a condition goes that all of them must be true in order to work, so it is automatically and (and therefor no need to specify it)