1.9.0 • Published 6 months ago

lunar-phase-card v1.9.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

hacs total-downloads latest-downloads

🌘 Lunar Phase Card

Table of contents

Features

  • Current Lunar Phase Display: Shows the current phase of the moon.
  • Detailed Lunar Information: Provides additional details about the lunar cycle.
  • Customizable: Easily customizable to fit your dashboard's theme.
  • Responsive Design: Works well on both desktop and mobile devices.
  • Custom Latitude and Longitude Configuration: Offers the possibility to configure custom latitude and longitude for precise lunar data.
  • Specific Date Lunar Information: Option to display the moon information for a specific date.
  • Multilingual Support: The card includes various translations, making it accessible in multiple languages.

Supported Localization

Language CodeNameNative Name
caCatalanCatalà
csCzechČeština
daDanishDansk
deGermanDeutsch
enEnglishEnglish
esSpanishEspañol
frFrenchFrançais
idIndonesianBahasa Indonesia
itItalianItaliano
nlNederlandsDutch
ptPortuguesePortuguês (Brasil)
ruРусскийРусский
skSlovakSlovenčina

View options

  • Default view Default card Default no header
  • Calendar card Calendar card Calendar no header
  • Horizon graph Dynamic card no header Horizon card Horizon card no header
  • Compact view Compact card Compact card no header

Installation

HACS (Home Assistant Community Store)

  1. Go to HACS page on your Home Assistant instance
  2. Add this repository via HACS Custom repositories How to add Custom Repositories
https://github.com/ngocjohn/lunar-phase-card
  1. Select Dashboard
  2. Press add icon and search for Lunar Phase Card
  3. Select Lunar Phase Card repo and install
  4. Force refresh the Home Assistant page Ctrl + F5 / Shift + + R
  5. Add lunar-phase-card to your page

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Manual

  1. Download the lunar-phase-card.js.
  2. Place the downloaded file on your Home Assistant machine in the config/www folder (when there is no www folder in the folder where your configuration.yaml file is, create it and place the file there).
  3. In Home Assistant go to Configuration->Lovelace Dashboards->Resources (When there is no resources tag on the Lovelace Dashboard page, enable advanced mode in your account settings, and retry this step).
  4. Add a new resource:
    • Url = /local/lunar-phase-card.js
    • Resource type = module
  5. Force refresh the Home Assistant page Ctrl + F5 / Shift + + R.
  6. Add lunar-phase-card to your page.

Configuration

Card config editor

NameTypeRequirementDescription
typestringRequiredThe type of the card. For this card, use custom:lunar-phase-card.
entitystringOptionalThe entity_id from Lunar Phase custom component sensor.*_moon_phase
use_defaultbooleanOptionalWhether to use default settings. Defaults to true.
use_entitybooleanOptionalWhether to use entity settings. Defaults to false.
use_custombooleanOptionalWhether to use custom settings. Defaults to false.
show_backgroundbooleanOptionalWhether to show the background image. Defaults to false.
compact_viewbooleanOptionalWhether to display the card in a compact view. Defaults to false.
12hr_formatbooleanOptionalWhether to display time in 12-hour format. Defaults to false.
mile_unitbooleanOptionalWhether to display distance in miles. Defaults to false.
hide_buttonsbooleanOptionalWhether to hide the buttons in header. Defaults to false.
calendar_modalbooleanOptionalWhether to use calendar as modal popup. Defaults to false.
default_cardstringOptionalDefault view of the card. Options: base, calendar, horizon. Defaults to base.
moon_positionstringOptionalPosition of the moon image. Options: left, right. Defaults to left.
southern_hemispherebooleanOptionalAdjusts the moon orientation for southern hemisphere users. Defaults to false.
number_decimalsnumberOptionalNumber of decimals for numerical values. Defaults to 2.
selected_languagestringOptionalISO code of the language to be used. Defaults to system or en.
latitudenumberOptionalThe latitude for which to calculate the lunar phase.
longitudenumberOptionalThe longitude for which to calculate the lunar phase.
font_customizeobjectOptionalCustomize fonts for the card. See below for details.
graph_configobjectOptionalConfiguration for the chart. See below for details.

!NOTE The entity parameter is not required. It refers to the entity ID from the Lunar Card Custom component, which can be installed here. If the entity is not defined, the card will use the default latitude and longitude from the system configuration.

Font Customization Options

NameTypeDescription
header_font_sizestringFont size for the header. Options: auto, small, medium, large, x-large, xx-large. Defaults to x-large.
header_font_stylestringText style for the header. Options: none, capitalize, uppercase, lowercase. Defaults to capitalize.
header_font_colorstringColor for the header text.
label_font_sizestringFont size for labels. Options: auto, small, medium, large, x-large, xx-large. Defaults to auto.
label_font_stylestringText style for labels. Options: none, capitalize, uppercase, lowercase. Defaults to none.
label_font_colorstringColor for label text.
hide_labelbooleanWhether to hide labels on the card. Defaults to false.

Chart Configuration Options

NameTypeDescription
graph_typestringType of the graph. Options: default, dynamic. Defaults to default.
y_ticksbooleanWhether to show y-axis ticks. Defaults to false.
x_ticksbooleanWhether to show x-axis ticks. Defaults to false.
show_timebooleanWhether to show time labels on the chart. Defaults to true.
show_currentbooleanWhether to show the current moon position. Defaults to true.
show_highestbooleanWhether to show the highest moon point. Defaults to true.
y_ticks_positionstringPosition of the y-axis ticks. Options: left, right. Defaults to left.
y_ticks_step_sizenumberStep size for y-axis ticks. Defaults to 30.
time_step_sizenumberStep size for time labels. Defaults to 30.

Example Configuration

Here's an example configuration for the Lunar Phase Card:

type: custom:lunar-phase-card
entity: ""
use_default: true
use_custom: false
use_entity: false
show_background: true
selected_language: en
compact_view: false
12hr_format: false
mile_unit: false
hide_buttons: false
calendar_modal: false
default_card: base
moon_position: left
southern_hemisphere: false
number_decimals: 2
graph_config:
  y_ticks: false
  x_ticks: false
  show_time: true
  show_current: true
  show_highest: true
  y_ticks_position: left
  y_ticks_step_size: 30
  time_step_size: 30
  graph_type: default
font_customize:
  header_font_size: x-large
  header_font_style: capitalize
  header_font_color: ""
  label_font_size: auto
  label_font_style: none
  label_font_color: ""
  hide_label: false
latitude: 50.0874654
longitude: 14.4212535

Contribution Guidelines

We welcome contributions and are grateful for your support in improving this project. If you'd like to contribute, please follow our Contribution Guidelines to get started.


© 2024 Viet Ngoc

https://github.com/ngocjohn/