Skip to content

etienne-napoleone/alpstuga-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alpstuga-exporter

A simple Alpstuga air quality Prometheus exporter for my personal use.

Stack:

  • Bun - JavaScript runtime
  • Hono - Web framework
  • Dirigera - Unofficial IKEA Dirigera hub API client
  • Pino - Structured logging library

Usage

Tip

Use bunx dirigera authenticate --no-reject-unauthorized to authenticate with the Dirigera hub and get a token.

Configuration is done through environment variables.

Variable Description Default
ACCESS_TOKEN Access token for the Dirigera hub Required
GATEWAY_IP IP address of the Dirigera hub Auto discovery via mDNS
ACCEPT_UNAUTHORIZED Accept unauthorized certificates false
LOGGING_LEVEL Logging level (trace, debug, info, warn, error, fatal) error
PORT Port to listen on 9001
COLLECT_DEFAULT Collect default metrics false

With bun:

# Install dependencies
bun i

# Create a .env file with the required variables
touch .env

# With json structured logging
bun start
# or
bun src/index.ts

# With pretty logging
bun dev

With docker:

docker build -t alpstuga-exporter .
docker run -p 9001:9001 --env-file .env alpstuga-exporter

Dashboard

You can find a premade dashboard here.

Local development

You can test the exporter locally through the compose stack:

# Up
docker compose up -d --build

# Reset
docker compose down && docker volume prune -a

About

IKEA Alpstuga air quality exporter

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published