sunspec

package
v0.0.0-...-3191c0d Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: BSD-3-Clause Imports: 22 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixKostal

func FixKostal(p sunspec.Point)

FixKostal implements workaround for negative KOSTAL values (https://github.com/volkszaehler/mbmd/pull/97)

Types

type SunSpec

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

SunSpec is the sunspec device implementation

func NewDevice

func NewDevice(meterType string, subdevice ...int) *SunSpec

NewDevice creates a Sunspec device

func (*SunSpec) Descriptor

func (d *SunSpec) Descriptor() meters.DeviceDescriptor

Descriptor implements the Device interface

func (*SunSpec) Initialize

func (d *SunSpec) Initialize(client modbus.Client) error

Initialize implements the Device interface

func (*SunSpec) Probe

func (d *SunSpec) Probe(client modbus.Client) (res meters.MeasurementResult, err error)

Probe implements the Device interface

func (*SunSpec) Query

func (d *SunSpec) Query(client modbus.Client) (res []meters.MeasurementResult, err error)

Query is called by the handler after preparing the bus by setting the device id and waiting for rate limit The results are scaled as defined in the divider map.

func (*SunSpec) QueryOp

func (d *SunSpec) QueryOp(client modbus.Client, measurement meters.Measurement) (res meters.MeasurementResult, err error)

QueryOp queries all models and blocks until measurement is found. The result is scaled as defined in the divider map.

func (*SunSpec) QueryPoint

func (d *SunSpec) QueryPoint(client modbus.Client, modelID, blockID int, pointID string) (float64, error)

QueryPoint executes a single query operation for model/block/point on the bus. The result is returned as-is, i.e. not scaled.

func (*SunSpec) QueryPointAny

func (d *SunSpec) QueryPointAny(client modbus.Client, modelID, blockID int, pointID string) (block sunspec.Block, point sunspec.Point, err error)

QueryPoint executes a single query operation for model/block/point on the bus

Jump to

Keyboard shortcuts

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