dsmr

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: BSD-3-Clause Imports: 4 Imported by: 14

Documentation

Overview

Package dsmr implements DSMR P1 frame reading.

The DSMR 4 specification can be found at: http://www.netbeheernederland.nl/

A frame is formatted as:

/ X X X 5 Identification CR LF CR LF Data ! CRC CR LF

Index

Constants

View Source
const DateTimeFormat = "060102150405"

DateTimeFormat used in a frame, YYMMDDhhmmssX localtime with last as S/W for Summer/Winter

Variables

This section is empty.

Functions

This section is empty.

Types

type DataObject

type DataObject struct {
	ID    string
	Value string
	Unit  string
}

DataObject represents a line in the DSMR frame.

func ParseObject

func ParseObject(line string) (DataObject, error)

ParseObject returns a object for a given line in a frame.

func (DataObject) String

func (do DataObject) String() string

type Frame

type Frame struct {
	Header      string
	Version     string
	EquipmentID string
	Timestamp   time.Time

	Objects map[string]DataObject
}

Frame represents a DSMR4 frame as send from a P1 port.

func ParseFrame

func ParseFrame(frame string) (f Frame, err error)

ParseFrame returns a frame from the text respresentation.

Directories

Path Synopsis
Package prometheus implements a collector of DSMR metrics for Prometheus.
Package prometheus implements a collector of DSMR metrics for Prometheus.

Jump to

Keyboard shortcuts

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