meter

package
v0.0.0-...-3371691 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBoschBpts5Hybrid

func NewBoschBpts5Hybrid(uri, usage string, cache time.Duration) (api.Meter, error)

NewBoschBpts5Hybrid creates a Bosch BPT-S 5 Hybrid Meter

func NewBoschBpts5HybridFromConfig

func NewBoschBpts5HybridFromConfig(other map[string]interface{}) (api.Meter, error)

NewBoschBpts5HybridFromConfig creates a Bosch BPT-S 5 Hybrid Meter from generic config

func NewCCUFromConfig

func NewCCUFromConfig(other map[string]interface{}) (api.Meter, error)

NewCCUFromConfig creates a Homematic meter from generic config

func NewCfosPowerBrainFromConfig

func NewCfosPowerBrainFromConfig(other map[string]interface{}) (api.Meter, error)

NewCfosPowerBrainFromConfig creates a cFos meter from generic config

func NewConfigurableFromConfig

func NewConfigurableFromConfig(other map[string]interface{}) (api.Meter, error)

NewConfigurableFromConfig creates api.Meter from config

func NewDiscovergyFromConfig

func NewDiscovergyFromConfig(other map[string]interface{}) (api.Meter, error)

NewDiscovergyFromConfig creates a new configurable meter

func NewDsmr

func NewDsmr(uri, energy string, timeout time.Duration) (api.Meter, error)

NewDsmr creates DSMR meter

func NewDsmrFromConfig

func NewDsmrFromConfig(other map[string]interface{}) (api.Meter, error)

NewDsmrFromConfig creates a DSMR meter from generic config

func NewFritzDECTFromConfig

func NewFritzDECTFromConfig(other map[string]interface{}) (api.Meter, error)

NewFritzDECTFromConfig creates a fritzdect meter from generic config

func NewFromConfig

func NewFromConfig(typ string, other map[string]interface{}) (v api.Meter, err error)

NewFromConfig creates meter from configuration

func NewHomeWizardFromConfig

func NewHomeWizardFromConfig(other map[string]interface{}) (api.Meter, error)

NewHomeWizardFromConfig creates a HomeWizard meter from generic config

func NewLgEss

func NewLgEss(uri, usage, registration, password string, cache time.Duration, capacity func() float64) (api.Meter, error)

NewLgEss creates an LgEss Meter

func NewLgEssFromConfig

func NewLgEssFromConfig(other map[string]interface{}) (api.Meter, error)

NewLgEssFromConfig creates an LgEss Meter from generic config

func NewMeterFromTemplateConfig

func NewMeterFromTemplateConfig(other map[string]interface{}) (api.Meter, error)

func NewModbusFromConfig

func NewModbusFromConfig(other map[string]interface{}) (api.Meter, error)

NewModbusFromConfig creates api.Meter from config

func NewMovingAverageFromConfig

func NewMovingAverageFromConfig(other map[string]interface{}) (api.Meter, error)

NewMovingAverageFromConfig creates api.Meter from config

func NewMyStromFromConfig

func NewMyStromFromConfig(other map[string]interface{}) (api.Meter, error)

NewMyStromFromConfig creates a myStrom meter from generic config

func NewOpenWBFromConfig

func NewOpenWBFromConfig(other map[string]interface{}) (api.Meter, error)

NewOpenWBFromConfig creates a new configurable meter

func NewPowerWall

func NewPowerWall(uri, usage, user, password string, cache time.Duration) (api.Meter, error)

NewPowerWall creates a Tesla PowerWall Meter

func NewPowerWallFromConfig

func NewPowerWallFromConfig(other map[string]interface{}) (api.Meter, error)

NewPowerWallFromConfig creates a PowerWall Powerwall Meter from generic config

func NewRCT

func NewRCT(uri, usage string, cache time.Duration, capacity func() float64) (api.Meter, error)

NewRCT creates an RCT meter

func NewRCTFromConfig

func NewRCTFromConfig(other map[string]interface{}) (api.Meter, error)

NewRCTFromConfig creates an RCT from generic config

func NewSMA

func NewSMA(uri, password, iface string, serial uint32, scale float64, capacity func() float64) (api.Meter, error)

NewSMA creates an SMA meter

func NewSMAFromConfig

func NewSMAFromConfig(other map[string]interface{}) (api.Meter, error)

NewSMAFromConfig creates an SMA meter from generic config

func NewShellyEnergyMeterFromConfig

func NewShellyEnergyMeterFromConfig(other map[string]interface{}) (api.Meter, error)

NewShellyFromConfig creates a Shelly charger from generic config

func NewShellyFromConfig

func NewShellyFromConfig(other map[string]interface{}) (api.Meter, error)

NewShellyFromConfig creates a Shelly charger from generic config

func NewTPLinkFromConfig

func NewTPLinkFromConfig(other map[string]interface{}) (api.Meter, error)

NewTPLinkFromConfig creates a tapo meter from generic config

func NewTapoFromConfig

func NewTapoFromConfig(other map[string]interface{}) (api.Meter, error)

NewTapoFromConfig creates a tapo meter from generic config

func NewTasmota

func NewTasmota(uri, user, password, usage string, channels []int, cache time.Duration) (api.Meter, error)

NewTasmota creates Tasmota meter

func NewTasmotaFromConfig

func NewTasmotaFromConfig(other map[string]interface{}) (api.Meter, error)

NewTasmotaFromConfig creates a Tasmota meter from generic config

func NewTibberFromConfig

func NewTibberFromConfig(other map[string]interface{}) (api.Meter, error)

func NewTqEm420FromConfig

func NewTqEm420FromConfig(other map[string]interface{}) (api.Meter, error)

NewTqEm420FromConfig creates a new configurable meter

func NewTqEmFromConfig

func NewTqEmFromConfig(other map[string]interface{}) (api.Meter, error)

NewTqEmFromConfig creates a new configurable meter

Types

type BoschBpts5Hybrid

type BoschBpts5Hybrid struct {
	// contains filtered or unexported fields
}

func (*BoschBpts5Hybrid) CurrentPower

func (m *BoschBpts5Hybrid) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

type CCU

type CCU struct {
	// contains filtered or unexported fields
}

Homematic CCU meter implementation

func NewCCU

func NewCCU(uri, deviceid, meterid, switchid, user, password, usage string, cache time.Duration) (*CCU, error)

NewCCU creates a new connection with usage for meter

func (*CCU) CurrentPower

func (c *CCU) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

func (*CCU) TotalEnergy

func (c *CCU) TotalEnergy() (float64, error)

TotalEnergy implements the api.MeterEnergy interface

type CfosPowerBrain

type CfosPowerBrain struct {
	// contains filtered or unexported fields
}

CfosPowerBrain is a meter implementation for cFos PowerBrain wallboxes. It uses Modbus TCP to communicate at modbus client id 1 and power meters at id 2 and 3. https://www.cfos-emobility.de/en-gb/cfos-power-brain/modbus-registers.htm

func NewCfosPowerBrain

func NewCfosPowerBrain(uri string, id uint8) (*CfosPowerBrain, error)

NewCfosPowerBrain creates a cFos meter

func (*CfosPowerBrain) CurrentPower

func (wb *CfosPowerBrain) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

func (*CfosPowerBrain) TotalEnergy

func (wb *CfosPowerBrain) TotalEnergy() (float64, error)

TotalEnergy implements the api.MeterEnergy interface

type Discovergy

type Discovergy struct {
	// contains filtered or unexported fields
}

func (*Discovergy) CurrentPower

func (m *Discovergy) CurrentPower() (float64, error)

func (*Discovergy) TotalEnergy

func (m *Discovergy) TotalEnergy() (float64, error)

type Dsmr

type Dsmr struct {
	// contains filtered or unexported fields
}

Dsmr meter implementation

func (*Dsmr) CurrentPower

func (m *Dsmr) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

type HomeWizard

type HomeWizard struct {
	// contains filtered or unexported fields
}

HomeWizard meter implementation

func NewHomeWizard

func NewHomeWizard(uri string, cache time.Duration) (*HomeWizard, error)

NewHomeWizard creates HomeWizard meter

func (*HomeWizard) CurrentPower

func (c *HomeWizard) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

func (*HomeWizard) TotalEnergy

func (c *HomeWizard) TotalEnergy() (float64, error)

TotalEnergy implements the api.MeterEnergy interface

type LgEss

type LgEss struct {
	// contains filtered or unexported fields
}

LgEss implements the api.Meter interface

func (*LgEss) CurrentPower

func (m *LgEss) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

type Meter

type Meter struct {
	// contains filtered or unexported fields
}

Meter is an api.Meter implementation with configurable getters and setters.

func NewConfigurable

func NewConfigurable(currentPowerG func() (float64, error)) (*Meter, error)

NewConfigurable creates a new meter

func (*Meter) CurrentPower

func (m *Meter) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

func (*Meter) Decorate

func (m *Meter) Decorate(
	totalEnergy func() (float64, error),
	currents func() (float64, float64, float64, error),
	voltages func() (float64, float64, float64, error),
	powers func() (float64, float64, float64, error),
	batterySoc func() (float64, error),
	capacity func() float64,
) api.Meter

Decorate attaches additional capabilities to the base meter

type Modbus

type Modbus struct {
	// contains filtered or unexported fields
}

Modbus is an api.Meter implementation with configurable getters and setters.

func (*Modbus) CurrentPower

func (m *Modbus) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

type MovingAverage

type MovingAverage struct {
	// contains filtered or unexported fields
}

func (*MovingAverage) CurrentPower

func (m *MovingAverage) CurrentPower() (float64, error)

type PowerWall

type PowerWall struct {
	// contains filtered or unexported fields
}

PowerWall is the tesla powerwall meter

func (*PowerWall) CurrentPower

func (m *PowerWall) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

type RCT

type RCT struct {
	// contains filtered or unexported fields
}

RCT implements the api.Meter interface

func (*RCT) CurrentPower

func (m *RCT) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

type SMA

type SMA struct {
	// contains filtered or unexported fields
}

SMA supporting SMA Home Manager 2.0, SMA Energy Meter 30 and SMA inverter

func (*SMA) CurrentPower

func (sm *SMA) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

func (*SMA) Currents

func (sm *SMA) Currents() (float64, float64, float64, error)

Currents implements the api.PhaseCurrents interface

func (*SMA) Diagnose

func (sm *SMA) Diagnose()

Diagnose implements the api.Diagnosis interface

func (*SMA) Powers

func (sm *SMA) Powers() (float64, float64, float64, error)

Powers implements the api.PhasePowers interface

func (*SMA) TotalEnergy

func (sm *SMA) TotalEnergy() (float64, error)

TotalEnergy implements the api.MeterEnergy interface

func (*SMA) Voltages

func (sm *SMA) Voltages() (float64, float64, float64, error)

Voltages implements the api.PhaseVoltages interface

type Tasmota

type Tasmota struct {
	// contains filtered or unexported fields
}

Tasmota meter implementation

func (*Tasmota) CurrentPower

func (c *Tasmota) CurrentPower() (float64, error)

CurrentPower implements the api.Meter interface

func (*Tasmota) TotalEnergy

func (c *Tasmota) TotalEnergy() (float64, error)

TotalEnergy implements the api.MeterEnergy interface

type Tibber

type Tibber struct {
	// contains filtered or unexported fields
}

func (*Tibber) CurrentPower

func (t *Tibber) CurrentPower() (float64, error)

func (*Tibber) Currents

func (t *Tibber) Currents() (float64, float64, float64, error)

Currents implements the api.PhaseCurrents interface

type TqEM420

type TqEM420 struct {
	// contains filtered or unexported fields
}

func (*TqEM420) CurrentPower

func (m *TqEM420) CurrentPower() (float64, error)

func (*TqEM420) Currents

func (m *TqEM420) Currents() (float64, float64, float64, error)

func (*TqEM420) TotalEnergy

func (m *TqEM420) TotalEnergy() (float64, error)

type TqEm

type TqEm struct {
	// contains filtered or unexported fields
}

func (*TqEm) CurrentPower

func (m *TqEm) CurrentPower() (float64, error)

func (*TqEm) TotalEnergy

func (m *TqEm) TotalEnergy() (float64, error)

type TqEm420Data

type TqEm420Data struct {
	SmartMeter struct {
		ConfigurationID string `json:"configuration_id"`
		Status          string `json:"status"`
		Timestamp       struct {
			Seconds float64 `json:"seconds"`
			Nanos   float64 `json:"nanos"`
		} `json:"timestamp"`
		Values struct {
			ActiveEnergyP     float64 `json:"active_energy_+"`
			ActiveEnergyL1P   float64 `json:"active_energy_+_L1"`
			ActiveEnergyL2P   float64 `json:"active_energy_+_L2"`
			ActiveEnergyL3P   float64 `json:"active_energy_+_L3"`
			ActiveEnergyM     float64 `json:"active_energy_-"`
			ActiveEnergyL1M   float64 `json:"active_energy_-_L1"`
			ActiveEnergyL2M   float64 `json:"active_energy_-_L2"`
			ActiveEnergyL3M   float64 `json:"active_energy_-_L3"`
			ActivePowerP      float64 `json:"active_power_+"`
			ActivePowerL1P    float64 `json:"active_power_+_L1"`
			ActivePowerL2P    float64 `json:"active_power_+_L2"`
			ActivePowerL3P    float64 `json:"active_power_+_L3"`
			ActivePowerM      float64 `json:"active_power_-"`
			ActivePowerL1M    float64 `json:"active_power_-_L1"`
			ActivePowerL2M    float64 `json:"active_power_-_L2"`
			ActivePowerL3M    float64 `json:"active_power_-_L3"`
			ApparentEnergyP   float64 `json:"apparent_energy_+"`
			ApparentEnergyL1P float64 `json:"apparent_energy_+_L1"`
			ApparentEnergyL2P float64 `json:"apparent_energy_+_L2"`
			ApparentEnergyL3P float64 `json:"apparent_energy_+_L3"`
			ApparentEnergyM   float64 `json:"apparent_energy_-"`
			ApparentEnergyL1M float64 `json:"apparent_energy_-_L1"`
			ApparentEnergyL2M float64 `json:"apparent_energy_-_L2"`
			ApparentEnergyL3M float64 `json:"apparent_energy_-_L3"`
			ApparentPowerP    float64 `json:"apparent_power_+"`
			ApparentPowerL1P  float64 `json:"apparent_power_+_L1"`
			ApparentPowerL2P  float64 `json:"apparent_power_+_L2"`
			ApparentPowerL3P  float64 `json:"apparent_power_+_L3"`
			ApparentPowerM    float64 `json:"apparent_power_-"`
			ApparentPowerL1M  float64 `json:"apparent_power_-_L1"`
			ApparentPowerL2M  float64 `json:"apparent_power_-_L2"`
			ApparentPowerL3M  float64 `json:"apparent_power_-_L3"`
			CurrentL1         float64 `json:"current_L1"`
			CurrentL2         float64 `json:"current_L2"`
			CurrentL3         float64 `json:"current_L3"`
			PowerFactor       float64 `json:"power_factor"`
			PowerFactorL1     float64 `json:"power_factor_L1"`
			PowerFactorL2     float64 `json:"power_factor_L2"`
			PowerFactorL3     float64 `json:"power_factor_L3"`
			ReactiveEnergyP   float64 `json:"reactive_energy_+"`
			ReactiveEnergyL1P float64 `json:"reactive_energy_+_L1"`
			ReactiveEnergyL2P float64 `json:"reactive_energy_+_L2"`
			ReactiveEnergyL3P float64 `json:"reactive_energy_+_L3"`
			ReactiveEnergyM   float64 `json:"reactive_energy_-"`
			ReactiveEnergyL1M float64 `json:"reactive_energy_-_L1"`
			ReactiveEnergyL2M float64 `json:"reactive_energy_-_L2"`
			ReactiveEnergyL3M float64 `json:"reactive_energy_-_L3"`
			ReactivePowerP    float64 `json:"reactive_power_+"`
			ReactivePowerL1P  float64 `json:"reactive_power_+_L1"`
			ReactivePowerL2P  float64 `json:"reactive_power_+_L2"`
			ReactivePowerL3P  float64 `json:"reactive_power_+_L3"`
			ReactivePowerM    float64 `json:"reactive_power_-"`
			ReactivePowerL1M  float64 `json:"reactive_power_-_L1"`
			ReactivePowerL2M  float64 `json:"reactive_power_-_L2"`
			ReactivePowerL3M  float64 `json:"reactive_power_-_L3"`
			SupplyFrequency   float64 `json:"supply_frequency"`
			VoltageL1         float64 `json:"voltage_L1"`
			VoltageL2         float64 `json:"voltage_L2"`
			VoltageL3         float64 `json:"voltage_L3"`
		} `json:"values"`
	} `json:"smart-meter"`
}

Directories

Path Synopsis
Package lgpcs implements access to the LG pcs device (aka inverter).
Package lgpcs implements access to the LG pcs device (aka inverter).

Jump to

Keyboard shortcuts

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