package loadpoint import ( "time" "github.com/evcc-io/evcc/api" ) //go:generate mockgen -package loadpoint -destination mock.go -mock_names API=MockAPI github.com/evcc-io/evcc/core/loadpoint API // Controller gives access to loadpoint type Controller interface { LoadpointControl(API) } // API is the external loadpoint API type API interface { // // status // // GetStatus returns the charging status GetStatus() api.ChargeStatus // // references // // GetCharger returns the loadpoint charger GetChargerName() string // GetMeter returns the loadpoint meter GetMeterName() string // GetCircuitName returns the loadpoint circuit name GetCircuitName() string // GetCircuit returns the loadpoint circuit GetCircuit() api.Circuit // GetDefaultVehicle returns the loadpoint default vehicle GetDefaultVehicle() string // // settings // // GetTitle returns the loadpoint title GetTitle() string // SetTitle sets the loadpoint title SetTitle(string) // GetPriority returns the priority GetPriority() int // SetPriority sets the priority SetPriority(int) // GetMinCurrent returns the min charging current GetMinCurrent() float64 // SetMinCurrent sets the min charging current SetMinCurrent(float64) error // GetMaxCurrent returns the max charging current GetMaxCurrent() float64 // SetMaxCurrent sets the max charging current SetMaxCurrent(float64) error // GetMode returns the current charge mode GetMode() api.ChargeMode // SetMode sets the charge mode SetMode(api.ChargeMode) // GetDefaultMode returns the default charge mode (for reset) GetDefaultMode() api.ChargeMode // SetDefaultMode sets the default charge mode (for reset) SetDefaultMode(api.ChargeMode) // GetPhases returns the enabled phases GetPhases() int // GetPhasesConfigured returns the configured phases GetPhasesConfigured() int // SetPhasesConfigured sets the configured phases SetPhasesConfigured(int) error // ActivePhases returns the active phases for the current vehicle ActivePhases() int // GetLimitSoc returns the session limit soc GetLimitSoc() int // SetLimitSoc sets the session limit soc SetLimitSoc(soc int) // GetLimitEnergy returns the session limit energy GetLimitEnergy() float64 // SetLimitEnergy sets the session limit energy SetLimitEnergy(energy float64) // // effective values // // EffectivePriority returns the effective priority EffectivePriority() int // EffectivePlanId returns the effective plan id EffectivePlanId() int // EffectivePlanTime returns the effective plan time EffectivePlanTime() time.Time // EffectiveMinPower returns the min charging power for the minimum active phases EffectiveMinPower() float64 // EffectiveMaxPower returns the max charging power taking active phases into account EffectiveMaxPower() float64 // PublishEffectiveValues publishes effective values for currently attached vehicle PublishEffectiveValues() // // plan // // GetPlanEnergy returns the charge plan energy GetPlanEnergy() (time.Time, float64) // SetPlanEnergy sets the charge plan energy SetPlanEnergy(time.Time, float64) error // GetPlanGoal returns the plan goal and if the goal is soc based GetPlanGoal() (float64, bool) // GetPlanRequiredDuration returns required duration of plan to reach the goal from current state GetPlanRequiredDuration(goal, maxPower float64) time.Duration // SocBasedPlanning determines if the planner is soc based SocBasedPlanning() bool // GetPlan creates a charging plan GetPlan(targetTime time.Time, requiredDuration time.Duration) (api.Rates, error) // GetSocConfig returns the soc poll settings GetSocConfig() SocConfig // SetSocConfig sets the soc poll settings SetSocConfig(soc SocConfig) // GetThresholds returns the PV mode threshold settings GetThresholds() ThresholdsConfig // SetThresholds sets the PV mode threshold settings SetThresholds(thresholds ThresholdsConfig) // GetEnableThreshold gets the loadpoint enable threshold GetEnableThreshold() float64 // SetEnableThreshold sets loadpoint enable threshold SetEnableThreshold(threshold float64) // GetDisableThreshold gets the loadpoint disable threshold GetDisableThreshold() float64 // SetDisableThreshold sets loadpoint disable threshold SetDisableThreshold(threshold float64) // GetEnableDelay gets the loadpoint enable delay GetEnableDelay() time.Duration // SetEnableDelay sets loadpoint enable delay SetEnableDelay(delay time.Duration) // GetDisableDelay gets the loadpoint disable delay GetDisableDelay() time.Duration // SetDisableDelay sets loadpoint disable delay SetDisableDelay(delay time.Duration) // GetBatteryBoost returns the battery boost GetBatteryBoost() int // SetBatteryBoost sets the battery boost SetBatteryBoost(enable bool) error // RemoteControl sets remote status demand RemoteControl(string, RemoteDemand) // // smart grid charging // // GetSmartChargingActive determines if smart charging is active GetSmartCostLimit() *float64 // SetSmartCostLimit sets the smart cost limit SetSmartCostLimit(limit *float64) // // power and energy // // HasChargeMeter determines if a physical charge meter is attached HasChargeMeter() bool // GetChargePower returns the current charging power GetChargePower() float64 // GetChargePowerFlexibility returns the flexible amount of current charging power GetChargePowerFlexibility() float64 // GetMaxPhaseCurrent returns max phase current GetMaxPhaseCurrent() float64 // // charge progress // // IsFastChargingActive indicates if fast charging with maximum power is active IsFastChargingActive() bool // GetRemainingDuration is the estimated remaining charging duration GetRemainingDuration() time.Duration // GetRemainingEnergy is the remaining charge energy in Wh GetRemainingEnergy() float64 // // vehicles // // GetVehicle gets the active vehicle GetVehicle() api.Vehicle // SetVehicle sets the active vehicle SetVehicle(vehicle api.Vehicle) // StartVehicleDetection allows triggering vehicle detection for debugging purposes StartVehicleDetection() }