meter

package
v0.0.0-...-722e3e0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 NewFromConfig

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

NewFromConfig creates meter from configuration

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 NewOpenWBFromConfig

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

NewOpenWBFromConfig creates a new configurable meter

func NewSMA

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

NewSMA creates a SMA Meter

func NewSMAFromConfig

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

NewSMAFromConfig creates a SMA Meter from generic config

func NewTesla

func NewTesla(uri, usage, password string) (api.Meter, error)

NewTesla creates a Tesla Meter

func NewTeslaFromConfig

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

NewTeslaFromConfig creates a Tesla Powerwall Meter from generic config

Types

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),
	batterySoC func() (float64, error),
) 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 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.MeterCurrent interface

func (*SMA) Diagnose

func (sm *SMA) Diagnose()

Diagnose implements the api.Diagnosis interface

func (*SMA) TotalEnergy

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

TotalEnergy implements the api.MeterEnergy interface

type Tesla

type Tesla struct {
	*request.Helper
	// contains filtered or unexported fields
}

Tesla is the tesla powerwall meter

func (*Tesla) CurrentPower

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

CurrentPower implements the api.Meter interface

func (*Tesla) Login

func (m *Tesla) Login() error

Login calls login and saves the returned cookie

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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