HA Wrapped: Home Assistant Wrapped, your smart home year in review
“Your shutters traveled 4.2 km this year. If this were an elevator,
it would deserve a tip.”
A Wrapped-style year (or month) in review for your Home Assistant. It
doesn’t count what you configured, it counts what your home actually
did: laundry loads, liters of water, kWh, doorbell rings, kilometers of
shutter travel. Rolling odometer numbers, a chart per stat, a recap card to
share, and optional AI one-liners in your language.

▶ Live demo with sample data, no install. ·
💬 Forum thread for questions and ideas.
- Runs as a Home Assistant app: config UI with entity pickers, page in
the sidebar, no access token.
- AI copy without an extra API key: uses the AI you already set up in
Home Assistant (AI Task: OpenAI, Gemini, Anthropic, a local Ollama …).
Or bring a Claude key, or switch it off.
- Yearly and monthly, generated automatically on the 1st if you want.
- A push on the day you pick (default 1 December): “Your 2026 at home
is ready”, tap and it opens. Testable from the settings.
- Story image in one tap: the recap as a 1080×1920 PNG, ready for
Instagram or WhatsApp.
- Private: only totals go to the AI, never your history.
- Not on Home Assistant OS? The same engine runs from the command line
or Docker, see Run it yourself.
- Seven languages: English, Deutsch, Français, Español, Italiano,
Nederlands, Português.
Install as a Home Assistant app (recommended)
Home Assistant renamed add-ons to apps in 2026.2. Same thing,
new name. HA Wrapped is an app repository, so it is added under
Settings → Apps, not in the Marketplace (formerly HACS), which only
handles integrations and dashboard cards.
- Add the repository. Click the badge above, or go to
Settings → Apps, open the store, ⋮ → Repositories, paste
https://github.com/3DJupp/ha-wrapped and hit Add.
- Install HA Wrapped from the list (refresh it if it doesn’t show up
yet), then Start it.
- Open Wrapped in the sidebar, add your Totals (meters and
sensors with statistics) and Events (things to count), then hit
Generate.
The result opens in the sidebar and is also written to
/share/ha-wrapped/ha_wrapped.html and /local/ha-wrapped/ for
dashboards. The app reaches Home Assistant with its own credentials, you
never create an access token. Details in
ha_wrapped/DOCS.md.
Configuration
Everything is set on the app’s own page, which looks and works like Home
Assistant’s settings, in light or dark and in seven languages.
| Overview |
A total, opened |
 |
 |
| Push notification |
On a phone |
 |
 |
- Totals read Home Assistant’s long-term statistics: pick Total for
meters (energy, water), Average or Highest value for sensors,
Counter, difference for lifetime counters that never reset.
- Events count how often an entity turned into a state (
on by
default). Several entities add up, for example all shutters as one.
- Events only go back as far as your recorder does. They are counted
from history, and Home Assistant keeps 10 days by default
(
purge_keep_days). For a month or a year, either keep history that
long or use a counter with long-term statistics and add it under
Totals.
- More options per entry: Multiply by turns counts into fun numbers
(shutter runs × window height = meters travelled), plus decimal places
and small print.
- Schedule: create a new wrapped after every month or year, and send
a push on the day you pick (default 1 December). Send test tries it
right away.
AI texts
Pick who writes the one-liners under AI texts → Written by:
| Setting |
What happens |
| Automatic (default) |
Claude if you entered an Anthropic key, otherwise Home Assistant’s AI, otherwise plain names |
| Home Assistant AI |
Uses the AI from Settings → System → General → AI suggestions, or the AI entity you pick. No extra key, works with local models |
| Claude, own API key |
Your own Anthropic API key |
| Nobody, plain names |
Your plain names, nothing leaves the house |
Only the totals and your names are sent, never entity history.
What it does
- Pulls yearly totals from Home Assistant’s long-term statistics over
the WebSocket API (water, energy, anything cumulative — also averages
and peaks).
- Counts state changes via the REST history API (laundry loads,
coffees brewed, doorbell rings, shutter cycles, …).
- Turns counts into fun numbers with a
scale factor (shutter cycles ×
window height = travel distance).
- Optionally lets an AI write witty copy in your language and tone of
choice: Home Assistant’s own AI Task (whatever AI you set up there)
or the Claude API. Without either it falls back to your plain
labels, the page works either way.
- Renders everything into a single HTML file. No server, no
dependencies at view time. Open it, scroll, screenshot, share.
Only aggregated numbers ever leave your network, and only if you opt into
the LLM copy. No entity history is uploaded anywhere.
Run it yourself (CLI / Docker)
This is the self-hosted path for Home Assistant Container/Core installs
(no apps there) or anyone who prefers it: you run the script against your
own HA instance and keep the resulting HTML file. No app involved.
Grab the config, fill in your entities, create a
long-lived access token
in your Home Assistant profile, export it as HA_TOKEN — then any one
of these runs the whole thing:
# 0) the config (edit it once, the rest is one-liners)
curl -fsSL https://raw.githubusercontent.com/3DJupp/ha-wrapped/main/config.example.yaml -o config.yaml
export HA_TOKEN="eyJ..." # secrets stay env-only
export ANTHROPIC_API_KEY="sk-ant-..." # optional; without it, HA's AI Task
# writes the copy (if you have one)
# uv (Linux / macOS / Windows)
uvx --from git+https://github.com/3DJupp/ha-wrapped ha-wrapped
# pipx
pipx run --spec git+https://github.com/3DJupp/ha-wrapped ha-wrapped
# Docker (builds straight from the repo, writes into the current dir)
docker build -t ha-wrapped https://github.com/3DJupp/ha-wrapped.git
docker run --rm -e HA_TOKEN -e ANTHROPIC_API_KEY -v "$PWD:/data" ha-wrapped
# classic clone (venv — Debian/Ubuntu block system-wide pip, PEP 668)
git clone https://github.com/3DJupp/ha-wrapped.git && cd ha-wrapped && python3 -m venv .venv && .venv/bin/pip install -r requirements.txt && cp config.example.yaml config.yaml && .venv/bin/python wrapped.py
Output: ha_wrapped_<year>.html in the current directory.
Open docs/demo.html locally or check the live demo for a preview with sample data.
Self-debug
The script prints a preflight status before it fetches anything — config
found, token source, API reachable, AI copy on/off — and a per-entity
summary at the end. The same diagnostics are embedded into the page:
click the ⓘ button (bottom right) for the status panel. It shows when
the page was generated, the covered range, which entities delivered data
and which were skipped, and it opens automatically if something is wrong
(it even tells you when you opened the raw, un-rendered template).
Hosting & social export
The output is a single static HTML file, so any static host works: copy
it into Home Assistant’s www/ folder (served at /local/... with zero
extra setup), drop it on GitHub Pages / Netlify / Cloudflare Pages, or
rsync/scp it to a webserver you already run.
The page also includes a recap card — a compact grid of every stat,
made for sharing. Add --export-summary to also render it as a
ready-to-post PNG (1080x1080 by default). This needs
Playwright, which is not part of the default
install:
pip install playwright && playwright install chromium
# or: pip install "ha-wrapped[export]" && playwright install chromium
python3 wrapped.py --export-summary
# -> ha_wrapped_2025.html
# -> ha_wrapped_2025_summary.png (1080x1080, ready for Instagram & co.)
python3 wrapped.py --export-summary --summary-size 1080x1920 # 9:16 story format
Configuration
Two kinds of stats, both optional, mix freely:
statistics: # long-term statistics (needs state_class)
- entity_id: sensor.water_meter_total
label: "Water through the pipes"
aggregate: sum # sum | mean | max
unit: "liters"
scale: 1000 # m3 -> liters
decimals: 0
counts: # state-change counts via history API
- entity_id: binary_sensor.washing_machine_running
to_state: "on"
label: "Laundry loads"
unit: "loads"
footnote: "Optional fine print under the number."
All top-level options (see config.example.yaml
for the fully commented reference):
| key |
default |
description |
ha_url |
— |
base URL of your Home Assistant instance |
token |
— |
HA access token; prefer the HA_TOKEN env var |
period |
yearly |
yearly or monthly — see Monthly Wrapped |
year |
current year |
the year to wrap (or the year of month, for period: monthly) |
month |
previous month |
period: monthly only, 1-12 |
tz_offset |
+01:00 |
timezone offset for the period boundaries |
language |
en |
copy + UI language: en, de, fr, es, it, nl, pt |
number_format |
follows language |
comma_dot 1,234.5 · dot_comma 1.234,5 · space_comma 1 234,5 · plain_dot 1234.5 · plain_comma 1234,5 |
house_name |
My Home |
shown on the intro and outro card |
theme |
auto |
auto (follow system) · dark · light |
tone |
dry, witty, deadpan |
personality of the AI copy |
Per-entry options for both lists: label, unit, scale, decimals,
footnote — plus aggregate (sum/mean/max/delta) for
statistics: and to_state for counts:. In counts:, entity_id can
also be a list — their counts and series are summed into one stat (e.g.
several shutters as one “shutter travel” number).
Use aggregate: delta for sensors that report an absolute, ever-increasing
lifetime counter (state_class: total_increasing, e.g. a coffee machine’s
total brew count) — the period total becomes last reading − first
reading instead of summing the absolute readings.
Monthly Wrapped
By default HA Wrapped covers a full calendar year. Set period: monthly to
get a per-month recap instead — same page, same stats, just a shorter
window with a daily (instead of monthly) breakdown in the charts.
period: monthly
# year: 2025 # optional, defaults to the year of `month`
# month: 5 # optional, defaults to the month that just ended
Without year/month, a run on (or shortly after) the 1st of a month
wraps the month that just ended — perfect for a monthly cronjob:
# crontab: run at 00:05 on the 1st of every month
5 0 1 * * cd /path/to/ha-wrapped && .venv/bin/python wrapped.py
The output filename also changes to ha_wrapped_<year>-<month>.html
(e.g. ha_wrapped_2025-05.html), so monthly runs don’t overwrite each
other or the yearly file.
Tips
- Good
counts candidates: anything with a power-plug-derived
binary_sensor (washing machine, dishwasher, coffee machine, 3D
printer), covers, doorbells, scene/input_boolean activations.
scale is where the fun lives: cycles × meters, brews × cups,
liters → bathtubs.
counts only see what the recorder still has (10 days by default, see
purge_keep_days). Long-term statistics are kept and fast to query,
so prefer them for anything covering a month or a year. A long history
query can take a moment on large recorder databases.
- Multiple shutters/covers: either list all their entities under one
counts: entry (see config.example.yaml), or — if you’d rather do the
math in Home Assistant — add a template
sensor with
state_class: total_increasing that adds scale to its own state on
every cover state change, then pull that single sensor in with
aggregate: sum (or delta if it never resets).
Requirements
- Home Assistant with the recorder (default) and long-term statistics
- Python 3.10+,
websockets, pyyaml, requests
- Optional, for the generated copy: an AI Task entity in Home Assistant
(2025.8+, any AI integration) or an Anthropic API key
Feedback and support
Questions, ideas or your best stat? Post in the
forum thread.
Bugs go to GitHub issues.
If HA Wrapped made you smile, you can
buy me a coffee.
License
MIT
评论