Implement network throughput monitoring instead of cumulative bytes

- Add iftop as runtime dependency in package.nix and flake.nix
- Modify SystemMetrics to calculate network throughput (bytes/second)
- Track previous network stats in MQTT client state for throughput calculation
- Update Home Assistant discovery to show RX/TX throughput sensors
- Replace cumulative byte counters with real-time throughput metrics
- Add proper throughput calculation with time-based differentials

This provides much more useful real-time network monitoring compared
to ever-increasing cumulative byte counts.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-08 21:02:29 -07:00
co-authored by Claude
parent f8a8421c2f
commit b8e7c48ecf
5 changed files with 97 additions and 15 deletions
+4
View File
@@ -2,6 +2,7 @@
lib,
beamPackages,
src,
iftop,
}:
beamPackages.mixRelease rec {
@@ -10,6 +11,9 @@ beamPackages.mixRelease rec {
inherit src;
# Runtime dependencies
buildInputs = [ iftop ];
# Disable distributed Erlang to avoid COOKIE requirement
postInstall = ''
# Create wrapper script that sets proper environment including COOKIE