Time Pattern automation not triggering garden

I am trying to have my garden drip system turn on every hour on the hour between Sunrise and Sunset. I have tried many variations of the following YAML, all created via the gui but none seem to work. I am triggering a zone on my Rachio sprinkler system which works manually or via other triggering mechanisms. Any help would be appreciated.

(Device ID removed but it is correct in the real code)

alias: Keep Garden Wet
description: Run the Garden Drip System
trigger:
  - platform: sun
    event: sunrise
    offset: 0
  - platform: time_pattern
    minutes: "0"
condition:
  - condition: sun
    after: sunrise
    before: sunset
action:
  - type: turn_on
    device_id: ********
    entity_id: switch.garden
    domain: switch
mode: single
  - platform: time_pattern
    hours: "*"

I assume you have a separate automation that sets the switch to off?

Yes I do.

Let me give it a go.

Thank you

When you said “but none seem to work”, did you inspect the automation’s trace for possible clues?

I looked at it, but as a true noob, I didn’t even know what I was looking at. Do you know if there is tutorial about the traces I can look at?

Thank you very much. After looking at the link you sent, I was able to follow the trace and see what is causing the final issue. it appears that the “after sunrise” condition is not showing sunrise in my location, but Amsterdam.

I was able to get my location changed and now the time of sunrise and sunset is correct.

Thank you very much for your help.

1 Like