sma

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Any subscriber receives all messages
	Any = "<any>"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

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

Listener for receiving SMA multicast data packages

var Instance *Listener

Instance is the Listener singleton

func New

func New(log *util.Logger) (*Listener, error)

New creates a Listener

func (*Listener) Subscribe

func (l *Listener) Subscribe(identifier string, c chan<- Telegram)

Subscribe adds a client address and message channel

type Obis

type Obis = string

Obis defines an Obis code as understood my the EMETER protocol

const (
	ImportPower  Obis = "1:1.4.0"  // Wirkleistung (W)
	ExportPower  Obis = "1:2.4.0"  // Wirkleistung (W)
	ImportEnergy Obis = "1:1.8.0"  // Wirkarbeit (Ws) +
	ExportEnergy Obis = "1:2.8.0"  // Wirkarbeit (Ws) −
	CurrentL1    Obis = "1:31.4.0" // Strom (A)
	CurrentL2    Obis = "1:51.4.0" // Strom (A)
	CurrentL3    Obis = "1:71.4.0" // Strom (A)
)

obis code definitions

type Telegram

type Telegram struct {
	Addr   string
	Serial string
	Values map[Obis]float64
}

Telegram defines the data structure of a SMA multicast data package

Jump to

Keyboard shortcuts

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