Home of the Home Assistant usage stats.
Go to file
dependabot[bot] 7d6e72a472
Bump chart.js from 4.4.2 to 4.4.3 (#860)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 09:30:26 +02:00
.github Bump actions/checkout from 4.1.5 to 4.1.6 (#862) 2024-05-20 09:06:36 +02:00
script Update wrangler from v1 to v3 (#765) 2023-08-22 09:44:37 +02:00
site Add an introduction to analytics website (#836) 2024-02-24 12:37:46 +01:00
worker Move site generation to a separate schedule (#821) 2024-01-15 09:33:25 +01:00
.devcontainer.json Bump node from 16 to 20 (#789) 2023-10-09 14:34:14 +02:00
.gitignore Rewrite to use 11ty (#638) 2022-10-11 16:23:45 -04:00
.nvmrc Bump node from 16 to 20 (#789) 2023-10-09 14:34:14 +02:00
LICENSE Add LICENSE (#196) 2021-06-03 10:00:01 -07:00
README.md Adjust wording (#129) 2021-04-28 11:22:58 -07:00
package.json Bump chart.js from 4.4.2 to 4.4.3 (#860) 2024-05-20 09:30:26 +02:00
yarn.lock Bump chart.js from 4.4.2 to 4.4.3 (#860) 2024-05-20 09:30:26 +02:00

README.md

analytics.home-assistant.io

This repository contains the source of the https://analytics.home-assistant.io website and the CloudFlare worker that recieves the payload from the analytics integration

Worker

This recieves the payload from the analytics integration and stores that data in a KV store.

  • Entries are kept for a maximum of 60 days since last update.

The worker source are located in the worker directory.

Schedule

There are several scheduled tasks that iterate over the stored data and generate the data that the site uses. These tasks run at different times.

task runs description
PROCESS_QUEUE Every 2 min Processes the current queue untill everything is done, when it's done the site will regenerate with the new data, then it waits untill the next RESET_QUEUE task has run.
UPDATE_HISTORY Every hour Update history, this will update the installation types, versions, and totals, when it's done the site will regenerate with the new data.
RESET_QUEUE 5min past midnight This will reset the queue if it's empty, so the next PROCESS_QUEUE can start

Site

The source of the https://analytics.home-assistant.io website.

The website is bundled with Vite and served with Netlify.

The website source are located in the site directory.

Development

To do local development of the website first clone the repository and open the devcontainer. Once the devcontainer has started run script/develop in the terminal, a preview of the site will open in your default browser.

PR's should target the dev (default) branch.

Sites

Environment URL
Production https://analytics.home-assistant.io/
Dev https://dev--home-assistant-analytics.netlify.app/