It is polar night
The It is polar night condition passes during the polar night, the part of the year at high latitudes when the sun stays below the horizon for a full 24 hours and never rises. Home Assistant works this out from your home location.
Use it to adapt automations that normally rely on the sun coming up. For example, run a daylight lamp through the dark season, or keep indoor lights on during the day when the sun never rises.
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:
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- In the And if section, select Add condition.
- From the search box, search for and select It is polar night.
- Select Save.
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_polar_night. It has no options:
condition: sun.is_polar_night
This passes only while the sun stays below the horizon around the clock.
Good to know
- This condition does not use a target. It checks the sun at your configured home location.
- The polar night only happens at high latitudes, roughly above the polar circles, during the local winter. Away from the poles, this condition never passes.
- This condition follows the sun’s daily high, at solar noon: it passes while that midday high stays below the horizon, and turns off at the solar noon when the high rises above it again. On a full polar-night day the sun never crosses the horizon, so Sunrise and Sunset do not fire and Sun is up does not pass.
- On the day the polar night ends, the sun can briefly clear the horizon around midday before the condition turns off at solar noon. Even during the polar night, there can still be twilight around midday when the sun is just below the horizon.
- For the opposite time of year, when the sun stays above the horizon all day, use It is midnight sun.
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.
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: run a daylight lamp during the polar night
When morning comes during the polar night, turn on a bright daylight lamp so the room has some light even though the sun does not rise.
-
Trigger: Time
-
At time:
8:00:00AM
-
At time:
- Condition: It is polar night
-
Action: Turn on light
- Target: Daylight lamp
YAML example for a daylight lamp during the polar night
alias: "Daylight lamp during the polar night"
triggers:
- trigger: time
at: "08:00:00"
conditions:
- condition: sun.is_polar_night
actions:
- action: light.turn_on
target:
entity_id: light.daylight_lamp
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.
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 midnight sun: Tests if it is midnight sun.
-
It is night: Tests if it is night.
-
Sun is set: Tests if the sun is set.