Skip to content

init

energy ¤

Energy Events

Detectors for energy-related patterns: consumption analysis, efficiency tracking, and peak demand detection on manufacturing/industrial IoT time series data.

  • EnergyConsumptionEvents: Analyze energy consumption patterns.
  • consumption_by_window: Aggregate energy consumption per time window.
  • peak_demand_detection: Detect peak demand periods exceeding thresholds.
  • consumption_baseline_deviation: Compare actual vs baseline consumption.
  • energy_per_unit: Calculate energy consumption per production unit.

  • EnergyEfficiencyEvents: Track energy efficiency metrics.

  • efficiency_trend: Rolling efficiency metric over time.
  • idle_energy_waste: Detect energy consumption during idle periods.
  • specific_energy_consumption: Energy per unit output over time.
  • efficiency_comparison: Compare efficiency across shifts or periods.

EnergyConsumptionEvents ¤

EnergyConsumptionEvents(
    dataframe: DataFrame,
    *,
    event_uuid: str = "energy:consumption",
    time_column: str = "systime"
)

Bases: Base

Energy: Consumption Analysis

Analyze energy consumption patterns from meter/sensor signals.

Methods: - consumption_by_window: Aggregate energy per time window from a meter UUID. - peak_demand_detection: Flag windows where consumption exceeds a threshold. - consumption_baseline_deviation: Compare actual vs rolling baseline. - energy_per_unit: Energy per production unit when paired with a counter.

consumption_by_window ¤

consumption_by_window(
    meter_uuid: str,
    *,
    value_column: str = "value_double",
    window: str = "1h",
    agg: str = "sum"
) -> pd.DataFrame

Aggregate energy consumption per time window.

Parameters:

Name Type Description Default
meter_uuid str

UUID of the energy meter signal.

required
value_column str

Column containing energy readings.

'value_double'
window str

Resample window (e.g. '1h', '15min', '1D').

'1h'
agg str

Aggregation method ('sum', 'mean', 'max').

'sum'

Returns:

Name Type Description
DataFrame DataFrame

window_start, uuid, source_uuid, is_delta, consumption

peak_demand_detection ¤

peak_demand_detection(
    meter_uuid: str,
    *,
    value_column: str = "value_double",
    window: str = "15min",
    threshold: Optional[float] = None,
    percentile: float = 0.95
) -> pd.DataFrame

Detect peak demand periods exceeding a threshold.

If threshold is None, uses the given percentile of windowed consumption.

Parameters:

Name Type Description Default
meter_uuid str

UUID of the energy meter signal.

required
value_column str

Column containing energy readings.

'value_double'
window str

Resample window for demand calculation.

'15min'
threshold Optional[float]

Absolute demand threshold. If None, auto-calculated.

None
percentile float

Percentile to use for auto-threshold (default 95th).

0.95

Returns:

Name Type Description
DataFrame DataFrame

window_start, uuid, source_uuid, is_delta, demand, threshold, is_peak

consumption_baseline_deviation ¤

consumption_baseline_deviation(
    meter_uuid: str,
    *,
    value_column: str = "value_double",
    window: str = "1h",
    baseline_periods: int = 24,
    deviation_threshold: float = 0.2
) -> pd.DataFrame

Compare actual consumption vs rolling baseline.

Parameters:

Name Type Description Default
meter_uuid str

UUID of the energy meter signal.

required
value_column str

Column containing energy readings.

'value_double'
window str

Resample window for consumption.

'1h'
baseline_periods int

Number of windows for rolling baseline.

24
deviation_threshold float

Fractional deviation to flag (0.2 = 20%).

0.2

Returns:

Name Type Description
DataFrame DataFrame

window_start, uuid, source_uuid, is_delta, consumption, baseline, deviation_pct, is_anomaly

energy_per_unit ¤

energy_per_unit(
    meter_uuid: str,
    counter_uuid: str,
    *,
    energy_column: str = "value_double",
    counter_column: str = "value_integer",
    window: str = "1h"
) -> pd.DataFrame

Calculate energy consumption per production unit.

Parameters:

Name Type Description Default
meter_uuid str

UUID of the energy meter signal.

required
counter_uuid str

UUID of the production counter signal.

required
energy_column str

Column with energy readings.

'value_double'
counter_column str

Column with counter readings.

'value_integer'
window str

Time window for aggregation.

'1h'

Returns:

Name Type Description
DataFrame DataFrame

window_start, uuid, source_uuid, is_delta, energy, units_produced, energy_per_unit

EnergyEfficiencyEvents ¤

EnergyEfficiencyEvents(
    dataframe: DataFrame,
    *,
    event_uuid: str = "energy:efficiency",
    time_column: str = "systime"
)

Bases: Base

Energy: Efficiency Tracking

Track energy efficiency metrics against production and machine state.

Methods: - efficiency_trend: Rolling efficiency metric over time. - idle_energy_waste: Detect energy consumption during idle periods. - specific_energy_consumption: Energy per unit output trend. - efficiency_comparison: Compare efficiency across shifts or periods.

efficiency_trend ¤

efficiency_trend(
    meter_uuid: str,
    counter_uuid: str,
    *,
    energy_column: str = "value_double",
    counter_column: str = "value_integer",
    window: str = "1h",
    trend_window: int = 24
) -> pd.DataFrame

Rolling energy efficiency trend (units produced per kWh).

Parameters:

Name Type Description Default
meter_uuid str

UUID of the energy meter signal.

required
counter_uuid str

UUID of the production counter signal.

required
energy_column str

Column with energy readings.

'value_double'
counter_column str

Column with counter readings.

'value_integer'
window str

Time window for aggregation.

'1h'
trend_window int

Number of windows for rolling average.

24

Returns:

Name Type Description
DataFrame DataFrame

window_start, uuid, source_uuid, is_delta, energy, units, efficiency, rolling_avg_efficiency, trend_direction

idle_energy_waste ¤

idle_energy_waste(
    meter_uuid: str,
    state_uuid: str,
    *,
    energy_column: str = "value_double",
    state_column: str = "value_bool",
    window: str = "15min",
    idle_threshold: float = 0.0
) -> pd.DataFrame

Detect energy consumed during idle periods (waste).

Compares energy consumption with machine run/idle state to find windows where the machine is idle but still consuming energy.

Parameters:

Name Type Description Default
meter_uuid str

UUID of the energy meter signal.

required
state_uuid str

UUID of the boolean machine state signal (True=run).

required
energy_column str

Column with energy readings.

'value_double'
state_column str

Column with boolean state.

'value_bool'
window str

Time window for analysis.

'15min'
idle_threshold float

Energy above this during idle is waste.

0.0

Returns:

Name Type Description
DataFrame DataFrame

window_start, uuid, source_uuid, is_delta, energy_consumed, machine_running_pct, is_idle_waste, waste_energy

specific_energy_consumption ¤

specific_energy_consumption(
    meter_uuid: str,
    counter_uuid: str,
    *,
    energy_column: str = "value_double",
    counter_column: str = "value_integer",
    window: str = "1D"
) -> pd.DataFrame

Daily/periodic specific energy consumption (SEC = energy / output).

Lower SEC indicates better efficiency.

Parameters:

Name Type Description Default
meter_uuid str

UUID of the energy meter signal.

required
counter_uuid str

UUID of the production counter.

required
energy_column str

Column with energy readings.

'value_double'
counter_column str

Column with counter readings.

'value_integer'
window str

Time window (default daily).

'1D'

Returns:

Name Type Description
DataFrame DataFrame

window_start, uuid, source_uuid, is_delta, total_energy, total_output, sec, sec_trend

efficiency_comparison ¤

efficiency_comparison(
    meter_uuid: str,
    counter_uuid: str,
    *,
    energy_column: str = "value_double",
    counter_column: str = "value_integer",
    shift_definitions: Optional[Dict[str, tuple]] = None
) -> pd.DataFrame

Compare energy efficiency across shifts.

Parameters:

Name Type Description Default
meter_uuid str

UUID of the energy meter signal.

required
counter_uuid str

UUID of the production counter.

required
energy_column str

Column with energy readings.

'value_double'
counter_column str

Column with counter readings.

'value_integer'
shift_definitions Optional[Dict[str, tuple]]

Dict mapping shift name to (start_time, end_time) strings. Default: 3-shift operation.

None

Returns:

Name Type Description
DataFrame DataFrame

shift, avg_energy, avg_output, avg_efficiency, total_energy, total_output