惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
小众软件
小众软件
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
Jina AI
Jina AI
博客园 - 【当耐特】
V
Visual Studio Blog
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
量子位
IT之家
IT之家
G
Google Developers Blog
V
V2EX
The GitHub Blog
The GitHub Blog
月光博客
月光博客
GbyAI
GbyAI

Show HN

GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: Generate Claude Code Workflows using Spec Driven Development approach Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal).
GitHub - veerendra2/shelly_device_exporter: A Prometheus ...
catfight7391 · 2026-06-22 · via Show HN

Shelly Device Exporter


Prometheus exporter for Shelly Gen 2+ devices.

Build Status Go Report Card Release License Stars Forks Docker

Features

Feature Description
Concurrent Scraping Dynamically-sized worker pool to fetch statuses from multiple devices simultaneously.
Authentication Supports Shelly's required Digest Authentication out of the box.
Energy Cost Calculation Automatically calculates ongoing energy costs based on configurable price_per_kwh and currency fields.

Device Compatibility

Compatible with all Gen 2+ devices utilizing the standard Shelly RPC API.

Device Tested
Shelly Plug M Gen3

Exported Metrics

See list of Metrics

Component Status
Switch
System

Deployment

Usage

Usage: shelly_device_exporter [flags]

Prometheus exporter for Shelly Gen 2+ devices.

Flags:
  -h, --help                        Show context-sensitive help.
      --address=":8080"             The address where the server should listen on ($ADDRESS).
      --config-file="config.yml"    Configuration file path ($CONFIG_FILE)
      --log-format="console"        Set the output format of the logs. Must be "console" or "json" ($LOG_FORMAT).
      --log-level=INFO              Set the log level. Must be "DEBUG", "INFO", "WARN" or "ERROR" ($LOG_LEVEL).
      --log-add-source              Whether to add source file and line number to log records ($LOG_ADD_SOURCE).
      --version                     Print version information and exit

Configuration

The exporter requires a configuration file to know which devices to poll and how to connect to them.

---
# (Optional) Used to calculate the 'shelly_device_energy_cost_total' metric.
# Both fields must be set to enable cost calculation.
price_per_kwh: 0.10
currency: "EUR"

# List of Shelly devices to monitor
devices:
  - name: "home-servers"
    address: "http://SHELLY_DEVICE_IP"
    username: "admin" # Optional, defaults to "admin"
    password: "YOUR_PASSWORD"

Environment Variable Templating

The configuration file supports environment variable templating using the {{ env "VAR" }} syntax.

devices:
  - name: "home-servers"
    address: "http://192.168.0.6"
    username: "admin"
    password: '{{ env "SHELLY_DEVICE1_PASSWORD" }}'

Docker Compose

---
name: shelly-device-exporter
services:
  shelly-device-exporter:
    image: ghcr.io/veerendra2/shelly_device_exporter:latest
    container_name: shelly-device-exporter
    volumes:
      - ./config.yml:/config.yml
    environment:
      CONFIG_FILE: /config.yml
    restart: unless-stopped
    user: ${PUID}:${PGID}
    hostname: shelly-device-exporter

Prometheus Scrape Configuration

Add the following to your prometheus.yml scrape configurations to collect metrics from the exporter:

scrape_configs:
  - job_name: "shelly_devices"
    # Adjust scrape interval based on your needs
    scrape_interval: 30s
    scrape_timeout: 15s
    static_configs:
      - targets: ["shelly-device-exporter:8080"] # Replace with the exporter's address

Grafana Dashboard

Dashboard
Grafana Dashboard Json (Prometheus Datasource)
Grafana Dashboard Json (Victoriametrics Datasource)

Dashboard Image

Development

Build & Test

Install Taskfile: Installation Guide

# Available tasks
task --list
task: Available tasks for this project:
* all:                   Run comprehensive checks: format, lint, security and test
* build:                 Build the application binary for the current platform
* build-docker:          Build Docker image
* build-platforms:       Build the application binaries for multiple platforms and architectures
* fmt:                   Formats all Go source files
* install:               Install required tools and dependencies
* lint:                  Run static analysis and code linting using golangci-lint
* run:                   Runs the main application
* security:              Run security vulnerability scan
* test:                  Runs all tests in the project      (aliases: tests)
* vet:                   Examines Go source code and reports suspicious constructs

Install GoReleaser: Installation Guide

# Build locally
goreleaser release --snapshot --clean

Shelly API Reference

For debugging purposes, you can directly access your Shelly devices via curl:

# Get device info
curl 'http://YOUR_SHELLY_IP/shelly'

# Get device status using Digest Auth
curl --digest -u admin:"YOUR_PASSWORD" 'http://YOUR_SHELLY_IP/rpc/Shelly.GetStatus'