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
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:
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
Day/night periods can initially be defined using fixed hours.
Notes
Scripts could live in a dedicated dir in
toolsdirectory (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