Feature : Collect and analyze power consumption data from Shelly Pro 2PM - #380#381
Open
romainantes wants to merge 4 commits into
Open
Feature : Collect and analyze power consumption data from Shelly Pro 2PM - #380#381romainantes wants to merge 4 commits into
romainantes wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #381 +/- ##
========================================
Coverage 78.83% 78.83%
========================================
Files 6 6
Lines 841 841
========================================
Hits 663 663
Misses 178 178
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Shelly power monitoring tools
Add two scripts under tools/shelly_power/ to collect and analyze power consumption data from a Shelly Gen2 device (local API, no cloud dependency) :
collect.py queries Switch.GetStatus for each configured channel and appends the results to a CSV file. Intended to run periodically via cron on the Raspberry Pi (e.g. every 10 minutes).
analyze.py processes the collected CSV and produces a per-channel and combined report including average/peak power, total energy, energy per 24h, and day vs night consumption split. An optional matplotlib chart can be generated with --plot.
Both scripts require no external dependencies beyond the standard library (matplotlib is optional).
A README.md documents usage, cron setup, CSV format, and how to retrieve data from the RPi for local analysis.
Example of plot generated:
