You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculation and graph overhaul + Moon support (#56)
- Completely revamped calculations and Sun graph, now way more realistic
- Moon support: Moon on the graph, moonrise, moonset, Moon phase, Moon elevation and Moon azimuth
- Obeys Home Assistant's settings for time and number formatting
- Cleaned up config options
- Font size adjustments, including the smaller AM/PM text from the original card
- Lots of tests
- All lint warnings gone
Resolves the following issues:
- #11 - Moon support
- #30 - Horizon-card customize with card-mod
- #40 - More realistic visualization and own source of Sun data
- #54 - 24h format not working by default
- #58 - Support HA 2023.7's local/server time zone setting
Copy file name to clipboardExpand all lines: README.md
+98-21
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,28 @@ Consider joining us!
10
10
11
11
## Introduction
12
12
13
-
The Horizon Card tracks the position of the Sun over the horizon and shows the times of various Sun events, as well as the current azimuth and elevation, in a visually appealing and easy-to-read format.
13
+
The Horizon Card tracks the position of the Sun and the Moon over the horizon and shows the times of various Sun and Moon events, as well as their current azimuth and elevation, in a visually appealing and easy-to-read format.
The card will show the Sun and the Moon as they travel across the horizon from East to West. Both celestial bodies will be shown when above or below the horizon.
23
+
24
+
The current view shows a period of 24 hours centered around the local solar noon. This means that the Sun will continue to travel to the far end of the graph until it reaches solar midnight, which may be some time before or after midnight in your local time zone. Once solar midnight is reached, the view will reset and start showing the data for the next day.
25
+
26
+
In the Northern hemisphere, East is on the left, South is in the middle (when the Sun is in its highest position), and West is on the right. You are facing South and the Sun travels left-to-right.
27
+
28
+
In the Southern hemisphere, West is on the left, North is in the middle (when the Sun is in its highest position), and East is on the right. You are facing North and the Sun travels right-to-left. You can disable the direction flip by setting `southern_flip: false`.
29
+
30
+
The elevation of the Sun follows a predetermined curve that approximates the actual elevation, while the elevation of the Moon affects its vertical position in the graph. The scale for the Moon elevation is logarithmic, so lower elevations will appear higher (above horizon) or lower (below horizon).
31
+
32
+
If showing the moon phase is enabled, the icon will be rotated to match the approximate view for your latitude. You can disable this by setting `moon_phase_rotation: 0` or set a different angle to match your location or preferences.
33
+
34
+
20
35
## Installation
21
36
22
37
Please ensure you have the [Sun integration](https://www.home-assistant.io/integrations/sun/) enabled in your Home Assistant setup.
@@ -79,28 +94,53 @@ Installation via HACS is recommended, but a manual setup is supported.
79
94
80
95
## Configuration
81
96
82
-
| Name | Accepted values | Description | Default |
| language | See below | Changes card language | Home Assistant language or English if not supported |
115
+
| time_format | `language`, `12`, `24` | Set to `12` or `24` to force 12/24 hour clock | `language` - uses default for configured language |
116
+
| number_format | `language`, `comma_decimal`, `decimal_comma` | Set to `comma_decimal` or `decimal_comma` to force 123.45/123,45 number format | `language` - uses default for configured language |
117
+
| latitude | *number* | Latitude used for calculations | Home Assistant's latitude |
118
+
| longitude | *number* | Longitude used for calculations | Home Assistant's longitude |
119
+
| elevation | *number* | Elevation (above sea) used for calculations | Home Assistant's elevation |
120
+
| time_zone | *string* | Time zone (IANA) used for calculations and time presentation | Home Assistant's time zone |
121
+
| now | *Date* | Overrides the current moment shown on the card | None, i.e., always show the current moment |
122
+
| debug_level | *number* | Sets debug level, 0 and up | 0, i.e., no debug |
90
123
91
124
### Visibility Fields
92
125
93
126
Supported settings inside the `fields` setting:
94
127
95
-
| Name | Accepted values | Description | Default |
| sunrise | *boolean* | Show sunrise time | `true` |
131
+
| sunset | *boolean* | Show sunset time | `true` |
132
+
| dawn | *boolean* | Show dawn time | `true` |
133
+
| noon | *boolean* | Show solar noon time | `true` |
134
+
| dusk | *boolean* | Show dusk time | `true` |
135
+
| azimuth | *boolean* | Show Sun and Moon azimuth | `false` |
136
+
| sun_azimuth | *boolean* | Show Sun azimuth | the value of `azimuth` |
137
+
| moon_azimuth | *boolean* | Show Moon azimuth | the value of `azimuth` |
138
+
| elevation | *boolean* | Show Sun and Moon elevation | `false` |
139
+
| sun_elevation | *boolean* | Show Sun elevation | the value of `elevation` |
140
+
| moon_elevation | *boolean* | Show Moon elevation | the value of `elevation` |
141
+
| moonrise | *boolean* | Show moonrise time | `false` |
142
+
| moonset | *boolean* | Show moonset time | `false` |
143
+
| moon_phase | *boolean* | Show the Moon phase | `false` |
104
144
105
145
### Languages
106
146
@@ -140,6 +180,43 @@ Supported options for the `language` setting:
140
180
- `zh-Hans`Chinese, simplified
141
181
- `zh-Hant`Chinese, traditional
142
182
143
-
## Known Issues
144
-
145
-
- Home Assistant reports the time of the next occurring Sun event. For example, if you look at the card during the day, the time for sunrise will reflect tomorrow's sunrise and not the one that occurred on the same day.
183
+
### Caveats
184
+
185
+
The Moon phase name (if the field `moon_phase` is enabled) is obtained via the [Moon integration](https://www.home-assistant.io/integrations/moon/). If the integration is not installed, the card will still show the Moon phase as a human-readable constant followed by `(!)`, e.g., `waning_gibbuous (!)`. Due to the way Home Assistant works, the localized Moon phase name will always be in Home Assistant's language and not in the language set for the card via the `language` option.
186
+
187
+
### Example config
188
+
189
+
The following YAML configuration illustrates the use of all options.
0 commit comments