Skip to content

Instantly share code, notes, and snippets.

@Kinggrass
Kinggrass / shelly_pro3em_net_metering.js
Created March 5, 2026 14:46 — forked from Davc0m/shelly_pro3em_net_metering.js
Shelly Pro 3EM: Saldierende Energiemessung (Net Metering) mit Home Assistant Auto-Discovery
/**
* Shelly Pro 3EM - Net Metering (Saldierung) & Home Assistant Auto-Discovery
*
* This script calculates the total active power across all 3 phases (A+B+C).
* It simulates a "net metering" utility meter:
* - If Total Power > 0: Increases "Import" counter
* - If Total Power < 0: Increases "Export" counter
*
* FEATURES:
* - Precise integration (runs every 0.5s)