Need help with Sunset offset

Below is a yaml for turning on a lamp 45 min before sunset, but it turns on at sunset. Is there something wrong with my syntax on the offset?

alias: Lamp On At Sunset
description: ''
trigger:
  - platform: sun
    event: sunset
    offset: '-45'
condition: []
action:
  - type: turn_on
    device_id: 5116139f2ffdb7176714b14feb460d8e
    entity_id: switch.lava_lamp
    domain: switch
mode: single

The format of your offset is incorrect. Look at the example. https://www.home-assistant.io/docs/automation/trigger/#sunset--sunrise-trigger

2 Likes

That worked perfectly, thanks for the guidance

2 Likes