Skip to main content

ProsumerMeterInput

Struct ProsumerMeterInput 

Source
pub struct ProsumerMeterInput {
    pub grid_consumption_kwh: Decimal,
    pub self_consumption_kwh: Decimal,
    pub export_kwh: Option<Decimal>,
}
Expand description

Prosumer meter data — combines grid consumption with PV self-consumption.

A prosumer simultaneously consumes electricity (partly from the grid, partly from their own PV plant) and may export surplus generation to the grid.

§LF billing scope (energy-billing)

The Lieferant bills grid consumption only. Self-consumption billing and EEG feed-in remuneration (Einspeisevergütung) are handled by eeg-billing.

§Stromsteuer exemption

§ 9 Abs. 1 Nr. 3 StromStG exempts self-consumed electricity from plants up to 2 MW from Stromsteuer. This is applied automatically when self_consumption_kwh > 0.

§Network charge exemption

Netzentgelte are charged for Netznutzung — the § 17 StromNEV Arbeits- and Leistungspreis are levied on what is taken from the grid at the Entnahmestelle. Self-consumed electricity never enters it, so it is outside that base and no NNE applies to self_consumption_kwh. This is not the § 14a EnWG reduction, which is a reduced Netzentgelt for a controllable load that does draw from the grid.

§Example

use energy_billing::ProsumerMeterInput;
use rust_decimal::dec;

let m = ProsumerMeterInput {
    grid_consumption_kwh: dec!(250),   // drawn from grid → full tariff
    self_consumption_kwh: dec!(150),   // from own PV → Stromsteuer-exempt, no Netznutzung
    export_kwh: Some(dec!(100)),       // fed back to grid (via eeg-billing)
};
assert_eq!(m.total_consumption_kwh(), dec!(400));

Fields§

§grid_consumption_kwh: Decimal

Electricity drawn from the public grid (kWh).

Full tariff applies: Arbeitspreis + NNE + Stromsteuer.

§self_consumption_kwh: Decimal

Electricity generated by the customer’s PV plant and consumed on-site (kWh).

  • No NNE (does not transit the grid)
  • No Stromsteuer on the self-consumed part (§ 9 Abs. 1 Nr. 3 StromStG)
  • Appears as an informational invoice line showing the self-supply ratio
§export_kwh: Option<Decimal>

Electricity exported to the grid (kWh). Informational only.

This quantity is handled by eeg-billing (EEG Einspeisevergütung), not by energy-billing. Included here so the retail invoice can show the complete energy balance to the customer (§41 EnWG transparency).

Implementations§

Source§

impl ProsumerMeterInput

Source

pub fn total_consumption_kwh(&self) -> Decimal

Total electricity consumption (grid + self, kWh).

Source

pub fn self_supply_ratio(&self) -> Decimal

Self-supply ratio (0.0–1.0): share of total consumption from own PV.

Trait Implementations§

Source§

impl Clone for ProsumerMeterInput

Source§

fn clone(&self) -> ProsumerMeterInput

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProsumerMeterInput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProsumerMeterInput

Source§

fn default() -> ProsumerMeterInput

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ProsumerMeterInput

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ProsumerMeterInput

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more