It does not seem to like [before] in a trigger

So I am just getting started with my automation projects.

I am trying to alter the rainy day lights on example provided here:

When I do so, I get errors about before not being correct, so I tried moving it to a condition, and that seems to screw things up more.

Any suggestions?

    automation 2:
      alias: 'Rainy Day'

      trigger:
           - platform: numeric_state
             entity_id: sensor.yr_cloudiness
             above: 80
           
      condition:
           - condition: state
             entity_id: group.all_devices
             state: 'home'
           - condition: time
             after: '10:00'
             before: '24:00'

      action:
        service: light.turn_on
        entity_id: light.guest_room_night_stand, light.entry_way_lamp

I cross posted to reddit. If I get a solution, I will make sure it is posted in both places.

Instead of before: '24:00', try before: '00:00'
Also, if it doesn’t work, try pasting your error log.

That seems to do the trick. Thanks very much. My original error was something about [before] not being an acceptable trigger. That is what made me move the time into a condition. I don’t understand how the very first example automation they show off has this listed as a trigger. I could never get it to work that way. Either way, its working now.

Thanks!

So it sounds like maybe it would have worked as a trigger, it was the value set for before that was the issue. Glad to be passed this one.

You can’t use before as a trigger, only after, so it will trigger just after the time you’ve set. If you try before, HA doesn’t know how many time ‘before’ has to trigger your automation.