Skip to content

tioan/air-dots-card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Air Dots Card for Home Assistant

hacs_badge HA minimum version GitHub Codeberg Created with Claude

A custom Lovelace card inspired by the Awair air quality monitor UI.
Displays up to 5 sensors with a dot-bar indicator, color-coded by severity, and a score ring or inline score column. Fully configurable via the Home Assistant UI editor โ€” no YAML required.

3 themes ร— 5 score positions = 15 combinations.


Themes & Score Positions

๐ŸŒ‘ Default (Awair dark)

โฌ† Center โ—€ Left Right โ–ถ
โ†” Inline Left Inline Right โ†”

๐Ÿ„ Mushroom

โฌ† Center โ—€ Left Right โ–ถ
โ†” Inline Left Inline Right โ†”

๐Ÿซง Bubble Card

โฌ† Center โ—€ Left Right โ–ถ
โ†” Inline Left Inline Right โ†”

Score position modes

Value Description
center Score ring centered above the sensor row (default)
left Score ring on the left, sensors fill the remaining width
right Score ring on the right, sensors fill the remaining width
inline_left No ring โ€” score as first column (left) with dot indicator
inline_right No ring โ€” score as last column (right) with dot indicator

Features

  • Score ring or inline score column with color-coded severity label
  • Up to 5 sensor columns with 5-dot bar indicators
  • Dot color reflects severity: ๐ŸŸข โ†’ ๐ŸŸก โ†’ ๐ŸŸ  โ†’ ๐Ÿ”ด โ†’ ๐ŸŸฃ
  • Three visual themes: default, mushroom, bubble
  • Five score positions: center, left, right, inline_left, inline_right
  • Full UI editor โ€” configure everything without touching YAML
  • Sensors can be added, removed, and reordered in the editor
  • Awair thresholds pre-loaded as defaults
  • Tap any sensor column to open the entity detail dialog

Installation

Option A โ€” HACS (recommended)

  1. Open HACS in Home Assistant
  2. Go to Frontend โ†’ click โ‹ฎ โ†’ Custom repositories
  3. Add https://github.com/tioan/air-dots-card with category Lovelace
  4. Search for Air Dots Card and install it
  5. Hard-reload the browser (Ctrl+Shift+R)

Option B โ€” Manual

1 โ€” Copy the file

Copy air-dots-card.js into your Home Assistant www folder:

/config/www/air-dots-card.js

If the www folder doesn't exist yet, create it inside /config/.


2 โ€” Register the resource

Go to Settings โ†’ Dashboards โ†’ โ‹ฎ Menu โ†’ Resources and add:

Field Value
URL /local/air-dots-card.js
Resource type JavaScript Module

3 โ€” Add the card via UI

Click Add Card, search for Air Dots Card and select it. The card opens in the visual editor.


UI Editor

The editor is fully translated โ€” it switches language automatically based on your browser locale, or you can set it explicitly via the language dropdown.

What you can configure

Setting Description
Theme Visual style: Default, Mushroom or Bubble Card
Score position center ยท left ยท right ยท inline_left ยท inline_right
Language Auto (browser locale) ยท English ยท Deutsch
Card title Optional label above the card
Score entity HA sensor providing the score (0โ€“100)
Sensor entity Entity picker per sensor
Label / Unit Display name and unit string
Thresholds 4 values defining the 5 severity levels

Sensors can be reordered with โ†‘ / โ†“ and removed with โœ•. New sensors are added with + Add sensor and come pre-filled with the next Awair default.

Tip: Switch between visual editor and YAML at any time using the < > toggle in the card editor header.


YAML configuration

type: custom:air-dots-card
title: Living Room
theme: default                # default | mushroom | bubble
score_position: center        # center | left | right | inline_left | inline_right
language: auto                # auto | en | de

score_entity: sensor.awair_element_score

sensors:
  - entity: sensor.awair_element_temperature
    label: Temp
    unit: "ยฐC"
    thresholds: [18, 20, 25, 27]
    symmetric: true

  - entity: sensor.awair_element_humidity
    label: Humidity
    unit: "%"
    thresholds: [30, 40, 60, 65]
    symmetric: true

  - entity: sensor.awair_element_co2
    label: "COโ‚‚"
    unit: ppm
    thresholds: [600, 1000, 2000, 4500]

  - entity: sensor.awair_element_voc
    label: Chemicals
    unit: ppb
    thresholds: [300, 500, 3000, 25000]

  - entity: sensor.awair_element_pm25
    label: PM2.5
    unit: "ยตg/mยณ"
    thresholds: [12, 35, 55, 150]

All options

Option Type Default Description
theme string default default ยท mushroom ยท bubble
score_position string center center ยท left ยท right ยท inline_left ยท inline_right
language string auto auto (HA profile language) ยท en ยท de
title string โ€” Optional label above the card
score_entity string โ€” HA sensor providing score (0โ€“100)
sensors list โ€” List of sensor definitions

Sensor options

Option Type Required Description
entity string โœ… Entity ID
label string โœ… Display name
unit string โœ… Unit string
thresholds list โœ… 4 boundary values (see below)
symmetric bool โ€” true for sensors where the optimal range is in the center (temp, humidity). Thresholds define [low_bad, low_ok, high_ok, high_bad]. Default: false (linear scale, higher = worse).

Note: mushroom and bubble themes inherit HA CSS variables automatically โ€” no extra integration needed.


Awair threshold reference

Temperature and humidity use a symmetric scale (both extremes are bad, middle is optimal).
COโ‚‚, TVOCs and PM2.5 are linear โ€” higher is always worse.

Official thresholds

Sensor Unit L1 ๐ŸŸข L2 ๐ŸŸก L3 ๐ŸŸ  L4 ๐Ÿ”ด L5 ๐ŸŸฃ thresholds
Score /100 80โ€“100 60โ€“80 40โ€“60 20โ€“40 0โ€“20 (inverted)
Temperature ยฐC 20โ€“25 18โ€“20 / 25โ€“27 16โ€“18 / 27โ€“29 <16 / 29โ€“34 <8 / >34 [18, 20, 25, 27]
Humidity % 40โ€“60 30โ€“40 / 60โ€“65 23โ€“30 / 65โ€“80 <23 / >80 <14 [30, 40, 60, 65]
COโ‚‚ ppm 0โ€“600 600โ€“1000 1000โ€“2000 2000โ€“4500 >4500 [600, 1000, 2000, 4500]
TVOCs ppb 0โ€“300 300โ€“500 500โ€“3000 3000โ€“25000 >25000 [300, 500, 3000, 25000]
PM2.5 ยตg/mยณ 0โ€“12 12โ€“35 35โ€“55 55โ€“150 >150 [12, 35, 55, 150]

Compatible sensors

  • Awair Element / Omni / 2nd Edition โ€” via Awair integration
  • Sensirion SEN55 / SPS30 โ€” via ESPHome
  • SCD40 / SCD41 โ€” via ESPHome
  • BME680 / BME688 โ€” via ESPHome (no PM2.5)
  • IKEA VINDSTYRKA โ€” via Zigbee2MQTT

Troubleshooting

Card not appearing โ†’ Hard-reload (Ctrl+Shift+R) and clear cache.
"Custom element doesn't exist" โ†’ Check resource URL is /local/air-dots-card.js and type is JavaScript Module. With HACS this is added automatically.
Score shows -- โ†’ Verify score_entity exists with a numeric state.
UI editor not showing โ†’ Resource type must be JavaScript Module, not JavaScript.
Mushroom/Bubble looks wrong โ†’ Check your HA theme is set under Profile โ†’ Theme.


License

MIT โ€” free to use, modify and share.


Credits

This card was developed interactively with Claude Sonnet 4.6 by Anthropic.
The design is inspired by the Awair Element air quality monitor UI.

Source code: codeberg.org/tioan/air-dots-card (mirror: github.com/tioan/air-dots-card)

About

Air Dots Card - Awair-inspired air quality card with dot indicators, score ring and themes for Home Assistant Lovelace

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors