[Solved] Help with double sun condition automation

Hey guys,
I have an automation set up that turns my garden lights ON an hour (or so) after sunset and a second one that turns them OFF an hour (or so) before sunrise.
What i want to achieve is to write a third automation that will run when the HA boots and will turn the lights ON the time is between the aforementioned ones.
Here is what i am working on, but it wont fire as expected.

- alias: Turn on garden after reboot
  trigger:
    platform: homeassistant
    event: start
  condition:
    condition: and
    conditions:
      - condition: sun
        after: sunset
        after_offset: "00:32:00"
      - condition: sun
        before: sunrise
        before_offset: "01:00:00"
  action:
    alias: Turn Garden On
    entity_id: group.fwta_kipou
    service: switch.turn_on

If i manually trigger it, it does turn on the lights.
I have an identical automation that notifies me when HA boots up.
So i am guessing that the action and trigger parts are ok, what’s wrong with the condition part?

If I remember correctly you should use just offset and use a minus before the title like "-01:00:00".

Well, i got the code from the official documentation here
I think what you are referring to is the format when writing triggers.
ie:

  trigger:
  - event: sunset
    offset: +03:40:00
    platform: sun

But if you could you give me the whole block of code, i would be happy to try it out. :slight_smile:

Just give me some time together home, I’m on the train now.

Is tnat an invitation? :open_mouth:
j/k, sure, take your time, im trying to figure out mqtt anyway :slight_smile:

Lol… I meant “some time to get home”…

1 Like

I´m not using those triggers anymore (substituted by input_numbers) but this is what i was using:

Found my error, was using AND instead of OR. It seemed more logical.
Thanks man

1 Like