Moon is waning
The Moon is waning condition passes while the moon is waning, the half of the lunar month when the lit part shrinks from the full moon back toward the new moon. Home Assistant works this out from the date, so it needs no account, no internet connection, and no location.
Use it to gate an automation on the falling half of the moon’s cycle, for example to run a routine only while the moon is heading back toward dark.
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 Moon is waning.
- 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. For how an automation is built in YAML, refer to Automations in YAML.
In YAML, put the settings that are specific to this condition under options. Keep target, if the condition uses one, and general settings such as alias and enabled at the top level, next to condition.
In YAML, refer to this condition as moon.is_waning. It has no options:
condition: moon.is_waning
This passes while the moon is waning.
Good to know
- This condition does not use a target. It checks the moon phase, which is the same everywhere on Earth, so it does not depend on your home location.
- The moon wanes from the full moon back to the new moon, then waxes from the new moon up to the full moon. For the opposite check, use Moon is waxing.
- The phase is based on the date, so it changes at most once a day.
- To test for a single phase instead of the direction, use Moon phase.
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. In the visual editor, select the UI options listed in the example or paste the YAML code.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the visual 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: wind-down reminder while the moon wanes
Each evening, send a gentle wind-down reminder, but only while the moon is waning.
-
Trigger: Time
- At time: 9:00:00 PM
- Condition: Moon is waning
-
Action: Send a notification message
-
Target: My Device (
notify.my_device)
-
Target: My Device (
YAML example for a waning moon reminder
alias: "Waning moon wind-down reminder"
triggers:
- trigger: time
at: "21:00:00"
conditions:
- condition: moon.is_waning
actions:
- action: notify.send_message
target:
entity_id: notify.my_device
data:
message: "The moon is waning."
Still stuck?
To find out why the condition didn’t pass, check it live in the automation editor, and look at the trace of the run. For details, refer to Testing automations. For common problems and their solutions, refer to Troubleshooting automations.
If that doesn’t help, 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
Explore related conditions:
-
Moon is waxing: Tests if the moon is waxing.
-
Moon phase: Tests if the moon is in a specific phase.