Compass Card is a Home Assistant Lovelace card that visualizes wind direction and wind speed on a graphical compass, with optional sun position, Czech direction labels, a built-in visual editor, and light/dark theme support.
- graphical compass with a wind direction arrow
- direction label and wind speed in the center of the card
- Czech and English direction labels
- optional sun position based on
sun.sun.attributes.azimuth - optional moon phase and moon position
- north lock mode or compass-driven card rotation
- compass entity support with phone compass fallback
- sunrise, sunset, and daytime sun animations
- Lovelace visual editor
- automatic light and dark theme support
- Open
HACS. - Open the
...menu in the top-right corner and chooseCustom repositories. - Add
https://github.com/moukas/Compass-Card. - Select
Dashboardas the repository type. - Open the repository in HACS and click
Download. - If HACS does not add the resource automatically, add it manually.
If needed, add the resource manually:
url: /hacsfiles/Compass-Card/compass-card.js
type: module- Copy
compass-card.jstoconfig/www/compass-card.js. - Add a dashboard resource in Home Assistant:
url: /local/compass-card.js
type: module- Use the card in your dashboard.
The repository includes a standalone preview:
- local preview:
preview.html - GitHub Pages preview:
docs/index.html
type: custom:compass-card
title: Wind
direction_entity: sensor.wind_direction
speed_entity: sensor.wind_speed
direction_language: cs
compass_mode: follow_compass
compass_entity: sensor.phone_heading
compass_attribute: heading
show_sun: true
sun_entity: sun.sun
sun_attribute: azimuth
show_moon: true
moon_phase_entity: sensor.moon
observer_entity: zone.home
speed_unit: km/h
speed_decimals: 1
degree_decimals: 0
show_degrees: truedirection_entity: entity with wind direction. Supports degrees and text values such asN,SW, orSeverovychod.speed_entity: entity with wind speed.direction_language: direction label language. Supportsenandcs.compass_mode: compass orientation mode. Supportsnorth_lockedandfollow_compass.compass_entity: optional entity that provides heading for compass rotation. If omitted, the card auto-detects a suitable entity and then falls back to the phone compass.compass_attribute: optional heading attribute forcompass_entity(for exampleheading). If omitted, state is used first.compass_entity: __device_compass__: forces the built-in phone compass virtual entity.show_sun: shows the sun position on the compass edge.sun_entity: entity used for sun position. Default issun.sun.sun_attribute: attribute containing azimuth degrees. Default isazimuth.show_moon: enables moon phase and optional moon position rendering.moon_phase_entity: entity with the moon phase state, for examplesensor.moon.moon_position_entity: optional entity providing moon position attributes. If omitted, the card computes moon position from the observer coordinates.moon_azimuth_attribute: attribute containing moon azimuth degrees. Default isazimuth.moon_elevation_attribute: attribute containing moon elevation. Default iselevation.observer_entity: entity with observer coordinates. Default iszone.home.observer_latitude: optional latitude override for moon position computation.observer_longitude: optional longitude override for moon position computation.title: optional card title.speed_unit: optional speed unit override.speed_decimals: number of decimal places for speed.degree_decimals: number of decimal places for degrees.show_degrees: shows the calculated angle in the center of the card.
- If the direction is numeric, the card also shows the corresponding 16-point compass label (
N,NNE,NE, and so on). - With
direction_language: cs, the card uses Czech labels (S,SV,V,JZ, and so on). - If the direction is text-based, the card tries to map it to an angle so the arrow rotates correctly.
- In
north_lockedmode, north stays fixed at the top. - In
follow_compassmode, the whole compass rotates by heading (including wind arrow, sun, and moon markers), so their positions remain correct. - You can use
compass_entityor select the built-inPhone compass (virtual entity)in the visual editor. - On iOS Safari/Home Assistant app, enabling phone compass may require pressing the in-card permission button once.
- When
show_sunis enabled, the card renders a separate sun indicator based on azimuth. - If
sun.sunprovideselevationandrising, the card adds stronger sunrise and sunset animations. - When
show_moonis enabled, the card usesmoon_phase_entityfor the phase and prefersmoon_position_entityfor azimuth/elevation. - If both are available,
moon_position_entityhas priority over computed observer-based moon position. - If
moon_position_entityis missing, the card computes moon azimuth and elevation fromobserver_entityor the latitude/longitude overrides. - Home Assistant usually provides moon phase through a Moon sensor. The observer coordinates can come directly from
zone.home. - If the moon phase is available but observer coordinates are missing too, the card shows the phase label in the center instead of placing the moon on the compass.
- If moon elevation is below the horizon, the moon marker stays visible but dimmed.
- When the entity state is
unavailableorunknown, the card remains rendered and shows that data is missing. - In light mode the card switches to a light theme; in dark mode it stays dark.


