p1_parser v0.2.1 P1.ObisCode

Struct that represents a data (OBIS) line in the telegram

OBiS Codes have the following structure A-B:C.D.E and one our more values in parentheses (v1) where

CodeDescription
Aspecifies the medium 0=abstract, 1=electricity, 6=heat, 7=gas, 8=water
Bspecifies the channel, 0 is the meter itself, higher numbers are modbus connected devices
Cspecifies the physical value (current, voltage, energy, level, temperature, …)
Dspecifies the quantity computation result of specific algorythm
Especifies the measurement type defined by groups A to D into individual measurements (e.g. switching ranges)​

The values consists of parentheses around for instance timestamps, integers, hexadecimal encoded texts and measurements with units (where a * separates value and unit)

iex> P1.parse!("1-0:2.7.0(01.869*kW)") |> P1.ObisCode.construct
%P1.ObisCode{
  channel: %P1.Channel{channel: 0, medium: :electricity},
  tags: %P1.Tags{tags: [power: :active, phase: :all, direction: :produce]},
  values: [%P1.Value{unit: "kW", value: 1.869}]
}    ```

Link to this section Summary

Link to this section Functions

Link to this function construct(list)