pycsamt.iot.power#

Functions

estimate_deployment_energy(configs, *[, api])

Estimate and tabulate energy budgets for multiple devices.

estimate_energy_budget(config)

Estimate runtime from battery, duty cycle, and optional solar input.

power_summary_table(estimates, *[, ...])

Return energy estimates as a pyCSAMT table.

Classes

DevicePowerProfile(name, active_power_w[, ...])

Named power profile for a field node or recorder.

EnergyConfig(battery_wh, active_power_w[, ...])

Power-budget inputs for a field IoT device.

EnergyEstimate(average_power_w, ...[, ...])

Estimated runtime and power draw.

PowerState(*values)

Energy status for an IoT field device.

class pycsamt.iot.power.PowerState(*values)[source]#

Bases: str, Enum

Energy status for an IoT field device.

SUSTAINING = 'sustaining'#
OK = 'ok'#
WARNING = 'warning'#
CRITICAL = 'critical'#
class pycsamt.iot.power.DevicePowerProfile(name, active_power_w, sleep_power_w=0.05, telemetry_power_w=0.0, edge_power_w=0.0, metadata=<factory>)[source]#

Bases: PyCSAMTObject

Named power profile for a field node or recorder.

Parameters:
name: str#
active_power_w: float#
sleep_power_w: float = 0.05#
telemetry_power_w: float = 0.0#
edge_power_w: float = 0.0#
metadata: dict[str, Any]#
validate()[source]#

Validate and normalise profile fields.

Return type:

None

apply(*, battery_wh, duty_cycle=1.0, solar_wh_per_day=0.0, **kwargs)[source]#

Build an EnergyConfig from this profile.

Parameters:
Return type:

EnergyConfig

class pycsamt.iot.power.EnergyConfig(battery_wh, active_power_w, sleep_power_w=0.05, duty_cycle=1.0, solar_wh_per_day=0.0, reserve_fraction=0.0, regulator_efficiency=1.0, charge_efficiency=1.0, telemetry_power_w=0.0, telemetry_seconds_per_day=0.0, edge_power_w=0.0, edge_duty_cycle=0.0, auxiliary_wh_per_day=0.0, min_runtime_days=None, device_id=None, metadata=<factory>)[source]#

Bases: PyCSAMTObject, MetadataMixin

Power-budget inputs for a field IoT device.

Parameters:
battery_wh: float#
active_power_w: float#
sleep_power_w: float = 0.05#
duty_cycle: float = 1.0#
solar_wh_per_day: float = 0.0#
reserve_fraction: float = 0.0#
regulator_efficiency: float = 1.0#
charge_efficiency: float = 1.0#
telemetry_power_w: float = 0.0#
telemetry_seconds_per_day: float = 0.0#
edge_power_w: float = 0.0#
edge_duty_cycle: float = 0.0#
auxiliary_wh_per_day: float = 0.0#
min_runtime_days: float | None = None#
device_id: str | None = None#
metadata: dict[str, Any]#
validate()[source]#

Validate and normalise power-budget inputs.

Return type:

None

property usable_battery_wh: float[source]#

Battery energy available after reserve is held back.

property base_average_power_w: float[source]#

Average active/sleep power before auxiliary loads.

property telemetry_wh_per_day: float[source]#

Daily energy used by radio transmission windows.

property edge_wh_per_day: float[source]#

Daily energy used by edge processing overhead.

property harvest_wh_per_day: float[source]#

Daily usable harvested energy after charge efficiency.

class pycsamt.iot.power.EnergyEstimate(average_power_w, runtime_hours, runtime_days, net_wh_per_day, load_wh_per_day=0.0, harvest_wh_per_day=0.0, usable_battery_wh=0.0, telemetry_wh_per_day=0.0, edge_wh_per_day=0.0, auxiliary_wh_per_day=0.0, reserve_wh=0.0, energy_margin_wh_per_day=0.0, autonomy_days_no_harvest=0.0, state=PowerState.OK, issues=<factory>)[source]#

Bases: PyCSAMTObject

Estimated runtime and power draw.

Parameters:
average_power_w: float#
runtime_hours: float#
runtime_days: float#
net_wh_per_day: float#
load_wh_per_day: float = 0.0#
harvest_wh_per_day: float = 0.0#
usable_battery_wh: float = 0.0#
telemetry_wh_per_day: float = 0.0#
edge_wh_per_day: float = 0.0#
auxiliary_wh_per_day: float = 0.0#
reserve_wh: float = 0.0#
energy_margin_wh_per_day: float = 0.0#
autonomy_days_no_harvest: float = 0.0#
state: PowerState | str = 'ok'#
issues: list[str]#
validate()[source]#

Validate and normalise estimate fields.

Return type:

None

property sustaining: bool[source]#

Return whether harvested energy covers daily load.

as_dict()[source]#

Return a serialisable estimate dictionary.

Return type:

dict[str, Any]

to_packet(device, *, timestamp, survey_id=None, qos=0, retained=False)[source]#

Encode this estimate as a power telemetry packet.

Parameters:
Return type:

TelemetryPacket

pycsamt.iot.power.estimate_deployment_energy(configs, *, api=None)[source]#

Estimate and tabulate energy budgets for multiple devices.

Parameters:
Return type:

Any

pycsamt.iot.power.estimate_energy_budget(config)[source]#

Estimate runtime from battery, duty cycle, and optional solar input.

Parameters:

config (EnergyConfig)

Return type:

EnergyEstimate

pycsamt.iot.power.power_summary_table(estimates, *, device_ids=None, api=None)[source]#

Return energy estimates as a pyCSAMT table.

Parameters:
Return type:

Any