jeremyhamm / home-assistant-moon

Phases of the moon for home assistant
MIT License
14 stars 6 forks source link
home-assistant home-assistant-custom home-assistant-frontend home-automation lovelace lovelace-card lovelace-configuration lovelace-custom-card lovelace-ui moon-phase

Home Assistant Moon 🌙

License: MIT

Custom card for displaying the current phase of the moon in Home Assistant using the moon integration. This card also (optionally) uses the Sun Entity to determine the background color of the card.

When sun is above horizon

Day example

When sun is below horizon

Night example

Installation

Step 1

Enable the moon integration by adding the following to configuration.yaml:

sensor:
- platform: moon

Step 2

Install moon-card by copying moon.js and images from this repo to <config directory>/www/moon-phases on your Home Assistant instance.

Step 3

Link moon-card inside your ui-lovelace.yaml.

resources:
- url: /local/moon-phases/moon.js
  type: module

Config

Name Type Default Reference Description
type string Required custom:moon-phases Card reference
entity string Required sensor.moon Moon entity
entity string Optional sun.sun Include if you would like the card to use light mode while sun is up

Example

type: 'custom:moon-phases'
entities: 
- sensor.moon
- sun.sun