Skip to content

mariusbreivik/netatmo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

103 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌀️ netatmo

Your weather station in your terminal. Because sometimes you just need to know the CO2 level without opening an app.

Build codecov Go Report Card License


πŸ“– What is this?

netatmo is a lightweight CLI tool built with Cobra and Go that lets you fetch data from your Netatmo Weather Station right in your terminal.


✨ Features

  • πŸ“Š Status β€” Full dashboard with all readings at once
  • 🌑️ Temperature β€” Indoor and outdoor readings
  • πŸ’§ Humidity β€” Indoor and outdoor levels
  • 🌫️ CO2 β€” Carbon dioxide concentration
  • πŸ”Š Noise β€” Sound level in decibels
  • πŸŒ€ Pressure β€” Atmospheric pressure
  • πŸ“Ά WiFi β€” Signal strength monitoring
  • βš™οΈ Firmware β€” Device firmware info
  • πŸ” Secure Auth β€” OAuth2 with automatic token refresh
  • 🐚 Shell Completion β€” Bash, Zsh, and Fish support

πŸš€ Quick Start

Prerequisites

Installation

Quick Install (recommended)

go install github.com/mariusbreivik/netatmo@latest

Pre-built Binaries

Download pre-built binaries for your platform from the Releases page.

Build from Source

# Clone the repo
git clone https://github.com/mariusbreivik/netatmo.git
cd netatmo

# Build it
go build -o netatmo .

Configuration

All configuration lives in one file: ~/.netatmo-config.json

Step 1: Set up your API credentials

  1. Head to dev.netatmo.com/apps
  2. Create an app (or use an existing one)
  3. Grab your Client ID and Client Secret
netatmo configure
# Follow the prompts, or use flags:
netatmo configure --client-id YOUR_ID --client-secret YOUR_SECRET

Step 2: Authenticate

  1. In your app on dev.netatmo.com, scroll to Token generator
  2. Select scope read_station and click Generate Token
  3. Copy both the access token and refresh token
netatmo login
# Follow the prompts, or use flags:
netatmo login --access-token YOUR_TOKEN --refresh-token YOUR_REFRESH

πŸ’‘ Pro tip: Tokens auto-refresh when they expire. Set it and forget it!


πŸ§‘β€πŸ’» Usage

ℹ️ Status

netatmo status

Example output:

🏠 Living Room Station
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  πŸ“ Indoor (Indoor)
  ─────────────────────────────────
  🌑️ Temperature    22.5Β°C β†’
  πŸ’§ Humidity       45%
  🌫️ CO2            892 ppm
  πŸ”Š Noise          42 dB

  🌳 Outdoor (Outdoor)
  ─────────────────────────────────
  🌑️ Temperature    8.3Β°C ↓
  πŸ’§ Humidity       67%
  πŸ”‹ Battery        87% πŸ”‹

  πŸ“Š System
  ─────────────────────────────────
  πŸŒ€ Pressure       1013.2 hPa β†’
  πŸ“Ά WiFi           Good πŸ“Ά
  βš™οΈ Firmware       181

  ⏱️  Last updated: 2 minutes ago

🌑 Temperature

# Indoor temperature
netatmo temp --indoor
netatmo temp -i

# Outdoor temperature
netatmo temp --outdoor
netatmo temp -o

πŸ’§ Humidity

netatmo humidity --indoor   # or -i
netatmo humidity --outdoor  # or -o

🌫 CO2 Level

netatmo co2

🌿 Keep it under 1000 ppm for a happy brain!

πŸ”Š Noise Level

netatmo noise

πŸ”‡ Measured in decibels. Library quiet? Or rock concert?

πŸŒ€ Pressure

netatmo pressure

πŸ“Š Atmospheric pressure for weather nerds.

🐚 Shell Completion

# Bash
netatmo completion bash > /etc/bash_completion.d/netatmo

# Zsh
netatmo completion zsh > "${fpath[1]}/_netatmo"

# Fish
netatmo completion fish > ~/.config/fish/completions/netatmo.fish

πŸ“‹ All Commands

Usage:
  netatmo [command]

Available Commands:
  co2         Read CO2 data from netatmo station
  completion  Generate shell autocompletion scripts
  configure   Configure Netatmo API credentials
  firmware    Read firmware data from netatmo station
  help        Help about any command
  humidity    Read humidity data from netatmo station
  login       Store Netatmo API tokens for authentication
  noise       Read noise data from netatmo station
  pressure    Read pressure data from netatmo station
  status      Display a full dashboard of your weather station
  temp        Read temperature data from netatmo station
  version     Print version and build information
  wifi        Read wifi data from netatmo station

Flags:
  -v, --verbose   Enable verbose/debug output
      --json      Output in JSON format
      --no-color  Disable colored output
  -h, --help      Show help

πŸ› οΈ Development

Want to contribute? Awesome! πŸŽ‰

# Clone
git clone https://github.com/mariusbreivik/netatmo.git
cd netatmo

# Show available commands
make help

# Run tests
make test

# Run linter
make lint

# Build with version info
make build

# Run
./netatmo --help
./netatmo version

Version Info

The version command shows build information:

$ netatmo version
netatmo v0.2.51
  Commit:     af203f8
  Built:      2026-02-13T20:49:34Z
  Go version: go1.25.6
  OS/Arch:    darwin/arm64

$ netatmo version --short
v0.2.51

$ netatmo version --json
{
  "version": "v0.2.51",
  "commit": "af203f8",
  ...
}

Made with β˜• and curiosity