meter

package
v0.0.0-...-e6e1b3f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 20 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 NewOpenWBFromConfig

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

NewOpenWBFromConfig creates a new configurable meter

func NewSMA

func NewSMA(uri, serial, power, energy string) (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(
	totalEnergyG func() (float64, error),
	currentsG []func() (float64, error),
	batterySoCG 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 SMA

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

SMA supporting SMA Home Manager 2.0 and SMA Energy Meter 30

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 MeterCurrent 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