api

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 4 Imported by: 6 modules, 12 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CemCEVCInterface

type CemCEVCInterface interface {
	api.UseCaseInterface

	// returns the current charging stratey
	//
	// parameters:
	//   - entity: the entity of the EV
	//
	// returns EVChargeStrategyTypeUnknown if it could not be determined, e.g.
	// if the vehicle communication is via IEC61851 or the EV doesn't provide
	// any information about its charging mode or plan
	ChargeStrategy(remoteEntity spineapi.EntityRemoteInterface) EVChargeStrategyType

	// returns the current energy demand
	//
	// parameters:
	//   - entity: the entity of the EV
	//
	// return values:
	//   - EVDemand: details about the actual demands from the EV
	//   - error: if no data is available
	//
	// if duration is 0, direct charging is active, otherwise timed charging is active
	EnergyDemand(remoteEntity spineapi.EntityRemoteInterface) (Demand, error)

	TimeSlotConstraints(entity spineapi.EntityRemoteInterface) (TimeSlotConstraints, error)

	// send power limits to the EV
	//
	// parameters:
	//   - entity: the entity of the EV
	//   - data: the power limits
	//
	// if no data is provided, default power limits with the max possible value for 7 days will be sent
	WritePowerLimits(entity spineapi.EntityRemoteInterface, data []DurationSlotValue) error

	// return the current incentive constraints
	//
	// parameters:
	//   - entity: the entity of the EV
	IncentiveConstraints(entity spineapi.EntityRemoteInterface) (IncentiveSlotConstraints, error)

	// send new incentives to the EV
	//
	// parameters:
	//   - entity: the entity of the EV
	//   - data: the incentive descriptions
	WriteIncentiveTableDescriptions(entity spineapi.EntityRemoteInterface, data []IncentiveTariffDescription) error

	// send incentives to the EV
	//
	// parameters:
	//   - entity: the entity of the EV
	//   - data: the incentives
	//
	// if no data is provided, default incentives with the same price for 7 days will be sent
	WriteIncentives(entity spineapi.EntityRemoteInterface, data []DurationSlotValue) error

	// return the current charge plan constraints
	//
	// parameters:
	//   - entity: the entity of the EV
	ChargePlanConstraints(entity spineapi.EntityRemoteInterface) ([]DurationSlotValue, error)

	// return the current charge plan of the EV
	//
	// parameters:
	//   - entity: the entity of the EV
	ChargePlan(entity spineapi.EntityRemoteInterface) (ChargePlan, error)

	// start sending heartbeat from the local CEM entity
	//
	// the heartbeat is started by default when a non 0 timeout is set in the service configuration
	StartHeartbeat()

	// stop sending heartbeat from the local CEM entity
	StopHeartbeat()

	// set the local operating state of the local cem entity
	//
	// parameters:
	//   - failureState: if true, the operating state is set to failure, otherwise to normal
	SetOperatingState(failureState bool) error
}

Actor: Customer Energy Management UseCase: Coordinated EV Charging

type CemEVCCInterface

type CemEVCCInterface interface {
	api.UseCaseInterface

	// return the current charge state of the EV
	//
	// parameters:
	//   - entity: the entity of the EV
	ChargeState(entity spineapi.EntityRemoteInterface) (EVChargeStateType, error)

	// return if the EV is connected
	//
	// parameters:
	//   - entity: the entity of the EV
	EVConnected(entity spineapi.EntityRemoteInterface) bool

	// return the current communication standard type used to communicate between EVSE and EV
	//
	// parameters:
	//   - entity: the entity of the EV
	CommunicationStandard(entity spineapi.EntityRemoteInterface) (model.DeviceConfigurationKeyValueStringType, error)

	// return if the EV supports asymmetric charging
	//
	// parameters:
	//   - entity: the entity of the EV
	AsymmetricChargingSupport(entity spineapi.EntityRemoteInterface) (bool, error)

	// return the identifications of the currently connected EV or nil if not available
	// these can be multiple, e.g. PCID, Mac Address, RFID
	//
	// parameters:
	//   - entity: the entity of the EV
	Identifications(entity spineapi.EntityRemoteInterface) ([]IdentificationItem, error)

	// the manufacturer data of an EVSE
	// returns deviceName, serialNumber, error
	//
	// parameters:
	//   - entity: the entity of the EV
	ManufacturerData(entity spineapi.EntityRemoteInterface) (ManufacturerData, error)

	// return the minimum, maximum charging and, standby power of the connected EV
	//
	// parameters:
	//   - entity: the entity of the EV
	ChargingPowerLimits(entity spineapi.EntityRemoteInterface) (float64, float64, float64, error)

	// is the EV in sleep mode
	//
	// parameters:
	//   - entity: the entity of the EV
	IsInSleepMode(entity spineapi.EntityRemoteInterface) (bool, error)
}

Actor: Customer Energy Management UseCase: EV Commissioning and Configuration

type CemEVCEMInterface

type CemEVCEMInterface interface {
	api.UseCaseInterface

	// return the number of ac connected phases of the EV or 0 if it is unknown
	//
	// parameters:
	//   - entity: the entity of the EV
	PhasesConnected(entity spineapi.EntityRemoteInterface) (uint, error)

	// return the last current measurement for each phase of the connected EV
	//
	// parameters:
	//   - entity: the entity of the EV
	CurrentPerPhase(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return the last power measurement for each phase of the connected EV
	//
	// parameters:
	//   - entity: the entity of the EV
	PowerPerPhase(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return the charged energy measurement in Wh of the connected EV
	//
	// parameters:
	//   - entity: the entity of the EV
	EnergyCharged(entity spineapi.EntityRemoteInterface) (float64, error)
}

Actor: Customer Energy Management UseCase: EV Charging Electricity Measurement

type CemEVSECCInterface

type CemEVSECCInterface interface {
	api.UseCaseInterface

	// the manufacturer data of an EVSE
	//
	// parameters:
	//   - entity: the entity of the EV
	//
	// returns deviceName, serialNumber, error
	ManufacturerData(entity spineapi.EntityRemoteInterface) (ManufacturerData, error)

	// the operating state data of an EVSE
	//
	// parameters:
	//   - entity: the entity of the EV
	//
	// returns operatingState, lastErrorCode, error
	OperatingState(entity spineapi.EntityRemoteInterface) (model.DeviceDiagnosisOperatingStateType, string, error)
}

Actor: Customer Energy Management UseCase: EVSE Commissioning and Configuration

type CemEVSOCInterface

type CemEVSOCInterface interface {
	api.UseCaseInterface

	// return the EVscurrent state of charge of the EV or an error it is unknown
	//
	// parameters:
	//   - entity: the entity of the EV
	StateOfCharge(entity spineapi.EntityRemoteInterface) (float64, error)
}

Actor: Customer Energy Management UseCase: EV State Of Charge

type CemOHPCFInterface added in v0.8.0

type CemOHPCFInterface interface {
	api.UseCaseInterface

	// Get all relevant info for an available power consumption
	//
	// return OptionalPowerConsumptionInfo struct with all available info if an optional power consumption has been announced
	OptionalPowerConsumption(entity spineapi.EntityRemoteInterface) (*OptionalPowerConsumptionInfo, error)

	// The availability of an optional consumption of power [OHPCF-011/1].
	//
	// return true if the optional consumption of power is possible
	OptionalPowerConsumptionAvailable(entity spineapi.EntityRemoteInterface) (bool, error)

	// The requested power estimate value [OHPCF-011/2/1].
	//
	// return the requested power estimate value
	RequestedPowerEstimate(entity spineapi.EntityRemoteInterface) (float64, error)

	// The maximal value for the requested power estimate [OHPCF-011/2/1].
	//
	// return the maximal value for the requested power estimate
	RequestedPowerMax(entity spineapi.EntityRemoteInterface) (float64, error)

	// Indication whether the consumption may be stopped by the CEM [OHPCF-011/5].
	//
	// return true if the consumption may be stopped
	ConsumptionIsStoppable(entity spineapi.EntityRemoteInterface) (bool, error)

	// Indication whether the consumption may be paused and resumed by the CEM [OHPCF-011/6]
	//
	// return true if the consumption may be paused
	ConsumptionIsPausable(entity spineapi.EntityRemoteInterface) (bool, error)

	// The start time of the process [OHPCF-012/1].
	//
	// return the start time of the process
	PowerConsumptionProcessStartTime(entity spineapi.EntityRemoteInterface) (time.Time, error)

	// The current state of this power consumption process [OHPCF-012/2].
	//
	// return the current state of this power consumption process
	PowerConsumptionProcessState(entity spineapi.EntityRemoteInterface) (CompressorPowerConsumptionStateType, error)

	// The minimal time a consumption process must last [OHPCF-008].
	//
	// return the minimal time a consumption process must last
	PowerConsumptionMinimalRunDuration(entity spineapi.EntityRemoteInterface) (time.Duration, error)

	// The minimal time a pause of a consumption process must last [OHPCF-009].
	//
	// return the minimal time a pause of a consumption process must last
	PowerConsumptionMinimalPauseDuration(entity spineapi.EntityRemoteInterface) (time.Duration, error)

	// Schedule an optional power consumption process [OHPCF-004].
	//
	// note:
	// Rescheduling an already scheduled power consumption process is possible as long as the
	// scheduled process has not startet yet.
	//
	// parameters:
	//   - startIn: Delay from now until the power consumption starts (0 = start immediately)
	SchedulePowerConsumptionProcess(entity spineapi.EntityRemoteInterface, startIn time.Duration, resultCB func(result model.ResultDataType, msgCounter model.MsgCounterType)) (*model.MsgCounterType, error)

	// stop (abort) the process [OHPCF-022/1].
	AbortPowerConsumptionProcess(entity spineapi.EntityRemoteInterface, resultCB func(result model.ResultDataType, msgCounter model.MsgCounterType)) (*model.MsgCounterType, error)

	// pause the process [OHPCF-022/2].
	PausePowerConsumptionProcess(entity spineapi.EntityRemoteInterface, resultCB func(result model.ResultDataType, msgCounter model.MsgCounterType)) (*model.MsgCounterType, error)

	// resume the process [OHPCF-022/3].
	ResumePowerConsumptionProcess(entity spineapi.EntityRemoteInterface, resultCB func(result model.ResultDataType, msgCounter model.MsgCounterType)) (*model.MsgCounterType, error)
}

type CemOPEVInterface

type CemOPEVInterface interface {
	api.UseCaseInterface

	// return the min, max, default limits for each phase of the connected EV
	//
	// parameters:
	//   - entity: the entity of the EV
	CurrentLimits(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, map[model.ElectricalConnectionPhaseNameType]float64, map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return the current loadcontrol obligation limits
	//
	// parameters:
	//   - entity: the entity of the EV
	//
	// return values:
	//   - limits: per phase data
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	LoadControlLimits(entity spineapi.EntityRemoteInterface) (limits []LoadLimitsPhase, resultErr error)

	// send new LoadControlLimits to the remote EV
	//
	// parameters:
	//   - entity: the entity of the EV
	//   - limits: a set of limits containing phase specific limit data
	//   - resultCB: callback function for handling the result response
	//
	// Sets a maximum A limit for each phase that the EV may not exceed.
	// Mainly used for implementing overload protection of the site or limiting the
	// maximum charge power of EVs when the EV and EVSE communicate via IEC61851
	// and with ISO15118 if the EV does not support the Optimization of Self Consumption
	// usecase.
	//
	// note:
	// For obligations to work for optimizing solar excess power, the EV needs to
	// have an energy demand. Recommendations work even if the EV does not have an active
	// energy demand, given it communicated with the EVSE via ISO15118 and supports the usecase.
	// In ISO15118-2 the usecase is only supported via VAS extensions which are vendor specific
	// and needs to have specific EVSE support for the specific EV brand.
	// In ISO15118-20 this is a standard feature which does not need special support on the EVSE.
	WriteLoadControlLimits(
		entity spineapi.EntityRemoteInterface,
		limits []LoadLimitsPhase,
		resultCB func(result model.ResultDataType, msgCounter model.MsgCounterType),
	) (*model.MsgCounterType, error)

	// start sending heartbeat from the local CEM entity
	//
	// the heartbeat is started by default when a non 0 timeout is set in the service configuration
	StartHeartbeat()

	// stop sending heartbeat from the local CEM entity
	StopHeartbeat()

	// set the local operating state of the local cem entity
	//
	// parameters:
	//   - failureState: if true, the operating state is set to failure, otherwise to normal
	SetOperatingState(failureState bool) error
}

Actor: Customer Energy Management UseCase: Overload Protection by EV Charging Current Curtailment

type CemOSCEVInterface

type CemOSCEVInterface interface {
	api.UseCaseInterface

	// return the min, max, default limits for each phase of the connected EV
	//
	// parameters:
	//   - entity: the entity of the EV
	CurrentLimits(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, map[model.ElectricalConnectionPhaseNameType]float64, map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return the current loadcontrol recommendation limits
	//
	// parameters:
	//   - entity: the entity of the EV
	//
	// return values:
	//   - limits: per phase data
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	LoadControlLimits(entity spineapi.EntityRemoteInterface) (limits []LoadLimitsPhase, resultErr error)

	// send new LoadControlLimits to the remote EV
	//
	// parameters:
	//   - entity: the entity of the EV
	//   - limits: a set of limits containing phase specific limit data
	//   - resultCB: callback function for handling the result response
	//
	// recommendations:
	// Sets a recommended charge power in A for each phase. This is mainly
	// used if the EV and EVSE communicate via ISO15118 to support charging excess solar power.
	// The EV either needs to support the Optimization of Self Consumption usecase or
	// the EVSE needs to be able map the recommendations into oligation limits which then
	// works for all EVs communication either via IEC61851 or ISO15118.
	WriteLoadControlLimits(
		entity spineapi.EntityRemoteInterface,
		limits []LoadLimitsPhase,
		resultCB func(result model.ResultDataType, msgCounter model.MsgCounterType),
	) (*model.MsgCounterType, error)

	// start sending heartbeat from the local CEM entity
	//
	// the heartbeat is started by default when a non 0 timeout is set in the service configuration
	StartHeartbeat()

	// stop sending heartbeat from the local CEM entity
	StopHeartbeat()

	// set the local operating state of the local cem entity
	//
	// parameters:
	//   - failureState: if true, the operating state is set to failure, otherwise to normal
	SetOperatingState(failureState bool) error
}

Actor: Customer Energy Management UseCase: Optimization of Self-Consumption During EV Charging

type CemVABDInterface

type CemVABDInterface interface {
	api.UseCaseInterface

	// return the current (dis)charging power
	//
	// parameters:
	//   - entity: the entity of the inverter
	Power(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the cumulated battery system charge energy
	//
	// parameters:
	//   - entity: the entity of the inverter
	EnergyCharged(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the cumulated battery system discharge energy
	//
	// parameters:
	//   - entity: the entity of the inverter
	EnergyDischarged(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the current state of charge of the battery system
	//
	// parameters:
	//   - entity: the entity of the inverter
	StateOfCharge(entity spineapi.EntityRemoteInterface) (float64, error)
}

Actor: Customer Energy Management UseCase: Visualization of Aggregated Battery Data

type CemVAPDInterface

type CemVAPDInterface interface {
	api.UseCaseInterface

	// return the current production power
	//
	// parameters:
	//   - entity: the entity of the inverter
	Power(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the nominal peak power
	//
	// parameters:
	//   - entity: the entity of the inverter
	PowerNominalPeak(entity spineapi.EntityRemoteInterface) (float64, error)

	// return total PV yield
	//
	// parameters:
	//   - entity: the entity of the inverter
	PVYieldTotal(entity spineapi.EntityRemoteInterface) (float64, error)
}

Actor: Customer Energy Management UseCase: Visualization of Aggregated Photovoltaic Data

type ChargePlan

type ChargePlan struct {
	Slots []ChargePlanSlotValue // Individual charging slot details
}

Contains details about an EV generated charging plan

type ChargePlanSlotValue

type ChargePlanSlotValue struct {
	Start    time.Time // The start time of the slot
	End      time.Time // The duration of the slot
	Value    float64   // planned power value
	MinValue float64   // minimum power value
	MaxValue float64   // maximum power value
}

Contains details about a charging plan slot

type CompressorPowerConsumptionStateType added in v0.8.0

type CompressorPowerConsumptionStateType string
const (
	CompressorPowerConsumptionStateAvailable CompressorPowerConsumptionStateType = "available"
	CompressorPowerConsumptionStateScheduled CompressorPowerConsumptionStateType = "scheduled"
	CompressorPowerConsumptionStateRunning   CompressorPowerConsumptionStateType = "running"
	CompressorPowerConsumptionStatePaused    CompressorPowerConsumptionStateType = "paused"
	CompressorPowerConsumptionStateCompleted CompressorPowerConsumptionStateType = "completed"
	CompressorPowerConsumptionStateStopped   CompressorPowerConsumptionStateType = "stopped" // (aborted)
)

type CsLPCInterface

type CsLPCInterface interface {
	api.UseCaseInterface

	// return the current consumption limit data
	//
	// return values:
	//   - limit: load limit data
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	ConsumptionLimit() (LoadLimit, error)

	// set the current loadcontrol limit data
	SetConsumptionLimit(limit LoadLimit) (resultErr error)

	// return the currently pending incoming consumption write limits
	PendingConsumptionLimits() map[model.MsgCounterType]LoadLimit

	// accept or deny an incoming consumption write limit
	//
	// parameters:
	//  - msg: the incoming write message
	//  - approve: if the write limit for msg should be approved or not
	//  - reason: the reason why the approval is denied, otherwise an empty string
	ApproveOrDenyConsumptionLimit(msgCounter model.MsgCounterType, approve bool, reason string)

	// return Failsafe limit for the consumed active (real) power of the
	// Controllable System. This limit becomes activated in "init" state or "failsafe state".
	//
	// return values:
	//   - value: the power limit in W
	//   - changeable: boolean if the client service can change the limit
	FailsafeConsumptionActivePowerLimit() (value float64, isChangeable bool, resultErr error)

	// set Failsafe limit for the consumed active (real) power of the
	// Controllable System. This limit becomes activated in "init" state or "failsafe state".
	//
	// parameters:
	//   - value: the power limit in W
	//   - changeable: boolean if the client service can change the limit
	SetFailsafeConsumptionActivePowerLimit(value float64, changeable bool) (resultErr error)

	// return minimum time the Controllable System remains in "failsafe state" unless conditions
	// specified in this Use Case permit leaving the "failsafe state"
	//
	// return values:
	//   - value: the power limit in W
	//   - changeable: boolean if the client service can change the limit
	FailsafeDurationMinimum() (duration time.Duration, isChangeable bool, resultErr error)

	// set minimum time the Controllable System remains in "failsafe state" unless conditions
	// specified in this Use Case permit leaving the "failsafe state"
	//
	// parameters:
	//   - duration: has to be >= 2h and <= 24h
	//   - changeable: boolean if the client service can change this value
	SetFailsafeDurationMinimum(duration time.Duration, changeable bool) (resultErr error)

	// return the currently pending incoming device configuration writes
	PendingDeviceConfigurations() map[model.MsgCounterType][]PendingDeviceConfiguration

	// accept or deny an incoming device configuration writes
	//
	// parameters:
	//  - msg: the incoming write message
	//  - approve: if the write limit for msg should be approved or not
	//  - reason: the reason why the approval is denied, otherwise an empty string
	ApproveOrDenyDeviceConfiguration(msgCounter model.MsgCounterType, approve bool, reason string)

	// start sending heartbeat from the local entity supporting this usecase
	//
	// the heartbeat is started by default when a non 0 timeout is set in the service configuration
	StartHeartbeat()

	// stop sending heartbeat from the local entity supporting this usecase
	StopHeartbeat()

	//
	// returns true, if the last heartbeat is within 2 minutes, otherwise false
	IsHeartbeatWithinDuration() bool

	// return nominal maximum active (real) power the Controllable System is allowed to consume.
	//
	// If the local device type is an EnergyManagementSystem, the contractual consumption
	// nominal max is returned, otherwise the power consumption nominal max is returned.
	ConsumptionNominalMax() (float64, error)

	// set power nominal maximum active (real) power the Controllable System is allowed to consume.
	//
	// If the local device type is an EnergyManagementSystem, the contractual consumption
	// nominal max is set, otherwise the power consumption nominal max is set.
	//
	// parameters:
	//   - value: nominal max power consumption in W
	SetConsumptionNominalMax(value float64) (resultErr error)
}

Actor: Controllable System UseCase: Limitation of Power Consumption

type CsLPPInterface

type CsLPPInterface interface {
	api.UseCaseInterface

	// return the current loadcontrol limit data
	//
	// return values:
	//   - limit: load limit data
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	ProductionLimit() (LoadLimit, error)

	// set the current loadcontrol limit data
	SetProductionLimit(limit LoadLimit) (resultErr error)

	// return the currently pending incoming production write limits
	PendingProductionLimits() map[model.MsgCounterType]LoadLimit

	// accept or deny an incoming production write limit
	//
	// parameters:
	//  - msg: the incoming write message
	//  - approve: if the write limit for msg should be approved or not
	//  - reason: the reason why the approval is denied, otherwise an empty string
	ApproveOrDenyProductionLimit(msgCounter model.MsgCounterType, approve bool, reason string)

	// return Failsafe limit for the produced active (real) power of the
	// Controllable System. This limit becomes activated in "init" state or "failsafe state".
	//
	// return values:
	//   - value: the power limit in W
	//   - changeable: boolean if the client service can change the limit
	FailsafeProductionActivePowerLimit() (value float64, isChangeable bool, resultErr error)

	// set Failsafe limit for the produced active (real) power of the
	// Controllable System. This limit becomes activated in "init" state or "failsafe state".
	//
	// parameters:
	//   - value: the power limit in W
	//   - changeable: boolean if the client service can change the limit
	SetFailsafeProductionActivePowerLimit(value float64, changeable bool) (resultErr error)

	// return minimum time the Controllable System remains in "failsafe state" unless conditions
	// specified in this Use Case permit leaving the "failsafe state"
	//
	// return values:
	//   - value: the power limit in W
	//   - changeable: boolean if the client service can change the limit
	FailsafeDurationMinimum() (duration time.Duration, isChangeable bool, resultErr error)

	// set minimum time the Controllable System remains in "failsafe state" unless conditions
	// specified in this Use Case permit leaving the "failsafe state"
	//
	// parameters:
	//   - duration: has to be >= 2h and <= 24h
	//   - changeable: boolean if the client service can change this value
	SetFailsafeDurationMinimum(duration time.Duration, changeable bool) (resultErr error)

	// return the currently pending incoming device configuration writes
	PendingDeviceConfigurations() map[model.MsgCounterType][]PendingDeviceConfiguration

	// accept or deny an incoming device configuration writes
	//
	// parameters:
	//  - msg: the incoming write message
	//  - approve: if the write limit for msg should be approved or not
	//  - reason: the reason why the approval is denied, otherwise an empty string
	ApproveOrDenyDeviceConfiguration(msgCounter model.MsgCounterType, approve bool, reason string)

	// start sending heartbeat from the local entity supporting this usecase
	//
	// the heartbeat is started by default when a non 0 timeout is set in the service configuration
	StartHeartbeat()

	// stop sending heartbeat from the local entity supporting this usecase
	StopHeartbeat()

	// check wether there was a heartbeat received within the last 2 minutes
	//
	// returns true, if the last heartbeat is within 2 minutes, otherwise false
	IsHeartbeatWithinDuration() bool

	// return nominal maximum active (real) power the Controllable System is allowed to produce.
	//
	// If the local device type is an EnergyManagementSystem, the contractual production
	// nominal max is returned, otherwise the power production nominal max is returned.
	ProductionNominalMax() (float64, error)

	// set power nominal maximum active (real) power the Controllable System is allowed to produce.
	//
	// If the local device type is an EnergyManagementSystem, the contractual production
	// nominal max is set, otherwise the power production nominal max is set.
	//
	// parameters:
	//   - value: nominal max power production in W
	SetProductionNominalMax(value float64) (resultErr error)
}

Actor: Controllable System UseCase: Limitation of Power Production

type Demand

type Demand struct {
	MinDemand          float64 // minimum demand in Wh to reach the minSoC setting, 0 if not set
	OptDemand          float64 // demand in Wh to reach the timer SoC setting
	MaxDemand          float64 // the maximum possible demand until the battery is full
	DurationUntilStart float64 // the duration in s from now until charging will start, this could be in the future but usualy is now
	DurationUntilEnd   float64 // the duration in s from now until minDemand or optDemand has to be reached, 0 if direct charge strategy is active
}

Contains details about the actual demands from the EV

General:

  • If duration and energy is 0, charge mode is EVChargeStrategyTypeNoDemand
  • If duration is 0, charge mode is EVChargeStrategyTypeDirectCharging and the slots should cover at least 48h
  • If both are != 0, charge mode is EVChargeStrategyTypeTimedCharging and the slots should cover at least the duration, but at max 168h (7d)

type DurationSlotValue

type DurationSlotValue struct {
	Duration time.Duration // Duration of this slot
	Value    float64       // Energy Cost or Power Limit
}

Contains details about power limits or incentives for a defined timeframe

type EVChargeStateType

type EVChargeStateType string
const (
	EVChargeStateTypeUnknown   EVChargeStateType = "Unknown"
	EVChargeStateTypeUnplugged EVChargeStateType = "unplugged"
	EVChargeStateTypeError     EVChargeStateType = "error"
	EVChargeStateTypePaused    EVChargeStateType = "paused"
	EVChargeStateTypeActive    EVChargeStateType = "active"
	EVChargeStateTypeFinished  EVChargeStateType = "finished"
)

type EVChargeStrategyType

type EVChargeStrategyType string
const (
	EVChargeStrategyTypeUnknown        EVChargeStrategyType = "unknown"
	EVChargeStrategyTypeNoDemand       EVChargeStrategyType = "nodemand"
	EVChargeStrategyTypeDirectCharging EVChargeStrategyType = "directcharging"
	EVChargeStrategyTypeMinSoC         EVChargeStrategyType = "minsoc"
	EVChargeStrategyTypeTimedCharging  EVChargeStrategyType = "timedcharging"
)

type EgLPCInterface

type EgLPCInterface interface {
	api.UseCaseInterface

	// return the current consumption limit data
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	// return values:
	//   - limit: load limit data
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	ConsumptionLimit(entity spineapi.EntityRemoteInterface) (limit LoadLimit, resultErr error)

	// send new LoadControlLimits
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - limit: load limit data
	//   - resultCB: callback function for handling the result response
	WriteConsumptionLimit(
		entity spineapi.EntityRemoteInterface,
		limit LoadLimit,
		resultCB func(result model.ResultDataType, msgCounter model.MsgCounterType),
	) (*model.MsgCounterType, error)

	// return Failsafe limit for the consumed active (real) power of the
	// Controllable System. This limit becomes activated in "init" state or "failsafe state".
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	// return values:
	//   - positive values are used for consumption
	FailsafeConsumptionActivePowerLimit(entity spineapi.EntityRemoteInterface) (float64, error)

	// send new Failsafe Consumption Active Power Limit
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - value: the new limit in W
	WriteFailsafeConsumptionActivePowerLimit(entity spineapi.EntityRemoteInterface, value float64) (*model.MsgCounterType, error)

	// return minimum time the Controllable System remains in "failsafe state" unless conditions
	// specified in this Use Case permit leaving the "failsafe state"
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	FailsafeDurationMinimum(entity spineapi.EntityRemoteInterface) (time.Duration, error)

	// send new Failsafe Duration Minimum
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - duration: the duration, between 2h and 24h
	WriteFailsafeDurationMinimum(entity spineapi.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error)

	// start sending heartbeat from the local entity supporting this usecase
	//
	// the heartbeat is started by default when a non 0 timeout is set in the service configuration
	StartHeartbeat()

	// stop sending heartbeat from the local entity supporting this usecase
	StopHeartbeat()

	// check wether there was a heartbeat received within the last 2 minutes
	//
	// returns true, if the last heartbeat is within 2 minutes, otherwise false
	IsHeartbeatWithinDuration(entity spineapi.EntityRemoteInterface) bool

	// return nominal maximum active (real) power the Controllable System is
	// able to consume according to the contract (EMS), device label or data sheet.
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	ConsumptionNominalMax(entity spineapi.EntityRemoteInterface) (float64, error)
}

Actor: Energy Guard UseCase: Limitation of Power Consumption

type EgLPPInterface

type EgLPPInterface interface {
	api.UseCaseInterface

	// return the current production limit data
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	// return values:
	//   - limit: load limit data
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	ProductionLimit(entity spineapi.EntityRemoteInterface) (limit LoadLimit, resultErr error)

	// send new LoadControlLimits
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - limit: load limit data
	//   - resultCB: callback function for handling the result response
	WriteProductionLimit(
		entity spineapi.EntityRemoteInterface,
		limit LoadLimit,
		resultCB func(result model.ResultDataType, msgCounter model.MsgCounterType),
	) (*model.MsgCounterType, error)

	// return Failsafe limit for the produced active (real) power of the
	// Controllable System. This limit becomes activated in "init" state or "failsafe state".
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	// return values:
	//   - positive values are used for production
	FailsafeProductionActivePowerLimit(entity spineapi.EntityRemoteInterface) (float64, error)

	// send new Failsafe Production Active Power Limit
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - value: the new limit in W
	WriteFailsafeProductionActivePowerLimit(entity spineapi.EntityRemoteInterface, value float64) (*model.MsgCounterType, error)

	// return minimum time the Controllable System remains in "failsafe state" unless conditions
	// specified in this Use Case permit leaving the "failsafe state"
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	FailsafeDurationMinimum(entity spineapi.EntityRemoteInterface) (time.Duration, error)

	// send new Failsafe Duration Minimum
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - duration: the duration, between 2h and 24h
	WriteFailsafeDurationMinimum(entity spineapi.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error)

	// start sending heartbeat from the local entity supporting this usecase
	//
	// the heartbeat is started by default when a non 0 timeout is set in the service configuration
	StartHeartbeat()

	// stop sending heartbeat from the local entity supporting this usecase
	StopHeartbeat()

	// check wether there was a heartbeat received within the last 2 minutes
	//
	// returns true, if the last heartbeat is within 2 minutes, otherwise false
	IsHeartbeatWithinDuration(entity spineapi.EntityRemoteInterface) bool

	// return nominal maximum active (real) power the Controllable System is
	// able to produce according to the contract (EMS), device label or data sheet.
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	ProductionNominalMax(entity spineapi.EntityRemoteInterface) (float64, error)
}

Actor: Energy Guard UseCase: Limitation of Power Production

type GcpMGCPInterface added in v0.8.0

type GcpMGCPInterface interface {
	api.UseCaseInterface

	// get the current power limitation factor
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	PowerLimitationFactor() (float64, error)

	// get the momentary power consumption or production at the grid connection point
	//
	// return values:
	//   - positive values are used for consumption
	//   - negative values are used for production
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	PowerTotal() (float64, error)

	// get the total feed in energy at the grid connection point
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	EnergyFeedIn() (float64, error)

	// get the total consumption energy at the grid connection point
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	EnergyConsumed() (float64, error)

	// get the momentary phase specific current consumption or production
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	CurrentPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// get the momentary phase specific voltage consumption or production
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	VoltagePerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// get frequency
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	Frequency() (float64, error)

	// use Update to update the data of the MGCP Usecase
	// use it like this:
	//
	//	mgcp.Update(
	//	  mgcp.MeasuredAcPowerTotal(1000, nil, nil),
	//	  mgcp.MeasuredAcPowerPhaseA(500, nil, nil),
	//	  ...
	//	)
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	Update(updateValueTypes ...UpdateData) error

	// Use UpdateDataPowerLimitationFactor in Update to set the current power limitation factor
	UpdateDataPowerLimitationFactor(value float64) UpdateData

	// Use UpdateDataPowerTotal in Update to set the momentary power consumption or production at the grid connection point
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataPowerTotal(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataEnergyFeedIn in Update to set the total feed in energy at the grid connection point
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	// The evaluationPeriodStart and evaluationPeriodEnd are optional and can be nil (both must be set to be used)
	UpdateDataEnergyFeedIn(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
		evaluationPeriodStart *time.Time,
		evaluationPeriodEnd *time.Time,
	) UpdateData

	// Use UpdateDataEnergyConsumed in Update to set the total consumption energy at the grid connection point
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	// The evaluationPeriodStart and evaluationPeriodEnd are optional and can be nil (both must be set to be used)
	UpdateDataEnergyConsumed(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
		evaluationPeriodStart *time.Time,
		evaluationPeriodEnd *time.Time,
	) UpdateData

	// Use UpdateDataCurrentPhaseA in Update to set the momentary phase specific current consumption or production
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataCurrentPhaseA(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataCurrentPhaseB in Update to set the momentary phase specific current consumption or production
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataCurrentPhaseB(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataCurrentPhaseC in Update to set the momentary phase specific current consumption or production
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataCurrentPhaseC(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataVoltagePhaseA in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseA(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataVoltagePhaseB in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseB(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataVoltagePhaseC in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseC(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataVoltagePhaseAToB in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseAToB(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataVoltagePhaseBToC in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseBToC(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataVoltagePhaseCToA in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseCToA(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData

	// Use UpdateDataFrequency in Update to set the frequency
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataFrequency(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
	) UpdateData
}

type IdentificationItem

type IdentificationItem struct {
	// the identification value
	Value string

	// the type of the identification value, e.g.
	ValueType model.IdentificationTypeType
}

identification

type IncentiveDescription

type IncentiveDescription struct {
	// the id of the incentive
	Id uint

	// the type of the incentive
	Type model.IncentiveTypeType

	// the currency of the incentive, if it is price based
	Currency model.CurrencyType
}

details about incentive

type IncentiveSlotConstraints

type IncentiveSlotConstraints struct {
	MinSlots uint // the minimum number of slots, no minimum if 0
	MaxSlots uint // the maximum number of slots, unlimited if 0
}

Details about the incentive slot constraints

type IncentiveTableDescriptionTier

type IncentiveTableDescriptionTier struct {
	// the id of the tier
	Id uint

	// the tiers type
	Type model.TierTypeType

	// each tear has 1 to 3 boundaries
	// used for different power limits, e.g. 0-1kW x€, 1-3kW y€, ...
	Boundaries []TierBoundaryDescription

	// each tier has 1 to 3 incentives
	//   - price/costs (absolute or relative)
	//   - renewable energy percentage
	//   - CO2 emissions
	Incentives []IncentiveDescription
}

Contains about one tier in a tariff

type IncentiveTariffDescription

type IncentiveTariffDescription struct {
	// each tariff can have 1 to 3 tiers
	Tiers []IncentiveTableDescriptionTier
}

Contains details about a tariff

type LoadLimit

type LoadLimit struct {
	Duration       time.Duration // the duration of the limit,
	IsChangeable   bool          // if the value can be changed via write, ignored when writing data
	IsActive       bool          // if the limit is active
	Value          float64       // the limit
	DeleteDuration bool          // if the Duration (TimePeriod in SPINE) should be deleted (only used for write commands. Relevant for LPC & LPP only)
}

Defines a limit data set

type LoadLimitsPhase

type LoadLimitsPhase struct {
	Phase        model.ElectricalConnectionPhaseNameType // the phase
	IsChangeable bool                                    // if the value can be changed via write, ignored when writing data
	IsActive     bool                                    // if the limit is active
	Value        float64                                 // the limit
}

Defines a phase specific limit data set

type MaMDTInterface added in v0.8.0

type MaMDTInterface interface {
	api.UseCaseInterface

	// return the domestic hot water temperature converted to the requested unit
	//
	// parameters:
	//   - entity: the entity of the device (e.g. DHW circuit)
	//   - unit: the requested temperature unit (degC, degF or K)
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such value is (yet) available
	//   - ErrDataInvalid if the currently available data is invalid and should be ignored
	//   - and others
	Temperature(entity spineapi.EntityRemoteInterface, unit model.UnitOfMeasurementType) (float64, error)
}

Actor: Monitoring Appliance UseCase: Monitoring of Domestic Hot Water (DHW) Temperature

type MaMGCPInterface

type MaMGCPInterface interface {
	api.UseCaseInterface

	// return the current power limitation factor
	//
	// parameters:
	//   - entity: the entity of the device (e.g. SMGW)
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	PowerLimitationFactor(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the momentary power consumption or production at the grid connection point
	//
	// parameters:
	//   - entity: the entity of the device (e.g. SMGW)
	//
	// return values:
	//   - positive values are used for consumption
	//   - negative values are used for production
	Power(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the total feed in energy at the grid connection point
	//
	// parameters:
	//   - entity: the entity of the device (e.g. SMGW)
	//
	// return values:
	//   - negative values are used for production
	EnergyFeedIn(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the total consumption energy at the grid connection point
	//
	// parameters:
	//   - entity: the entity of the device (e.g. SMGW)
	//
	// return values:
	//   - positive values are used for consumption
	EnergyConsumed(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the momentary current consumption or production at the grid connection point
	//
	// parameters:
	//   - entity: the entity of the device (e.g. SMGW)
	//
	// return values:
	//   - positive values are used for consumption
	//   - negative values are used for production
	CurrentPerPhase(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return the voltage phase details at the grid connection point
	//
	// parameters:
	//   - entity: the entity of the device (e.g. SMGW)
	VoltagePerPhase(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return frequency at the grid connection point
	//
	// parameters:
	//   - entity: the entity of the device (e.g. SMGW)
	Frequency(entity spineapi.EntityRemoteInterface) (float64, error)
}

Actor: Monitoring Appliance UseCase: Monitoring of Grid Connection Point

type MaMPCInterface

type MaMPCInterface interface {
	api.UseCaseInterface

	// return the momentary active power consumption or production
	//
	// parameters:
	//   - entity: the entity of the device (e.g. EVSE)
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	Power(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the momentary active phase specific power consumption or production per phase
	//
	// parameters:
	//   - entity: the entity of the device (e.g. EVSE)
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	PowerPerPhase(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return the total consumption energy
	//
	// parameters:
	//   - entity: the entity of the device (e.g. EVSE)
	//
	//   - positive values are used for consumption
	EnergyConsumed(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the total feed in energy
	//
	// parameters:
	//   - entity: the entity of the device (e.g. EVSE)
	//
	// return values:
	//   - negative values are used for production
	EnergyProduced(entity spineapi.EntityRemoteInterface) (float64, error)

	// return the momentary phase specific current consumption or production
	//
	// parameters:
	//   - entity: the entity of the device (e.g. EVSE)
	//
	// return values
	//   - positive values are used for consumption
	//   - negative values are used for production
	CurrentPerPhase(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return the phase specific voltage details
	//
	// parameters:
	//   - entity: the entity of the device (e.g. EVSE)
	VoltagePerPhase(entity spineapi.EntityRemoteInterface) (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// return frequency
	//
	// parameters:
	//   - entity: the entity of the device (e.g. EVSE)
	Frequency(entity spineapi.EntityRemoteInterface) (float64, error)
}

Actor: Monitoring Appliance UseCase: Monitoring of Power Consumption

type ManufacturerData added in v0.8.0

type ManufacturerData struct {
	DeviceName                     string
	DeviceCode                     string
	SerialNumber                   string
	SoftwareRevision               string
	HardwareRevision               string
	VendorName                     string
	VendorCode                     string
	BrandName                      string
	PowerSource                    string
	ManufacturerNodeIdentification string
	ManufacturerLabel              string
	ManufacturerDescription        string
}

manufacturer data type

type MuMPCInterface added in v0.8.0

type MuMPCInterface interface {
	api.UseCaseInterface

	// get the momentary active power consumption or production
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	Power() (float64, error)

	// get the momentary active power consumption or production per phase
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	PowerPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// get the total feed in energy
	//
	//   - negative values are used for production
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	EnergyProduced() (float64, error)

	// get the total feed in energy
	//
	//   - negative values are used for production
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	EnergyConsumed() (float64, error)

	// get the momentary phase specific current consumption or production
	//
	//   - positive values are used for consumption
	//   - negative values are used for production
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	CurrentPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// get the phase specific voltage details
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	VoltagePerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error)

	// get frequency
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	Frequency() (float64, error)

	// use Update to update the measurement data
	// use it like this:
	//
	//	mpc.Update(
	//	  mpc.UpdateDataPowerTotal(1000, nil, nil),
	//	  mpc.UpdateDataPowerPhaseA(500, nil, nil),
	//	  ...
	//	)
	//
	// possible errors:
	//   - ErrMissingData if the id is not available
	//   - and others
	Update(data ...UpdateMeasurementData) error

	// use UpdateDataPowerTotal in Update to set the momentary active power consumption or production
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataPowerTotal(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataPowerPhaseA in Update to set the momentary active power consumption or production per phase
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataPowerPhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataPowerPhaseB in Update to set the momentary active power consumption or production per phase
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataPowerPhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataPowerPhaseC in Update to set the momentary active power consumption or production per phase
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataPowerPhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataEnergyConsumed in Update to set the total feed in energy
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	// The evaluationStart and End are optional and can be nil (both must be set to be used)
	UpdateDataEnergyConsumed(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
		evaluationStart *time.Time,
		evaluationEnd *time.Time,
	) UpdateMeasurementData

	// use UpdateDataEnergyProduced in Update to set the total feed in energy
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	// The evaluationStart and End are optional and can be nil (both must be set to be used)
	UpdateDataEnergyProduced(
		value float64,
		timestamp *time.Time,
		valueState *model.MeasurementValueStateType,
		evaluationStart *time.Time,
		evaluationEnd *time.Time,
	) UpdateMeasurementData

	// use UpdateDataCurrentPhaseA in Update to set the momentary phase specific current consumption or production
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataCurrentPhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataCurrentPhaseB in Update to set the momentary phase specific current consumption or production
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataCurrentPhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataCurrentPhaseC in Update to set the momentary phase specific current consumption or production
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataCurrentPhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataVoltagePhaseA in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataVoltagePhaseB in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataVoltagePhaseC in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataVoltagePhaseAToB in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseAToB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataVoltagePhaseBToC in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseBToC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use UpdateDataVoltagePhaseAToC in Update to set the phase specific voltage details
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataVoltagePhaseAToC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData

	// use AcFrequency in Update to set the frequency
	// The timestamp is optional and can be nil
	// The valueState shall be set if it differs from the normal valueState otherwise it can be nil
	UpdateDataFrequency(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData
}

Actor: Monitoring Unit UseCase: Monitoring of Power Consumption

type OptionalPowerConsumptionInfo added in v0.8.0

type OptionalPowerConsumptionInfo struct {
	PowerSequenceId model.PowerSequenceIdType
	Power           *float64
	MaxPower        *float64
	State           model.PowerSequenceStateType
	IsPausable      bool
	IsStoppable     bool
	StartTime       *time.Time
}

type PendingDeviceConfiguration added in v0.8.0

type PendingDeviceConfiguration struct {
	Description       model.DeviceConfigurationKeyValueDescriptionDataType `json:"description"`
	KeyName           model.DeviceConfigurationKeyNameType                 `json:"keyName"`
	Value             *model.DeviceConfigurationKeyValueValueType          `json:"value,omitempty"`
	IsValueChangeable *bool                                                `json:"isValueChangeable,omitempty"`
}

type TierBoundaryDescription

type TierBoundaryDescription struct {
	// the id of the boundary
	Id uint

	// the type of the boundary
	Type model.TierBoundaryTypeType

	// the unit of the boundary
	Unit model.UnitOfMeasurementType
}

details about the boundary

type TimeSlotConstraints

type TimeSlotConstraints struct {
	MinSlots             uint          // the minimum number of slots, no minimum if 0
	MaxSlots             uint          // the maximum number of slots, unlimited if 0
	MinSlotDuration      time.Duration // the minimum duration of a slot, no minimum if 0
	MaxSlotDuration      time.Duration // the maximum duration of a slot, unlimited if 0
	SlotDurationStepSize time.Duration // the duration has to be a multiple of this value if != 0
}

Details about the time slot constraints

type UpdateConfigurationData added in v0.8.0

type UpdateConfigurationData interface {
	UpdateData
	ConfigurationData() model.DeviceConfigurationKeyValueDataType
}

used to enable batch data updates for ConfigurationData

usecases can use this interface to provide batch update capabilities by implementing a method that takes a list of this interface and updates the configuration data

type UpdateData added in v0.8.0

type UpdateData interface {
	Supported() bool
	NotSupportedError() error
}

used to enable batch data updates for certain usecases

a usecase that wants to provide batch update capabilities using this interface should

1. provide methods that return a type implementing this interface 2. provide an Update method that accepts a list of this interface

The Update method can then iterate over the provided UpdateData, ensure all data points are supported, and then create a batched spine update request

type UpdateMeasurementData added in v0.8.0

type UpdateMeasurementData interface {
	UpdateData
	MeasurementData() api.MeasurementDataForID
}

used to enable batch data updates for MeaserumentData

usecases can use this interface to provide batch update capabilities by implementing a method that takes a list of this interface and passes a list of MeasurementData to Measurement.UpdateDataForIds

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL