Golden hour ended

The Golden hour ended trigger fires when golden hour is over, the warm, low-light time around sunrise and sunset. Golden hour is the period when the sun’s elevation is between 4° below the horizon and 6° above it. You can react to the end of the morning golden hour, the evening one, or both. Home Assistant calculates the exact time for every day from your home location.

Use it to close a warm evening scene as the light fades, switch to normal indoor lighting after sunset, or open the blinds once the low morning sun has climbed higher.

Using this trigger from the user interface

If you prefer building automations visually, Home Assistant walks you through this trigger step by step. You pick what to watch, tweak a few options, and save. No YAML knowledge required.

To use this trigger in an automation:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation, or select Create automation > Create new automation.
  3. In the When section, select Add trigger.
  4. From the search box, search for and select Golden hour ended.
  5. Under Period, select Any, Morning, or Evening.
  6. Optionally, set an offset to fire before or after golden hour ends:
    • Under Offset, enter how far from the end of golden hour to fire, such as 15 minutes.
    • Under Offset type, select Before or After.
  7. Select Save.

Options in the UI

Period

Which golden hour the trigger reacts to:

  • Any: both the morning and the evening golden hour. This is the default.
  • Morning: only the golden hour around sunrise, while the sun is rising.
  • Evening: only the golden hour around sunset, while the sun is descending.
Offset

The length of time from the end of golden hour when the trigger fires, in days, hours, minutes, and seconds. By default there is no offset, so the trigger fires exactly when golden hour ends.

Offset type

Whether the offset applies before or after golden hour ends:

  • Before: fires the offset amount before golden hour ends. This is the default.
  • After: fires the offset amount after golden hour ends.

Using this trigger in YAML

If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.

In YAML, refer to this trigger as sun.golden_hour_ended. A basic example looks like this:

TriggerA trigger is a set of values or conditions of a platform that are defined to cause an automation to run. [Learn more]
trigger: sun.golden_hour_ended

This fires when either the morning or the evening golden hour ends. To react to only the morning or the evening, add the period option:

TriggerA trigger is a set of values or conditions of a platform that are defined to cause an automation to run. [Learn more]
trigger: sun.golden_hour_ended
options:
  period: evening

To fire a fixed amount of time before or after golden hour ends, add the offset and offset_type options:

TriggerA trigger is a set of values or conditions of a platform that are defined to cause an automation to run. [Learn more]
trigger: sun.golden_hour_ended
options:
  period: evening
  offset:
    minutes: 15
  offset_type: after

This fires 15 minutes after the evening golden hour ends.

Options in YAML

period string

Which golden hour the trigger reacts to. Accepts any (both the morning and the evening golden hour), morning (the golden hour around sunrise, while the sun is rising), or evening (the golden hour around sunset, while the sun is descending).

offset time

The length of time from the end of golden hour when the trigger fires. Accepts a time period mapping in hours, minutes, seconds, and days. Also accepts a duration string in HH:MM:SS format. Combine it with offset_type to fire before or after golden hour ends.

offset_type string

Whether the offset applies before or after golden hour ends. Accepts before or after.

Good to know

  • This trigger does not use a target. It applies to the sun at your configured home location.
  • Golden hour is the period when the sun’s elevation is between -4° and 6°. In the morning, it ends as the sun rises past 6°. In the evening, it ends as the sun descends past -4°, where blue hour begins.
  • To react to the moment golden hour starts, use Golden hour started. For the deeper twilight just after evening golden hour, use Blue hour started.
  • The length of golden hour changes through the year and with your latitude. Near the poles, it can last much longer or fail to occur on some days. When it does not occur, the trigger does not fire on that day.

Try it yourself

Ready to test this? Go to Settings > Automations & scenes, create a new automation, and add this trigger. Save the automation, then change the state of the targeted entity to watch the trigger fire on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more].

For this trigger, there is no target entity to change. To test it, wait for the next golden hour, or temporarily switch to a trigger you can control while you build the rest of the automation.

More examples

Real scenarios where this trigger fires in automations and scripts. Copy any example and adapt it to your setup.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Automation: turn on indoor lights when evening golden hour ends

When the evening golden hour ends and the warm light fades, turn on the indoor lights so the room stays comfortably lit into the evening.

  • Trigger: Golden hour ended
    • Period: Evening
  • Action: Turn on light
    • Target: Living room lights
YAML example for indoor lights after golden hour
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Indoor lights after evening golden hour"
triggers:
  - trigger: sun.golden_hour_ended
    options:
      period: evening
actions:
  - action: light.turn_on
    target:
      entity_id: light.living_room

Still stuck?

The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the trigger you’re using and what you expected to happen, or share on our subreddit /r/homeassistant.

Tip

AI assistants like ChatGPT or Claude can also explain triggers or suggest the right one when you describe what you want in plain language.

Related triggers

These triggers work well alongside this one:

  • Golden hour started: Triggers when golden hour starts, in the morning, the evening, or either.

  • Blue hour ended: Triggers when blue hour ends, in the morning, the evening, or either.

  • Sunset: Triggers when the sun sets.