It is golden hour

The It is golden hour condition passes during golden hour, the time around sunrise and sunset when the sun sits low in the sky and the light turns warm and soft. Golden hour is the period when the sun’s elevation is between 4° below the horizon and 6° above it. You can match any golden hour, or narrow it to the morning or the evening. Home Assistant works this out from your home location.

Use it to run an automation only while that warm, low light lasts, like setting a cozy scene, dimming the lights to match the mood outside, or lowering the blinds against a low sun.

Using this condition from the user interface

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

To use this condition in an automation:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation, or select Create automation > Create new automation.
  3. In the And if section, select Add condition.
  4. From the search box, search for and select It is golden hour.
  5. Under Period, select Any, Morning, or Evening.
  6. Select Save.

Options in the UI

Period

Which golden hour passes the condition:

  • 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.

Using this condition 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 condition as sun.is_golden_hour. A basic example looks like this:

ConditionConditions are an optional part of an automation that will prevent an action from firing if they are not met. [Learn more]
condition: sun.is_golden_hour

This passes during any golden hour. To match only the morning or the evening, add the period option:

ConditionConditions are an optional part of an automation that will prevent an action from firing if they are not met. [Learn more]
condition: sun.is_golden_hour
options:
  period: evening

Options in YAML

period string

Which golden hour passes the condition. 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).

Good to know

  • This condition does not use a target. It checks the sun at your configured home location.
  • Golden hour is the period when the sun’s elevation is between -4° and 6°. To test if the sun’s elevation is just below it, between -6° and -4°, use It is blue hour.
  • The morning golden hour happens while the sun is rising, and the evening golden hour while it is descending. To tell the two apart on their own, use Sun is ascending and Sun is descending.
  • 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, and the condition does not pass then.

Try it yourself

Ready to test this? Go to Settings > Automations & scenes, open an automation, and add this condition. Trigger the automation with and without the condition met, and watch whether it continues or stops.

More examples

Real scenarios where this condition gates an automation. 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: warm the living room during evening golden hour

When motion is detected in the living room during the evening golden hour, turn on the lamps at a warm color so the indoor light matches the low sun outside.

  • Trigger: Living room motion detected

  • Condition: It is golden hour

    • Period: Evening
  • Action: Turn on light

    • Target: Living room lamps
YAML example for warm light during golden hour
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Warm living room during golden hour"
triggers:
  - trigger: state
    entity_id: binary_sensor.living_room_motion
    to: "on"
conditions:
  - condition: sun.is_golden_hour
    options:
      period: evening
actions:
  - action: light.turn_on
    target:
      entity_id: light.living_room_lamps
    data:
      color_temp_kelvin: 2700

Still stuck?

The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the condition 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 conditions or suggest the right one when you describe what you want in plain language.

Related conditions

These conditions work well alongside this one:

  • It is blue hour: Tests if it is blue hour, optionally for a specific period.

  • Sun is up: Tests if the sun is up.

  • Sun elevation: Tests the sun’s elevation against a threshold you set.