package module
v1.0.0 Latest Latest

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

Go to latest
Published: Jan 24, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0



Go package to connect to and parse the data send by P1 Smart Meters used in the Netherlands.

Also included:

  1. dsmrp1d a daemon that connects to the smart meter and makes the latest data available via a simple JSON web service.
  2. dsmrp1-munin a munin plugin that connects to dsmrp1d




This section is empty.


This section is empty.


This section is empty.


type ElectricityData

type ElectricityData struct {
	KWh       float32 `obis:"1-0:1.8.2" type:"unit"`
	KWhLow    float32 `obis:"1-0:1.8.1" type:"unit"`
	KWhOut    float32 `obis:"1-0:2.8.2" type:"unit"`
	KWhOutLow float32 `obis:"1-0:2.8.1" type:"unit"`
	Tariff    Tariff  `obis:"0-0:96.14.0" type:"int"`

	W         float32  `obis:"1-0:1.7.0" type:"unit"`
	WOut      float32  `obis:"1-0:2.7.0" type:"unit"`
	Threshold *float32 `obis:"0-0:17.0.0" type:"unit"`
	Switch    *string  `obis:"0-0:96.3.10" type:"id"`

	PowerFailures     int32  `obis:"0-0:96.7.21" type:"int"`
	LongPowerFailures int32  `obis:"0-0:96.7.9" type:"int"`
	PowerFailuresLog  string `obis:"1-0:99.97.0" type:"log"`

	L1VoltageSags   int32    `obis:"1-0:32.32.0" type:"int"`
	L1VoltageSwells int32    `obis:"1-0:32.36.0" type:"int"`
	L1Current       float32  `obis:"1-0:31.7.0" type:"unit"`
	L1Voltage       *float32 `obis:"1-0:32.7.0" type:"unit"`
	L1Power         float32  `obis:"1-0:21.7.0" type:"unit"`
	L1PowerOut      float32  `obis:"1-0:22.7.0" type:"unit"`

type GasData

type GasData struct {
	Type       string    `obis:"0-1:24.1.0" type:"id"`
	Id         string    `obis:"0-1:96.1.0" type:"id"`
	Switch     *string   `obis:"0-1:24.4.0" type:"id"`
	LastRecord GasRecord `obis:"0-1:24.2.1" type:"gasrecord"`

type GasRecord

type GasRecord struct {
	TimeStamp string
	Value     float32

type Meter

type Meter struct {
	C chan *Telegram
	// contains filtered or unexported fields

func NewMeter

func NewMeter(serialDev string) (*Meter, error)

type MultiphaseElectricityData

type MultiphaseElectricityData struct {
	L2VoltageSags   int32    `obis:"1-0:52.32.0" type:"int"`
	L2VoltageSwells int32    `obis:"1-0:52.36.0" type:"int"`
	L2Current       float32  `obis:"1-0:51.7.0" type:"unit"`
	L2Voltage       *float32 `obis:"1-0:52.7.0" type:"unit"`
	L2Power         float32  `obis:"1-0:41.7.0" type:"unit"`
	L2PowerOut      float32  `obis:"1-0:42.7.0" type:"unit"`
	L3VoltageSags   int32    `obis:"1-0:72.32.0" type:"int"`
	L3VoltageSwells int32    `obis:"1-0:72.36.0" type:"int"`
	L3Current       float32  `obis:"1-0:71.7.0" type:"unit"`
	L3Voltage       *float32 `obis:"1-0:72.7.0" type:"unit"`
	L3Power         float32  `obis:"1-0:61.7.0" type:"unit"`
	L3PowerOut      float32  `obis:"1-0:62.7.0" type:"unit"`

type Tariff

type Tariff int32
const (
	TariffHigh Tariff = 1
	TariffLow         = 2

type Telegram

type Telegram struct {
	HeaderMarker string
	HeaderId     string

	Electricity           *ElectricityData
	MultiphaseElectricity *MultiphaseElectricityData
	Gas                   *GasData

	P1Version string `obis:"1-3:0.2.8" type:"id"`
	TimeStamp string `obis:"0-0:1.0.0" type:"id"`
	ID        string `obis:"0-0:96.1.1" type:"id"`

	MsgNumeric *string `obis:"0-0:96.13.1" type:"id"`
	MsgTxt     *string `obis:"0-0:96.13.0" type:"id"`

	Other map[string][]string


Path Synopsis

Jump to

Keyboard shortcuts

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