Skip to content

Commit

Permalink
Add support for KOSTAL Smart Energy Meter (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
kartenkarsten authored and andig committed Jan 2, 2020
1 parent f792d6d commit 8090e70
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ manuals for definitive guidance):
| SBC ALE3 | 3 | + | + | + | + | + | + | - | - |
| ABB A/B-Series | 3 | + | + | + | + | + | + | + | + |
| BE MPM3MP | 3 | + | + | + | + | + | + | - | - |
| KOSTAL Smart Energy Meter | 3 | + | + | + | + | + | + | + | - |

- **SDM120**: Cheap and small (1TE), but communication parameters can only be set over MODBUS, which is currently not supported by this project.
You can use e.g. [SDM120C](https://github.com/gianfrdp/SDM120C) to change parameters.
Expand All @@ -261,6 +262,7 @@ this as the meter ID.
- **SBC ALE3**: This compact Saia Burgess Controls meter is comparable to the SDM630.
It has two tariffs, both import and export depending on meter version and compact (4TE). It's often used with Viessmann heat pumps.
- **BE MPM3PM**: Compact (4TE) three phase meter.
- **KOSTAL Smart Energy Meter**: Import Export of total apparent energy is currently not implemented.

## Modbus TCP Grid Inverters

Expand Down
105 changes: 105 additions & 0 deletions meters/sunspec/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/andig/gosunspec/models/model101"
"github.com/andig/gosunspec/models/model103"
"github.com/andig/gosunspec/models/model124"
"github.com/andig/gosunspec/models/model203"

"github.com/volkszaehler/mbmd/meters"
)
Expand Down Expand Up @@ -45,6 +46,81 @@ var modelPoints = map[int][]string{
model103.DCW,
model103.TmpCab,
},
// wye-connect three phase (abcn) meter
model203.ModelID: {
model203.A,
//model203.A_SF,
model203.AphA,
model203.AphB,
model203.AphC,
//model203.Evt,
model203.Hz,
//model203.Hz_SF,
model203.PF,
//model203.PF_SF,
model203.PFphA,
model203.PFphB,
model203.PFphC,
//model203.PPV,
model203.PhV,
model203.PhVphA,
//model203.PhVphAB,
model203.PhVphB,
//model203.PhVphBC,
model203.PhVphC,
//model203.PhVphCA,
//model203.TotVAhExp,
//model203.TotVAhExpPhA,
//model203.TotVAhExpPhB,
//model203.TotVAhExpPhC,
//model203.TotVAhImp,
//model203.TotVAhImpPhA,
//model203.TotVAhImpPhB,
//model203.TotVAhImpPhC,
//model203.TotVAh_SF,
//model203.TotVArhExpQ3,
//model203.TotVArhExpQ3PhA,
//model203.TotVArhExpQ3PhB,
//model203.TotVArhExpQ3PhC,
//model203.TotVArhExpQ4,
//model203.TotVArhExpQ4PhA,
//model203.TotVArhExpQ4PhB,
//model203.TotVArhExpQ4PhC,
//model203.TotVArhImpQ1,
//model203.TotVArhImpQ1PhA,
//model203.TotVArhImpQ1PhB,
//model203.TotVArhImpQ1PhC,
//model203.TotVArhImpQ2,
//model203.TotVArhImpQ2PhA,
//model203.TotVArhImpQ2PhB,
//model203.TotVArhImpQ2PhC,
//model203.TotVArh_SF,
model203.TotWhExp,
model203.TotWhExpPhA,
model203.TotWhExpPhB,
model203.TotWhExpPhC,
model203.TotWhImp,
model203.TotWhImpPhA,
model203.TotWhImpPhB,
model203.TotWhImpPhC,
//model203.TotWh_SF,
model203.VA,
model203.VAR,
//model203.VAR_SF,
model203.VARphA,
model203.VARphB,
model203.VARphC,
//model203.VA_SF,
model203.VAphA,
model203.VAphB,
model203.VAphC,
//model203.V_SF,
model203.W,
//model203.W_SF,
model203.WphA,
model203.WphB,
model203.WphC,
},
// storage
model124.ModelID: {
model124.ChaState,
Expand All @@ -57,23 +133,52 @@ var opcodeMap = map[string]meters.Measurement{
model103.AphA: meters.CurrentL1,
model103.AphB: meters.CurrentL2,
model103.AphC: meters.CurrentL3,
model203.PhV: meters.Voltage,
model103.PhVphA: meters.VoltageL1,
model103.PhVphB: meters.VoltageL2,
model103.PhVphC: meters.VoltageL3,
model103.Hz: meters.Frequency,
model103.W: meters.Power,
model203.WphA: meters.PowerL1,
model203.WphB: meters.PowerL2,
model203.WphC: meters.PowerL3,
model103.VA: meters.ApparentPower,
model203.VAphA: meters.ApparentPowerL1,
model203.VAphB: meters.ApparentPowerL2,
model203.VAphC: meters.ApparentPowerL3,
model103.VAr: meters.ReactivePower,
model203.VAR: meters.ReactivePower,
model203.VARphA: meters.ReactivePowerL1,
model203.VARphB: meters.ReactivePowerL2,
model203.VARphC: meters.ReactivePowerL3,
model103.PF: meters.Cosphi,
model203.PFphA: meters.CosphiL1,
model203.PFphB: meters.CosphiL2,
model203.PFphC: meters.CosphiL3,
model103.WH: meters.Export,
model103.DCA: meters.DCCurrent,
model103.DCV: meters.DCVoltage,
model103.DCW: meters.DCPower,
model103.TmpCab: meters.HeatSinkTemp,
model124.ChaState: meters.ChargeState,
model124.InBatV: meters.BatteryVoltage,
model203.TotWhImp: meters.Import,
model203.TotWhImpPhA: meters.ImportL1,
model203.TotWhImpPhB: meters.ImportL2,
model203.TotWhImpPhC: meters.ImportL3,
model203.TotWhExp: meters.Export,
model203.TotWhExpPhA: meters.ExportL1,
model203.TotWhExpPhB: meters.ExportL2,
model203.TotWhExpPhC: meters.ExportL3,
}

var dividerMap = map[meters.Measurement]float64{
meters.Export: 1000,
meters.ExportL1: 1000,
meters.ExportL2: 1000,
meters.ExportL3: 1000,
meters.Import: 1000,
meters.ImportL1: 1000,
meters.ImportL2: 1000,
meters.ImportL3: 1000,
}

0 comments on commit 8090e70

Please sign in to comment.