pyronear / pyronear/pyro-engine

Collect and analyze power consumption data from Shelly Pro 2PM

Open
#380 2 comments 0 reactions 1 assignee View on GitHub

@romainantes is already working on this.

Since Jun 26, 2026.

  • #381 by @romainantes — closed without merging
Dominant language
Python
Stars
19
Forks
8
PR merge metrics
No merged PRs in 30d

Description

context and obj

We recently installed a Shelly Pro 2PM as a watchdog. But it is also possible monitor the power consumption of the system.

The objective of this task is to collect power/energy measurements over several days and provide simple analysis tools to better understand the system's electrical usage and baseline consumption.

Data collection

Implement a lightweight script running on the Raspberry Pi that periodically queries the Shelly local API (e.g. via cron every 10 minutes).

The script should collect data for both channels and store it in a simple format such as CSV.

Relevant metrics may include:

  • Instantaneous power (if possible to get it)
  • Energy counters

Releant to get data from each channel (consider there is one channel for rpi and another for router and switch connected to cameras in poe) -> hence a more granular analysis would be perform later

Please refer to the Shelly API/documentation to identify the most useful fields. https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyPro2PM/

Analysis

Implement a second script that processes the collected data and provides

  • Total energy consumption over the last 24h (or the mean of energy consuption if run multiple days)
  • Per-channel and combined consumption
  • Average daytime vs nighttime consumption -> night time is only when engine stop to get images from cameras because of the dark, could be fund manually analyzing pi or router/switch consomptuon)
  • Maximum observed power

Day/night periods can initially be defined using fixed hours.

  • this script might be run on personnal computer after getting data from the rpi

Notes

  • Scripts could live in a dedicated dir in tools directory (https://github.com/pyronear/pyro-engine/tree/develop/tools)

  • Keep the solution simple and easy to run. Optional plots or visualizations are welcome if they can be generated with minimal complexity :)

  • a small readme is welcome if relevant

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.