Automation UI, Sun and Time

I’m using the Automation UI to create automations to turn a light ON 15mins after Sunset and turn it OFF at 00:30:00.

I have created two automations as follows;
i) Using Sun/Sunset/+00:15 as a Trigger, to turn the light ON, and it works perfectly.
ii) Uses Time/00:30:00 as a Trigger, to turn the light OFF, but it does not work - the light remains ON throughout the night.

I have used ii) to successfully turn the light OFF at 00:11:00, ie before 00:00:00. However I can’t figure out how to create the correct OFF automation, using the UI, to span midnight.

I’ve been at this for a few days now and am going around in circles, so I would appreciate if someone could get me back on the straight and narrow.

It would help if you showed us your automations.

  • id: ‘1599953480306’
    alias: Turn on Garden at sunset
    description: Lights will turn on 15mins after sunset
    trigger:
    • event: sunset
      offset: +00:15
      platform: sun
      condition: []
      action:
    • device_id: xxxxx
      domain: switch
      entity_id: switch.garden
      type: turn_on
      mode: single
  • id: ‘yyyyyyyyyy’
    alias: Garden OFF
    description: Turn Garden lights off at 00:30
    trigger:
    • at: 00:30:00
      platform: time
      condition: []
      action:
    • device_id: xxxxx
      domain: switch
      entity_id: switch.garden
      type: turn_off
      mode: single

Please edit your post and format the pasted code correctly. See point 11 here: Help us help you

do i leave the “id’s” as they are?

Yeah that’s not going to help anyone hack you.

- id: '1599953480306'
  alias: Turn on Garden at sunset
  description: Lights will turn on 15mins after sunset
  trigger:
  - event: sunset
    offset: +00:15
    platform: sun
  condition: []
  action:
  - device_id: f05db912f35846729040df7b834548b1
    domain: switch
    entity_id: switch.garden
    type: turn_on
  mode: single
- id: '1600771692656'
  alias: Garden OFF
  description: Turn Garden lights off at 00:30
  trigger:
  - at: 00:30:00
    platform: time
  condition: []
  action:
  - device_id: f05db912f35846729040df7b834548b1
    domain: switch
    entity_id: switch.garden
    type: turn_off
  mode: single


Try:

- id: '1600771692656'
  alias: Garden OFF
  description: Turn Garden lights off at 00:30
  trigger:
  - at: 0:30:00
    platform: time
1 Like

OK will do

@ tom_I

You were spot on. I was so taken aback at the simplicity of your advice (you should have seen my ideas !!!) that I re-read the documentation and have spotted the !WARNING.

Lesson learned (hopefully)

1 Like

I wasn’t sure if that warning only applied to the time pattern trigger. Now we know.