45 alternative calendars and time systems as Home Assistant sensors โ plus an interactive Solar System dashboard card.
A custom integration for Home Assistant, installed through HACS. Every time system is a sensor you can put on a dashboard or use in automations and templates: Star Trek stardates, the Maya Long Count, the Islamic, Hindu and Chinese calendars, Mars time, Swatch Internet beats, Unix time and Julian dates, Middle-earth and Discworld, NATO date-time groups and many more. The Solar System card shows planets, dwarf planets, asteroids and moons for any date between 3000 BC and 3000 AD.
- ๐ฐ๏ธ 45 time systems as sensors from science, space, history, cultures, religions, the military, science fiction, fantasy and games โ see the full list.
- ๐ช Solar System card for your dashboard: rotate and zoom, pick any date from 3000 BC to 3000 AD, switch planets, dwarf planets, asteroids and moons on and off, open a planet's moon system. Orbit data from NASA JPL. More below.
- ๐งญ Setup wizard: choose categories and calendars and set each calendar's options. Change them any time under Configure; the sensors reload without a restart.
- ๐๏ธ Easy on the recorder: attributes are never recorded, and every sensor is called
sensor.alternative_time_<id>, so one line excludes them all. The card itself writes nothing. - ๐ 12 languages for sensor names and the wizard: English, German, Spanish, French, Italian, Dutch, Polish, Portuguese, Russian, Japanese, Chinese and Korean.
- ๐ Checked maths: the calendars are tested against published reference values, the card against positions from NASA JPL Horizons, and the whole integration inside a real Home Assistant core on every change.
- ๐ฆ Light: one Python requirement (
LunarCalendar), Home Assistant 2024.12 or newer.
- ๐ช Solar System card: a dashboard card that ships with the integration โ no second HACS entry, no resource to add by hand. Rotate, zoom, any date, selectable objects, moon systems to scale.
- ๐ Sources you can check: planets from NASA JPL's Approximate Positions of the Planets, small bodies and moons fitted to JPL Horizons. The card names its sources and shows each object's accuracy.
Every release is listed in CHANGELOG.md (German) and under Version History.
Each one becomes a sensor. Pick the ones you want in the setup wizard; the sensor id is the same on every installation.
๐ป Technical
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| Decimal Time | sensor.alternative_time_decimal |
every second | French Revolutionary time: 10 hours, 100 minutes, 100 seconds per day |
| Hexadecimal Time | sensor.alternative_time_hexadecimal |
every 5 s | Day divided into 65536 parts, displayed in hex (e.g. .8000 = noon) |
| International Atomic Time (TAI) | sensor.alternative_time_tai |
every second | High-precision atomic time scale. TAI = UTC + 37 seconds (no leap seconds) |
| Julian Date | sensor.alternative_time_julian_date |
every second | Continuous day count since January 1, 4713 BCE noon UTC |
| Sidereal Time | sensor.alternative_time_sidereal |
every second | Astronomical time based on Earth's rotation relative to distant stars. Includes GMST, GAST, LMST, LAST, and ERA. |
| Swatch Internet Time | sensor.alternative_time_swatch |
every second | Internet Time in Beats @000-@999. One day = 1000 beats, no time zones |
| Universal Time 1 (UT1) | sensor.alternative_time_ut1 |
every second | Earth rotation time based on actual rotation. UT1 = UTC + DUT1 (from IERS) |
| Unix Timestamp | sensor.alternative_time_unix |
every second | Seconds since January 1, 1970, 00:00 UTC (e.g. 1735689600) |
| World Timezones | sensor.alternative_time_timezone |
every second | Display time in different timezones around the world |
๐ Space and astronomy
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| Cosmic Speedometer | sensor.alternative_time_cosmic_speedometer |
every minute | How fast are you really moving? Earth rotation, orbit, solar system, and galaxy speeds! |
| Darian Calendar (Mars) | sensor.alternative_time_darian |
hourly | Mars calendar with 24 months and 668 sols per year (e.g. 15 Gemini 217) |
| ESA Lunar Time | sensor.alternative_time_lunar_time |
every minute | Lunar Time Coordinated (LTC) for future Moon missions |
| Lunar Coordinate Time (TCL) | sensor.alternative_time_lunar_tcl |
every minute | Relativistic lunar timescale for cislunar space operations |
| Mars Sol Time | sensor.alternative_time_mars |
every minute | Mars Sol Date (MSD) and local solar time on Mars |
| Solar System Positions | sensor.alternative_time_solar_system |
every 5 min | Current positions of planets in the solar system. |
| Stellar Distances | sensor.alternative_time_stellar_distances |
hourly | Real-time distances with measurement accuracy (ยฑ%) to notable stars and the 6 nearest pulsars. Data: Gaia DR3, VLBI |
๐๏ธ Historical
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| Attic Calendar | sensor.alternative_time_attic |
hourly | Ancient Athenian lunisolar calendar with Archon and Olympiad (e.g. 5 แผฑฯฯฮฑฮผฮญฮฝฮฟฯ Hekatombaion) |
| Egyptian Calendar | sensor.alternative_time_egyptian |
hourly | Ancient Egyptian civil calendar with 365 days (e.g. Dynasty 1 Year 25, 15 Thoth) |
| Maya Calendar | sensor.alternative_time_maya |
hourly | Long Count, Tzolk'in and Haab calendars (e.g. 13.0.12.1.15 / 8 Ahau / 3 Pop) |
| Old English Calendar | sensor.alternative_time_old_english |
hourly | Historical English calendar with year starting on Lady Day (March 25), used 1155-1752 |
| Roman Calendar | sensor.alternative_time_roman |
hourly | Ancient Roman calendar with Kalends, Nones, and Ides (e.g. AUC 2777, ante diem III Kalendas) |
๐ Cultural
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| Chinese Lunar Calendar | sensor.alternative_time_chinese_lunar |
hourly | Traditional Chinese lunar calendar with zodiac animals and festivals |
| Japanese Era Calendar | sensor.alternative_time_japanese_era |
hourly | Traditional Japanese calendar system using imperial era names (Reiwa, Heisei, Shลwa, etc.) |
| Japanese Lunar Calendar | sensor.alternative_time_japanese_lunar |
hourly | Traditional Japanese lunisolar calendar (Kyลซreki) used for festivals and agricultural timing |
| Minguo Calendar (Taiwan) | sensor.alternative_time_minguo_taiwan |
hourly | Taiwan/ROC calendar, Year 1 = 1912 CE (founding of Republic of China) |
| Sexagesimal Cycle | sensor.alternative_time_sexagesimal |
every minute | Traditional East Asian 60-year cycle calendar (Heavenly Stems & Earthly Branches) |
| Sri Lankan Buddhist Calendar | sensor.alternative_time_sri_lanka_buddhist |
hourly | Buddhist Era calendar with Sinhala Poya (full moon) days and Sinhala/Tamil New Year |
| Thai Buddhist Calendar | sensor.alternative_time_suriyakati_thai |
hourly | Thai solar calendar with Buddhist Era year (BE = CE + 543) |
๐ Religious
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| Ge'ez (Ethiopian) Calendar | sensor.alternative_time_geez |
hourly | Traditional Ethiopian calendar with 13 months, used in Ethiopia and Eritrea |
| Hindu Calendar (Panchฤnga) | sensor.alternative_time_hindu_panchang |
hourly | Traditional Hindu lunisolar calendar with Tithi, Nakshatra, Yoga, Karana, and festivals |
| Islamic (Hijri) Calendar | sensor.alternative_time_islamic |
hourly | Lunar Islamic calendar with 12 months and 30-year leap cycle (tabular method) |
๐๏ธ Military
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| German Rescue DTG | sensor.alternative_time_german_rescue_dtg |
every second | German emergency services date-time group format |
| NATO Date Time Group | sensor.alternative_time_dtg |
every second | Military Date Time Group format with timezone designation |
๐ธ Science fiction
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| EVE Online Time | sensor.alternative_time_eve |
every second | New Eden Standard Time (NEST) from EVE Online universe with YC calendar |
| Mass Effect โ Galactic Standard | sensor.alternative_time_mass_effect |
every second | Shows Galactic Standard Time (GST 20:100:100; 1 GST s = 0.5 s) and optional Galactic Standard Year (GSY) counter. |
| Star Trek Stardate | sensor.alternative_time_stardate |
every 10 s | Star Trek stardate system from various series (TNG, TOS, Discovery) |
| Star Wars Galactic Calendar | sensor.alternative_time_star_wars |
hourly | Galactic Standard Calendar with 368-day years (e.g. 35:3:8 ABY) |
| Warhammer 40,000 - Imperial Date (Old Style) | sensor.alternative_time_warhammer40k_imperial |
every 5 min | Formats current Terran time into the Imperial Dating System (C.FFF.YYY.M##). |
๐ง Fantasy
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| D&D Harptos Calendar | sensor.alternative_time_harptos |
hourly | Forgotten Realms calendar: 12ร30 days with festivals, tendays as weeks |
| Discworld Calendar | sensor.alternative_time_discworld |
hourly | Terry Pratchett's Discworld calendar with 8-day weeks, guild influences, and Death appearances |
| Rivendell Calendar (LOTR) | sensor.alternative_time_rivendell |
hourly | Elven calendar from Middle-earth with 6 seasons and yรฉn cycles |
| Shire Calendar (LOTR) | sensor.alternative_time_shire |
hourly | Hobbit calendar from Lord of the Rings with seven meals and special days |
| Tamriel Calendar (Elder Scrolls) | sensor.alternative_time_tamriel |
hourly | Elder Scrolls calendar with two moons, birthsigns, and Daedric summoning days |
๐ฎ Gaming
| Time system | Sensor | Updates | What it shows |
|---|---|---|---|
| Trackmania Events | sensor.alternative_time_trackmania |
every minute | Shows next start times for Cup of the Day (03:00 / 11:00 / 19:00 CE(S)T), Weekly Shorts (Sun 18:00), and Bonk Cup (Thu 20:00). |
| World of Warcraft Calendar | sensor.alternative_time_warcraft |
hourly | Azeroth calendar with seasonal events and moon phases |
- ID:
lunar_tcl - Format:
14:30:45 TCLor2026-01-24 14:30:45 TCL - Features:
- Actual lunar clock time (UTC + relativistic drift)
- Relativistic time dilation between Earth and Moon
- Based on LTE440 ephemeris (JPL DE440)
- Daily drift ~56.7 ยตs (Moon clock runs faster)
- Accumulated difference since epoch (currently ~1-2 ms)
- IAU 2024 Resolution II compliant
- Scientific reference: Lu, Yang & Xie (2025), A&A 704, A76
- Display options: TCL Time, TCL DateTime, TCL+Drift, Daily Drift (ยตs), Accumulated (ms)
- Update: Every 60 seconds
| Parameter | Value |
|---|---|
| Display | 14:30:45 TCL (actual Moon time) |
| Daily drift | ~56.7 ยตs/day (a clock on the Moon runs faster) |
| Accumulated | ~1-2 ms since the J2000.0 epoch |
| Accuracy | <0.15 ns until 2050 |
| Scientific basis | JPL DE440, IAU 2024 Resolution II, 13 periodic terms from orbital mechanics |
Reference: Lu, Yang & Xie, A&A 704, A76 (2025), DOI 10.1051/0004-6361/202557345
- ID:
lunar_time - Format:
LTC 14:30:45 | ๐ Day 8 - Features:
- ESA's proposed Lunar Time Coordinated system
- Lunar timezones (Apollo, Chang'e, Luna landing sites)
- Moon phase display
- Time dilation indicator (56 ยตs/day)
- Update: Every 60 seconds
Real-time distances to notable stars and pulsars with measurement accuracy.
7 Stars:
| Star | Distance | Accuracy | Note |
|---|---|---|---|
| Proxima Centauri | 4.24 ly | ยฑ0.006% | Nearest star |
| Barnard's Star | 5.95 ly | ยฑ0.007% | Fastest proper motion (10.3"/yr) |
| Scholz's Star | 22.2 ly | ยฑ0.17% | Passed Oort Cloud 70,000 years ago |
| Ross 248 | 10.3 ly | ยฑ0.27% | Will be nearest in 36,000 years |
| Gliese 710 | 62.5 ly | ยฑ0.05% | Collision course - 10,600 AU in 1.35 Myr |
| Polaris | 433 ly | ยฑ1.5% | North Star |
| Betelgeuse | 723 ly | ยฑ18% | Supernova candidate |
6 Nearest Pulsars:
| Pulsar | Distance | Accuracy | Note |
|---|---|---|---|
| PSR J0437-4715 | 511 ly | ยฑ0.06% | Nearest millisecond pulsar (173 rot/sec) |
| PSR J0108-1431 | 424 ly | ยฑ13% | Oldest nearby (166 Myr) |
| Vela Pulsar | 932 ly | ยฑ6% | Brightest radio pulsar |
| Geminga | 815 ly | ยฑ32% | First gamma-ray pulsar |
| PSR B0656+14 | 940 ly | ยฑ10% | "Three Musketeers" pulsar |
| PSR B0950+08 | 906 ly | ยฑ8% | Old pulsar in Leo (17.5 Myr) |
Features:
- Real-time distance calculation using parallax + radial velocity
- Measurement uncertainty (ยฑ%) for each object
- Distance range (min-max) based on parallax error
- Accuracy ratings: excellent / very good / good / moderate / uncertain
- Data sources: Gaia DR3, VLBI parallax, Pulsar Timing
-
Features: Real-time planetary positions, visual orbit maps, visibility and retrograde motion as seen from Earth
-
Update: Every 5 minutes
-
Attributes: positions per planet plus the paths of the map files. The map itself is not copied into the attributes;
entity_picturepoints at the SVG file. -
Map image: The plugin writes the rendered orbit map to
config/www/alternative_time/as bothsolar_system_map.svgandsolar_system_map.png. To embed it in a dashboard, use the/local/URL with a cache-busting query parameter so updates are picked up by the browser:type: picture image: /local/alternative_time/solar_system_map.svg?v={{ now().timestamp() | int }}
The
?v=...suffix is required โ without it Home Assistant's aggressive/local/caching will keep showing the old image. Usesolar_system_map.pnginstead if you prefer the raster version. After thewww/folder is created for the first time, Home Assistant must be restarted once before/local/URLs become available.
A dashboard card that ships with the integration โ no second HACS entry, no resource to add by hand. Once the integration is set up (and the browser reloaded), add it like any other card:
type: custom:alternative-time-solar-system-card-
Rotate and zoom: click or tap the picture first, then drag to turn and tilt, use the mouse wheel or two fingers to zoom, and double-click an object to centre on it. Until you click, the wheel and swipes scroll the dashboard as usual. The zoom buttons always work.
-
Any date from 3000 BC to 3000 AD: type a day, month and year (for example 1 January 1125), or run the time-lapse. Dates before 15 October 1582 are read as Julian calendar dates; year 0 is 1 BC.
-
Objects you can switch on and off: the eight planets, nine dwarf planets and candidates (Ceres, Pluto, Haumea, Makemake, Eris, Gonggong, Quaoar, Sedna, Orcus), thirteen asteroids (Vesta, Pallas, Juno, Hygiea, Psyche, Eros, Ida, Gaspra, Chiron, Itokawa, Bennu, Ryugu, Apophis) and twenty-one moons.
-
Moon systems: double-click a planet (or pick it under View) to see its moons to scale โ Earth, Mars, Jupiter, Saturn with its rings, Uranus, Neptune and Pluto.
-
No recorder traffic: everything is computed in the browser. The card creates no entity and writes no state.
Optional settings:
type: custom:alternative-time-solar-system-card
title: Solar system
height: 420 # pixels
date: "1125-01-01" # start on this date instead of today
view: jupiter # start in a moon system (earth, mars, jupiter, saturn, uranus, neptune, pluto)
scale: "true" # distances to scale instead of compressed
show: [planets, dwarfs, vesta, moons] # groups (planets, dwarfs, asteroids, moons) or single objectsWhere the numbers come from, and how good they are
| Objects | Source | Checked for | Largest error |
|---|---|---|---|
| Planets | NASA JPL, Approximate Positions of the Planets (E. M. Standish, J. G. Williams), table 2a/2b, used unchanged | 3000 BC โ 3000 AD | 0.33ยฐ (inner planets 0.04ยฐ) |
| Earth's Moon | J. Meeus, Astronomical Algorithms, ch. 47 (leading terms of ELP-2000/82) | 2000 BC โ 2100 AD | 0.06ยฐ |
| Pluto | Orbit fitted to NASA JPL Horizons | 0 โ 3000 AD | 0.2ยฐ |
| Other dwarf planets, asteroids | Orbits fitted to NASA JPL Horizons | 1600 โ 2200 for most; Chiron 1900 โ 2100; Itokawa and Ryugu 1950 โ 2050; Bennu and Apophis 2000 โ 2029 | under 1ยฐ for most; Hygiea 2.6ยฐ, Bennu 5.6ยฐ |
| Other moons | Circular orbits fitted to NASA JPL Horizons | 1900 โ 2100 | under 2ยฐ for most; Titan, Iapetus, Mimas, Miranda 3โ5ยฐ; Triton's orbit plane up to 19ยฐ |
"Checked" means compared with positions from JPL Horizons; tests_js/ repeats that comparison in CI. Outside its checked years an object is drawn hollow with a dashed orbit: the position is then an extrapolation, not a verified value (Horizons has no asteroid positions before 1600). The card shows the same sources under Orbit data: NASA/JPL โ sources and accuracy, and each object's accuracy when you click it. Sizes are not to scale. The orbit data is regenerated with python scripts/build_solar_system_data.py.
The card speaks English and German; other languages fall back to English.
- Format:
[41]XXX.X(e.g.,[41]986.0) - Features: TNG-style calculation, configurable year offset
- Update: Every 10 seconds
- Format:
35:3:21 GrS | Taungsday | Expansion Week - Features: Galactic Standard Calendar, 10 months, 7 weeks, 5 days per week, 368-day year
- Update: Hourly
- Format:
YC 127.03.15 14:30:45 - Features: New Eden Standard Time, YC dating
- Update: Every second
- Format:
0.523.025.M42 - Features: Check number, year fraction, millennium designation
- Update: Every 5 minutes
- Shire Calendar: Hobbit time with 7 meals
- Calendar of Imladris: Elvish 6-season year
- Calendar of Gondor: Nรบmenรณrean system
- Format:
4E 201, 17 Last Seed (Fredas) - Features: 8-day weeks, Divine blessings, Daedric influence
- Update: Hourly
- Format:
Century of the Anchovy, UC 25, 32 Offle - Features: Impossible dates (32nd of months), Guild influences, L-Space anomalies
- Update: Hourly
- Format:
Year 35, Day of the Wisp, 4th of Deepwood - Features: Azeroth dates, seasonal events, moon phases
- Update: Hourly
- Format:
Dynasty 1 Year 25, ๐ 15 Thoth - Features: Hieroglyphic numbers, 3 seasons, Nile status
- Update: Hourly
- Format:
13.0.12.1.15 | 8 Ahau | 3 Pop - Features: Long Count, Tzolk'in, Haab calendars
- Update: Hourly
- Format:
a.d. XVII Kal. Ian. MMDCCLXXVIII A.U.C. - Features: Kalends, Nones, Ides system, Roman numerals, A.U.C. dating
- Update: Hourly
- Format:
5 histamenou Hekatombaion | Ol.700.2 - Features: Archon years, Olympiad counting
- Update: Hourly
- Format:
15 Ramadan 1447 AH - Features: Tabular calculation, Arabic month names, Islamic holidays
- Update: Hourly
- Format:
็ฒ่พฐๅนด ๅๆ ๅไบ | Wood Dragon - Features: Lunar calendar, Zodiac animals, Heavenly stems & Earthly branches
- Update: Hourly
- Format:
เนเน เธเธฑเธเธงเธฒเธเธก เนเนเนเน - Features: Buddhist Era (BE = CE + 543), Thai numerals
- Update: Hourly
- Format:
ๆฐๅ114ๅนด ๅไบๆ ไบๅไบๆฅ - Features: Republic Era (Year 1 = 1912 CE)
- Update: Hourly
- Format:
ไปคๅ7ๅนด1ๆ24ๆฅ - Features: Imperial era names, Japanese holidays, Rokuyou
- Update: Hourly
- Features: Tithi, Nakshatra, Yoga, Karana, festivals
- Update: Hourly
- Format:
15 แแตแจแจแ 2017orแฒแญ แแตแจแจแ แณแปแฒแฏ - Features: 13-month calendar, native Ge'ez script and numerals
- Update: Hourly
- Format:
13 Rishabha 214 (Sol Veneris)(the day Curiosity landed) - Features: 24 months, 668 or 669 sols per year, years counted from 1609
- Update: Hourly
- Format:
14:25:30 Olympus Mons | Sol 234/MY36 - Features: 24 Mars timezones, mission sol tracking
- Update: Every 30 seconds
- Format:
1735689600 - Update: Every second
- Format:
@500.00 - Features: 1000 .beats per day
- Update: Every second
- Format:
A.F3.C8 - Update: Every 5 seconds
- Format:
2460678.50000 - Update: Every 30 seconds
- Format:
2026-01-24T00:36:52 TAI - Features: Continuous atomic timescale, leap second history
- Update: Every second
- Format:
2026-01-24T00:43:31.767 UT1 - Features: Earth rotation time, IERS API integration
- Update: Configurable (5 min to 24 hours)
- German Format:
241530AJAN26 - US/UK Format:
241530Z JAN 26 - Features: Multiple timezone designators, configurable formats
- Open HACS in your Home Assistant
- Click the three dots โ "Custom repositories"
- Add URL:
https://github.com/Lexorius/alternative_time - Select "Integration" as category
- Click "Add"
- Search for "Alternative Time Systems" and install
- Restart Home Assistant
- Add the integration under Settings โ Devices & Services (see Configuration below)
- Download the
alternative_timefolder from the repository - Copy to
/config/custom_components/ - Restart Home Assistant
- Go to Settings โ Devices & Services
- Click Add Integration
- Search for Alternative Time Systems
- Follow the configuration wizard:
- Step 1: Name your instance
- Step 2: Select categories (Technical, Historical, Cultural, Space, etc.)
- Step 3: Choose calendars from each category
- Step 4: Configure calendar-specific options (time zone, display format, language of month names, โฆ)
- Step 5: Confirm the notice
You can add the integration more than once, for example with different options for the same calendar.
Open Settings โ Devices & Services โ Alternative Time Systems โ Configure:
- Configure a calendar shows the same option fields as the wizard. The sensors reload at once; no restart.
- Migrate entity IDs to sensor.alternative_time_* renames sensors created by older versions (see below).
Edit a dashboard โ Add card โ search for Solar System, or add a manual card:
type: custom:alternative-time-solar-system-cardIf the card is not offered right after installing or updating, reload the browser once. Options, sources and accuracy: Solar System card.
These sensors are clocks: their history is worthless and, for the second-resolution ones, expensive (a states row per change). Two things keep them out of your database:
1. Attributes are never recorded (automatic since v2.6.2). Every sensor declares _unrecorded_attributes = MATCH_ALL, so the recorder stores only the state string. Attributes stay live for dashboards and templates โ they just don't accumulate in state_attributes (the Solar System map alone was ~23 KB per row).
2. Exclude the states with one glob (recommended). All sensors use the stable entity_id sensor.alternative_time_<calendar_id> (e.g. sensor.alternative_time_solar_system), independent of the instance name you chose, so a single line covers everything:
recorder:
exclude:
entity_globs:
- sensor.alternative_time_*To also drop existing history for these sensors after enabling the exclusion, call the service recorder.purge_entities once:
service: recorder.purge_entities
data:
entity_globs:
- sensor.alternative_time_*Entities created by older versions kept the entity_id they were originally given (e.g.
sensor.beats_swatch_internet_time) and are not matched by the glob. Open the integration entry โ Configure โ Migrate entity IDs to sensor.alternative_time_* โ it previews every rename, applies them in the entity registry and posts a notification with the old โ new list. Dashboards and automations that reference the old IDs must be updated by you (HA does not rewrite them). Opt-in and one-shot; nothing changes unless you confirm. The same step also fixes ids likesensor.<area>_alternative_time_โฆthat newer Home Assistant versions created before this integration set the id itself.
Home Assistant offers no way for an integration to exclude an entity's state from the recorder โ that is user configuration only. Ten calendars are genuine second-resolution clocks (unix, tai, eve, decimal, hexadecimal, sidereal, julian_date, timezone, ut1, mass_effect) and will write a row per change until you set the glob above.
Each calendar follows the unified CALENDAR_INFO structure:
- Metadata: ID, version, icon, category, accuracy
- Multi-language: Names and descriptions in 12 languages
- Calendar Data: Months, weeks, special dates, events
- Configuration Options: Customizable per calendar
- Update Intervals: Optimized for each calendar type
tests/ runs without a Home Assistant installation โ homeassistant.* is stubbed in tests/conftest.py. The suite runs every calendar on every day of a leap year and compares the calendar maths with published values (Julian Dates, Mars landing sols, Darian dates of Mars missions, moon phases, Chinese New Year, religious holidays). It also covers discovery, setup and entity ids, scheduling and error paths, recorder churn and the translations, in a few seconds:
pip install pytest aiohttp
python -m pytest tests -qtests_ha/ is the second suite: it runs the integration inside a real Home Assistant core (via pytest-homeassistant-custom-component, Linux or WSL). It sets up every calendar and checks the entity ids the registry hands out, clicks through the whole setup wizard in five languages, and uses the options dialog and the entity id migration:
pip install pytest-homeassistant-custom-component LunarCalendar
python -m pytest tests_ha -qRun the two directories in separate pytest calls โ tests/ replaces homeassistant with stubs.
tests_js/ checks the maths of the Solar System card against positions from NASA JPL Horizons (tests_js/reference.json): node tests_js/run.mjs (Node 22 or newer, no packages), or serve the repository root over HTTP and open tests_js/index.html in a browser. tests_js/demo.html shows the card outside Home Assistant.
CI runs all three suites in python-checks.yml; release.yml only builds a release when hassfest, HACS validation and the Python checks are green on the tagged commit.
Shared maths lives in astro.py (Julian Dates, real new and full moons, Sun and Moon longitude, the lunisolar calendar, Mars Sol Date and season); calendars import it instead of carrying their own copies.
๐ฌ๐ง English (en) | ๐ฉ๐ช Deutsch (de) | ๐ช๐ธ Espaรฑol (es) | ๐ซ๐ท Franรงais (fr) | ๐ฎ๐น Italiano (it) | ๐ณ๐ฑ Nederlands (nl) | ๐ต๐ฑ Polski (pl) | ๐ต๐น Portuguรชs (pt) | ๐ท๐บ ะ ัััะบะธะน (ru) | ๐ฏ๐ต ๆฅๆฌ่ช (ja) | ๐จ๐ณ ไธญๆ (zh-Hans) | ๐ฐ๐ท ํ๊ตญ์ด (ko)
The setup wizard groups the calendars like this:
- technical: Decimal Time, Hexadecimal Time, International Atomic Time (TAI), Julian Date, Sidereal Time, Swatch Internet Time, Universal Time 1 (UT1), Unix Timestamp, World Timezones
- space: Cosmic Speedometer, Darian Calendar (Mars), ESA Lunar Time, Lunar Coordinate Time (TCL), Mars Sol Time, Solar System Positions, Stellar Distances
- historical: Attic Calendar, Egyptian Calendar, Maya Calendar, Old English Calendar, Roman Calendar
- cultural: Chinese Lunar Calendar, Japanese Era Calendar, Japanese Lunar Calendar, Minguo Calendar (Taiwan), Sexagesimal Cycle, Sri Lankan Buddhist Calendar, Thai Buddhist Calendar
- religious: Ge'ez (Ethiopian) Calendar, Hindu Calendar (Panchฤnga), Islamic (Hijri) Calendar
- military: German Rescue DTG, NATO Date Time Group
- scifi: EVE Online Time, Mass Effect โ Galactic Standard, Star Trek Stardate, Star Wars Galactic Calendar, Warhammer 40,000 - Imperial Date (Old Style)
- fantasy: D&D Harptos Calendar, Discworld Calendar, Rivendell Calendar (LOTR), Shire Calendar (LOTR), Tamriel Calendar (Elder Scrolls)
- gaming: Trackmania Events, World of Warcraft Calendar
The Solar System card speaks English and German; other languages see English.
Each sensor updates only as often as its value can change. Attributes are not written to the recorder.
| Update | Time systems |
|---|---|
| Every second | Decimal Time, EVE Online Time, German Rescue DTG, International Atomic Time (TAI), Julian Date, Mass Effect โ Galactic Standard, NATO Date Time Group, Sidereal Time, Swatch Internet Time, Universal Time 1 (UT1), Unix Timestamp, World Timezones |
| Every 5 s | Hexadecimal Time |
| Every 10 s | Star Trek Stardate |
| Every minute | Cosmic Speedometer, ESA Lunar Time, Lunar Coordinate Time (TCL), Mars Sol Time, Sexagesimal Cycle, Trackmania Events |
| Every 5 min | Solar System Positions, Warhammer 40,000 - Imperial Date (Old Style) |
| Hourly | Attic Calendar, Chinese Lunar Calendar, D&D Harptos Calendar, Darian Calendar (Mars), Discworld Calendar, Egyptian Calendar, Ge'ez (Ethiopian) Calendar, Hindu Calendar (Panchฤnga), Islamic (Hijri) Calendar, Japanese Era Calendar, Japanese Lunar Calendar, Maya Calendar, Minguo Calendar (Taiwan), Old English Calendar, Rivendell Calendar (LOTR), Roman Calendar, Shire Calendar (LOTR), Sri Lankan Buddhist Calendar, Star Wars Galactic Calendar, Stellar Distances, Tamriel Calendar (Elder Scrolls), Thai Buddhist Calendar, World of Warcraft Calendar |
----------|-----------------|-----------| | Real-time | 1 second | Unix, Swatch, TAI | | Near real-time | 5-10 seconds | Hexadecimal, Stardate | | Time-based | 30-60 seconds | Mars Time, Julian Date, Lunar Time | | Date-based | 1 hour | Calendar systems, Stellar Distances | | Event-based | 5 minutes | Warhammer 40K |
- ๐ช Solar System card: a dashboard card that ships with the integration. Rotate and zoom, pick any date from 3000 BC to 3000 AD, switch planets, dwarf planets, asteroids and moons on and off, open a planet's moon system. Computed in the browser โ no entity, nothing in the recorder.
- ๐ Orbit data from NASA JPL (planets: Approximate Positions of the Planets; small bodies and moons fitted to JPL Horizons); the card names its sources and each object's accuracy.
tests_js/checks the maths against 478 JPL positions in CI.
- ๐ Wrong values fixed in a dozen calendars: Swatch (one hour off all summer), Julian Date (half a day low), Mars Sol Date and season, Darian (year 85 instead of 221), Islamic weekday, Thai zodiac, lunar illumination, Solar System visibility and retrograde, and real moon maths for Hindu Panchang, the Japanese lunar calendar, Thai holy days and the sexagenary year.
- ๐ Seven calendars ignored all their options (
stardate,discworld,eve,islamic,rivendell,shire,tamriel); the Warcraft calendar crashed on 52 days a year; Migrate entity IDs crashed whenever there was something to migrate. - ๐ 25 calendars used the operating-system clock (UTC in a container); they now use Home Assistant's time zone.
- ๐ New sensors get
sensor.alternative_time_<calendar>set explicitly, so newer Home Assistant versions no longer put device and area names in front. Existing entities keep their id. - ๐๏ธ Solar System: the map is no longer stored three times in the attributes. Removed attributes:
solar_system_map_svg,solar_system_map_png,observer_locationโ uselocal_svg_path,local_png_pathorentity_picture. - ๐งน One calendar discovery instead of three, shared astronomy in
astro.py, dead code and stale files removed; requirements are down toLunarCalendar(pytz,tzlocalandPillowdropped).translations/zh.jsonis nowzh-Hans.json. - ๐งช Tests: 80 โ 175 with published reference values, plus
tests_ha/, which runs the integration inside a real Home Assistant core in CI. - ๐จ Brand assets ship with the integration (
brand/, contributed by frenck).
- ๐งช Test suite (
tests/, 80 tests, no HA install needed) wired into CI; releases are now gated on hassfest, HACS validation and the Python checks passing on the tagged commit. - ๐๏ธ Two more recorder-row sources found by the new tests and removed:
stellar_distances.last_calculated(a microsecond timestamp duplicating HA'slast_updated) andcosmic_speedometer.fun_fact(wasrandom.choiceper update; now rotates hourly). - ๐งน
.gitignoreadded.
- ๐ hassfest: the migration dialog text contained
<calendar>, which the translation validator rejects as HTML (and the frontend may swallow). Now[calendar]in all 13 string files. No code changes.
- ๐๏ธ Attributes are no longer recorded (
_unrecorded_attributes = MATCH_ALLon the base class). Solar System alone wrote ~23 KB of SVG per state row; now only the state string is stored. Attributes stay live. - ๐๏ธ Attribute churn fixed in
dtg,german_rescue_dtg(60ร fewer recorder rows),swatch(86ร fewer) andstardate(~6ร fewer): attributes now change only when the displayed value changes. - โจ Entity-ID migration under Configure โ Migrate entity IDs: renames pre-2.6.0.7 entities to
sensor.alternative_time_<calendar>so the single recorder glob covers them; previews, then posts an old โ new notification. - ๐ Fix: five calendars raised
AttributeErroron every update (chinese_lunar,mars,mass_effect,warcraft,warhammer40k_imperialcalled a never-defined_get_plugin_options). Invisible until 2.6.1 made failures visible. - ๐งน
translations/ps.jsonremoved (Polish text under the Pashto code); dead recorder-exclusion stub removed.
- ๐ Fix: every entity was updated twice โ
should_pollreturnedTrue, so HA polled every sensor every 30 s on top of the plugin's own timer. NowFalse; the timer is the only scheduler, and a tick is skipped while the previous one is still running. - โจ Options changes apply immediately โ an
update_listenernow reloads the entry after saving under Configure (previously required a restart). - ๐๏ธ Failed updates are visible โ first failure of a streak logs a WARNING, entity becomes unavailable after 3 consecutive failures and recovers automatically.
- ๐
ut1: shared aiohttp session + exponential backoff (60 s โ 1 h) instead of retrying the IERS API every second while it is down. - ๐งน
_CONFIG_ENTRIEScleaned on unload;__init__.pyno longer swallows platform setup errors; deadasync_reload_entryremoved.
- ๐ Fix: three calendars never created a sensor โ
julian_date,minguo_taiwan,suriyakati_thaiwere selectable but silently skipped at setup (id โ file name). Discovery now records the module name per id. - ๐ Fix:
sensor.alternative_time_*entity_id prefix actually works now. The 2.6.0.4 change used a non-existent_attr_; replaced by a propersuggested_object_idproperty override. Still applies to newly registered entities only. - ๐ Fix: options of
dtg,german_rescue_dtg,julian_datenow appear in the setup wizard (wrongCALENDAR_INFOkey). Two malformed selects in those plugins repaired. - ๐งน
test_debug.pyno longer ships or shows up as a calendar. - ๐ฆ
tzlocaldeclared as requirement;hacs.jsonnow requires HA โฅ 2024.12.
- ๐ Fix:
formatjs MISSING_VALUEin the options dialog ({title}placeholder is now supplied from the instance name). - โจ Real options flow: clicking Configure on the integration entry now lets you pick a configured calendar and edit its options (previously only showed a placeholder toggle).
- ๐ Fix: plugin options had no effect: sensors read options from
data["plugin_options"]while the config flow stored them underdata["calendar_options"]. Sensors now read the correct key (with legacy fallback). Plugin options set in the setup wizard now actually apply.
- ๐ Fix: 500 Internal Server Error when opening the integration's options under Home Assistant โฅ 2024.12 (
OptionsFlow.config_entrybecame a read-only property in newer HA; the constructor no longer tries to set it).
- ๐ฑ๐ฐ New plugin: Sri Lankan Buddhist Calendar (
sri_lanka_buddhist.py) โ Buddhist Era year, the twelve Sinhala Poya (full-moon) days with religious significance, Sinhala/Tamil New Year countdown, and Sinhala weekday names. Poya dates use Meeus astronomy + the Sri Lankan moonrise rule and reproduce all 11 officially proclaimed Poya days 2023โ2026 exactly. - ๐ฏ Stable entity_id prefix for Recorder filtering: every plugin sensor now gets
sensor.alternative_time_<calendar_id>as suggested entity_id, regardless of the instance name picked in the config flow. A single globsensor.alternative_time_*inrecorder.excludenow matches all of them. (Existing entities keep their previous IDs.) - ๐ README: new section Excluding from Recorder / History under Configuration.
- ๐ฆ CI workflows split: the previous
validate.ymlwas split intohassfest.yml,hacs.yml, andpython-checks.ymlso each check has its own status badge (visible at the top of this README) - ๐ท๏ธ Status badges: hassfest, HACS validation, and Python checks badges added to the README header
- ๐งน Code cleanup: all calendar plugin files are now ruff-clean (E, F, W, I โ
--ignore E501) - ๐ Bare excepts in
dtg.py,german_rescue_dtg.py,mars.py,hindu_panchang.py,japanese_era.py,japanese_lunar.py,stellar_distances.pyreplaced withexcept Exception: - ๐๏ธ Dead variables removed in
geez.py,japanese_lunar.py,lunar_tcl.py,maya.py,solar_system.py,star_wars.py - ๐ Duplicate dict key
"holidays"instar_wars.pyresolved - ๐ฆ Unused import
Lunarremoved fromchinese_lunar.py - โ๏ธ One-line if/else statements in
stellar_distances.pysplit into multi-line form - ๐ง
scripts/bump-version.sh: now supports 4-component versions (x.y.z.b) and a newbuildsubcommand that increments only the 4th component
- ๐ Lunar Coordinate Time (TCL): New plugin
lunar_tcl.pyshowing actual lunar clock time - ๐ TCL Time Display: Shows what time it would be on the Moon (
14:30:45 TCL) - โฑ๏ธ LTE440 Ephemeris: Based on JPL DE440, scientific accuracy <0.15 ns until 2050
- ๐ Daily drift: ~56.7 ยตs/day (Moon clock faster than Earth)
- ๐ 13 periodic terms: Annual (~1.65 ms), monthly (~126 ยตs), and 11 minor terms
- ๐ฌ Scientific basis: Lu, Yang & Xie (2025), Astronomy & Astrophysics 704, A76
- ๐ IAU compliant: IAU 2024 Resolution II (LCRS/TCL standard)
- ๐ ESA Lunar Time: Updated config options with emoji labels for landing sites
- ๐ ๏ธ Config Flow Fix: Fixed dropdown labels for select options
- โญ Stellar Distances Calculator: Real-time distances to 7 stars & 6 pulsars
- ๐ Measurement Accuracy: Uncertainty percentages for all objects
- ๐ Distance Ranges: Min-max based on parallax errors
- ๐ฏ Accuracy Ratings: excellent/very good/good/moderate/uncertain
- ๐ก Data Sources: Gaia DR3, VLBI, Pulsar Timing
- ๐ TAI: International Atomic Time
- ๐ UT1: Universal Time 1 with IERS API
- โ๏ธ Ge'ez Calendar: Ethiopian calendar with native script
- ๐ช Solar System: Improved positioning
- โก Complete Architecture Rewrite
- ๐จ Standardized Calendar Format
- ๐ Multi-language Support (12 languages)
- ๐ Category-based Organization
- โ๏ธ Enhanced Config Flow with plugin options
- v1.6.0: Tamriel, Egyptian, Discworld calendars
- v1.5.0: EVE Online, Shire, Imladris calendars
- v1.4.0: Mars time systems
- v1.3.0: Asian calendars, Attic calendar
- v1.2.0: NATO time formats
- v1.1.0: Maya calendar, async improvements
- v1.0.0: Initial release
- Create
calendars/your_calendar.py - Follow the standardized format (see existing calendars)
- Include
CALENDAR_INFOdictionary with all metadata - Implement sensor class extending
AlternativeTimeSensorBase - Test thoroughly
CALENDAR_INFO = {
"id": "your_calendar",
"version": "1.0.0",
"icon": "mdi:calendar",
"category": "technical",
"update_interval": 3600,
"name": {
"en": "Your Calendar",
"de": "Dein Kalender",
# ... other languages
},
"description": {
"en": "Calendar description",
"de": "Kalenderbeschreibung",
# ... other languages
},
"config_options": {
"option_key": {
"type": "boolean",
"default": True,
"label": {"en": "Option Label", "de": "Optionsbeschriftung"},
"description": {"en": "Option description", "de": "Optionsbeschreibung"}
}
}
}Four GitHub workflows guard the repository โ three validation workflows that run on every push/PR (each with its own status badge at the top of this README), plus the release workflow.
| Job | What it checks |
|---|---|
| Home Assistant hassfest | Official HA integration validation (home-assistant/actions/hassfest) |
| Job | What it checks |
|---|---|
| HACS validation | HACS compliance (hacs/action, category integration); brands, topics, description are currently in the ignore list and can be removed once they're set on the GitHub repo |
Three jobs. Python checks (Python 3.12, no Home Assistant installed):
| Step | Purpose |
|---|---|
| Compile-check | python -m compileall -q custom_components/ โ fails on any syntax error |
| Manifest-Check | bash scripts/check-manifest.sh โ required keys + hassfest-compatible key order |
| Ruff | ruff check custom_components/ tests/ tests_ha/ --select E,F,W,I --ignore E501 โ E501 (line-too-long) is intentionally ignored because of multilingual description strings in 12 languages |
| Tests | python -m pytest tests โ the stub-based suite |
| JSON lint | json.loads() over every *.json file outside .git/ |
| YAML lint | yaml.safe_load() over every *.yml / *.yaml file |
| Version-Konsistenz | If CHANGELOG.md exists, manifest.json's version must appear as a ## [version] heading; missing CHANGELOG.md only emits a warning, a missing version entry is a hard error |
Tests gegen Home Assistant (Python 3.13): installs pytest-homeassistant-custom-component and runs python -m pytest tests_ha โ the integration inside a real Home Assistant core.
Sonnensystem-Karte gegen NASA JPL (Node 22): runs node tests_js/run.mjs โ the card's positions against JPL Horizons.
| Step | Purpose |
|---|---|
| Tag und Version ermitteln | Derives version from the tag (v2.6.0.1 โ 2.6.0.1) |
| manifest.json muss zum Tag passen | Fails if manifest.json version doesn't match the tag โ the bump must be committed before tagging |
| ZIP-Asset bauen | Packs the contents of custom_components/alternative_time/ into alternative_time.zip (excluding __pycache__ and *.pyc) |
| Release-Notes aus CHANGELOG ziehen | Extracts the ## [version] section from CHANGELOG.md if present; otherwise falls back to Release <version> |
| GitHub-Release erstellen | Creates the GitHub release with the ZIP attached; tags containing - (e.g. v2.6.0.1-rc1) are marked as prerelease |
- Check Home Assistant logs for errors
- Verify the calendar file is in the correct directory
- Ensure
CALENDAR_INFO['id']matches the filename
- Check that your calendar has
config_optionsdefined - Verify the option types are supported (text, number, boolean, select)
- Review logs for configuration errors
- Check Home Assistant language settings
- Verify translations exist for your language
- Fallback to English if translation missing
MIT License - See LICENSE file for details.
- Bug Reports: GitHub Issues
- Feature Requests: Open a GitHub issue with [Enhancement] tag

