This Home Assistant custom component provides moon phase information including visibility, distance, altitude, next full moon, next new moon, moonrise, moonset, phase, illumination, and age in days, based on your location set in Home Assistant.
To use this custom component, you need to have Home Assistant installed. If you haven't installed Home Assistant, follow the installation guide before proceeding.
-
Copy the
moon_phase
directory into your Home Assistant'scustom_components
directory. If thecustom_components
directory does not exist, you will need to create it./custom_components/moon_phase
-
Restart Home Assistant to apply the changes.
To enable the Moon Phase custom component, add the following to your configuration.yaml
file:
sensor:
- platform: moon_phase
Once installed and configured, the Moon Phase custom component will create moon_phase
sensor that you can use in Home Assistant automations, scripts, or display on the user interface.
latitude
: Latitude of the location.longitude
: Longitude of the location.phase
: Current moon phase represented as a float value ranging from 0 to 1.visible
: Percentage of moon's elongation, indicating its visibility.distance
: Distance from Earth to the moon in kilometers.altitude
: Altitude of the moon in degrees.next_full_moon
: Date and time of the next full moon.next_new_moon
: Date and time of the next new moon.days_to_full_moon
: Number of days until the next full moon.days_to_new_moon
: Number of days until the next new moon.today_moonrise
: Date and time of today's moonrise.today_moonset
: Date and time of today's moonset.illumination
: Percentage of moon's illumination.age_days
: Age of the moon in days.