energy-analyzer net type.
Import
Methods
| Method | Description |
|---|---|
read_energy(duration) | Integrate energy and charge over duration seconds |
read_stats(duration) | Compute mean/min/max/std for current, voltage, and power |
Method Reference
Net.get(name, type=NetType.EnergyAnalyzer)
Get an energy analyzer net by name.
| Parameter | Type | Description |
|---|---|---|
name | str | Name of the energy-analyzer net |
type | NetType | Must be NetType.EnergyAnalyzer |
read_energy(duration)
Integrate current and power over duration seconds.
| Parameter | Type | Description |
|---|---|---|
duration | float | Integration window in seconds |
dict with keys:
| Key | Type | Description |
|---|---|---|
"energy_j" | float | Energy in joules |
"energy_wh" | float | Energy in watt-hours |
"charge_c" | float | Charge in coulombs |
"charge_ah" | float | Charge in amp-hours |
"duration_s" | float | Duration that was requested |
read_stats(duration)
Compute mean, minimum, maximum, and standard deviation for current, voltage, and power over duration seconds.
| Parameter | Type | Description |
|---|---|---|
duration | float | Measurement window in seconds |
dict with keys:
| Key | Type | Description |
|---|---|---|
"current" | dict | Current statistics in amps |
"voltage" | dict | Voltage statistics in volts |
"power" | dict | Power statistics in watts |
"duration_s" | float | Duration that was requested |
| Key | Type | Description |
|---|---|---|
"mean" | float | Mean value |
"min" | float | Minimum value |
"max" | float | Maximum value |
"std" | float | Standard deviation |
Examples
Energy Budget Check
Sleep Current Verification
Battery Life Estimation
Startup Energy Capture
Current Spike Analysis
Supported Hardware
| Manufacturer | Model | Net Type | USB VID:PID |
|---|---|---|---|
| Joulescope | JS220 | energy-analyzer | 16d0:10ba |
energy-analyzer net type is exclusive to the Joulescope JS220. For instantaneous power readings (also available on Yocto-Watt), see Watt Meter.
Notes
- The Joulescope JS220 samples at high frequency; longer durations yield more accurate statistics
read_energy()andread_stats()block for the fulldurationbefore returning- The same physical JS220 device is shared between
WattMeterandEnergyAnalyzernet roles — opening both net types for the same device is safe - Use
lager instruments --box <box>to verify the JS220 is detected before running scripts

