SDM630 Meter reading MODBUS via Binding

Tags: #<Tag:0x00007f2fc0832150>

Hi,
i’m having a SDM630 Modbus electric meter…a famous one and i guess some in the openhab community will work with it. Up to now i used a Python script that does the work and RESTs in the values to openhab.

I guess MODBUS binding does the same job way better. But i have no clue about the configuration, could not find any site/threat where this has been discussed.

Can someone give me some hits/advices/configs how i can bring in this SDM630. Thanks a lot! Norbert

Start here: https://www.openhab.org/addons/bindings/modbus/

Thanks Rich, i know the binding man page but this does not help if you see all these settings and things you can do wrong in terms of variants you can play. my hope is that someone has a successful installation running…and can tell me the settings required to make this a less painful transition from python script to modbus binding… Cheers, Norbert

I’m not sure if this is still of interest, but I found this thread while looking for a ready-to-use solution some weeks ago. Now I have a working setup, which I’d like to share:

.things file:

Bridge modbus:serial:sdm630_basis [port="/dev/ttyUSB0", id=1, baud=9600, stopBits="1.0", parity="none", dataBits=8, encoding="rtu"]
{
    Bridge poller BasisWerte [start=0, length=36, type="input", refresh=5000] {
        Thing data sdm_L1_volt        [readStart="0", readValueType="float32" ]
        Thing data sdm_L2_volt        [readStart="2", readValueType="float32" ]
        Thing data sdm_L3_volt        [readStart="4", readValueType="float32" ]
        Thing data sdm_L1_amp         [readStart="6", readValueType="float32" ]
        Thing data sdm_L2_amp         [readStart="8", readValueType="float32" ]
        Thing data sdm_L3_amp         [readStart="10", readValueType="float32" ]
        Thing data sdm_L1_power       [readStart="12", readValueType="float32" ]
        Thing data sdm_L2_power       [readStart="14", readValueType="float32" ]
        Thing data sdm_L3_power       [readStart="16", readValueType="float32" ]
        Thing data sdm_L1_va          [readStart="18", readValueType="float32" ]
        Thing data sdm_L2_va          [readStart="20", readValueType="float32" ]
        Thing data sdm_L3_va          [readStart="22", readValueType="float32" ]
        Thing data sdm_L1_var         [readStart="24", readValueType="float32" ]
        Thing data sdm_L2_var         [readStart="26", readValueType="float32" ]
        Thing data sdm_L3_var         [readStart="28", readValueType="float32" ]
        Thing data sdm_L1_powerfactor [readStart="30", readValueType="float32" ]
        Thing data sdm_L2_powerfactor [readStart="32", readValueType="float32" ]
        Thing data sdm_L3_powerfactor [readStart="34", readValueType="float32" ]        
    }    
}
Bridge modbus:serial:sdm630_frequenz [port="/dev/ttyUSB0", id=1, baud=9600, stopBits="1.0", parity="none", dataBits=8, encoding="rtu"]
{
    Bridge poller Frequenz [start=70, length=2, type="input", refresh=5000] {
        Thing data sdm_frequency       [readStart="70", readValueType="float32" ]      
    }    
}

Bridge modbus:serial:sdm630_SystemPower [port="/dev/ttyUSB0", id=1, baud=9600, stopBits="1.0", parity="none", dataBits=8, encoding="rtu"]
{
    Bridge poller SystemPower [start=52, length=2, type="input", refresh=5000] {
        Thing data sdm_systemPower       [readStart="52", readValueType="float32" ]      
    }    
}

Bridge modbus:serial:sdm630_kWh [port="/dev/ttyUSB0", id=1, baud=9600, stopBits="1.0", parity="none", dataBits=8, encoding="rtu"]
{
    Bridge poller kWh [start=342, length=22, type="input", refresh=5000] {
        Thing data sdm_kwh_Totalkwh       [readStart="342", readValueType="float32" ]      
        Thing data sdm_kwh_Totalkvarh     [readStart="344", readValueType="float32" ]      
        Thing data sdm_kwh_L1_import_kWh  [readStart="346", readValueType="float32" ]      
        Thing data sdm_kwh_L2_import_kWh  [readStart="348", readValueType="float32" ]      
        Thing data sdm_kwh_L3_import_kWh  [readStart="350", readValueType="float32" ]
        Thing data sdm_kwh_L1_export_kWh  [readStart="352", readValueType="float32" ]      
        Thing data sdm_kwh_L2_export_kWh  [readStart="354", readValueType="float32" ]      
        Thing data sdm_kwh_L3_export_kWh  [readStart="356", readValueType="float32" ]
        Thing data sdm_kwh_L1_total_kWh   [readStart="358", readValueType="float32" ]      
        Thing data sdm_kwh_L2_total_kWh   [readStart="360", readValueType="float32" ]      
        Thing data sdm_kwh_L3_total_kWh   [readStart="362", readValueType="float32" ]        
        
    }    
}

.items file:

Group gModbus "Modbus Geräte"
Group gStromverbrauch "Stromverbrauch"
Group gElektrischeLeistung "elektr. Leistung"
Group gPhaseL1
Group gPhaseL2
Group gPhaseL3

Number SDM_L1_Spannung "Spannung L1 [%.2f V]" <energy> (gModbus, gPhaseL1) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L1_volt:number"}
Number SDM_L2_Spannung "Spannung L2 [%.2f V]" <energy> (gModbus, gPhaseL2) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L2_volt:number"}
Number SDM_L3_Spannung "Spannung L3 [%.2f V]" <energy> (gModbus, gPhaseL3) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L3_volt:number"}

Number SDM_L1_Strom "Strom L1 [%.2f A]" <energy> (gModbus, gPhaseL1) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L1_amp:number"}
Number SDM_L2_Strom "Strom L2 [%.2f A]" <energy> (gModbus, gPhaseL2) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L2_amp:number"}
Number SDM_L3_Strom "Strom L3 [%.2f A]" <energy> (gModbus, gPhaseL3) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L3_amp:number"}

Number SDM_L1_Leistung "Leistung L1 [%.2f W]" <energy> (gModbus, gPhaseL1, gElektrischeLeistung) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L1_power:number"}
Number SDM_L2_Leistung "Leistung L2 [%.2f W]" <energy> (gModbus, gPhaseL2, gElektrischeLeistung) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L2_power:number"}
Number SDM_L3_Leistung "Leistung L3 [%.2f W]" <energy> (gModbus, gPhaseL3, gElektrischeLeistung) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L3_power:number"}

Number SDM_L1_Scheinleistung "Scheinleistung L1 [%.2f VA]" <energy> (gModbus, gPhaseL1) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L1_va:number"}
Number SDM_L2_Scheinleistung "Scheinleistung L2 [%.2f VA]" <energy> (gModbus, gPhaseL2) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L2_va:number"}
Number SDM_L3_Scheinleistung "Scheinleistung L3 [%.2f VA]" <energy> (gModbus, gPhaseL3) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L3_va:number"}

Number SDM_L1_Blindleistung "Blindleistung L1 [%.2f VAr]" <energy> (gModbus, gPhaseL1) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L1_var:number"}
Number SDM_L2_Blindleistung "Blindleistung L2 [%.2f VAr]" <energy> (gModbus, gPhaseL2) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L2_var:number"}
Number SDM_L3_Blindleistung "Blindleistung L3 [%.2f VAr]" <energy> (gModbus, gPhaseL3) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L3_var:number"}

Number SDM_L1_Leistungsfaktor "Leistungsfaktor L1 [%.2f]" <energy> (gModbus, gPhaseL1) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L1_powerfactor:number"}
Number SDM_L2_Leistungsfaktor "Leistungsfaktor L2 [%.2f]" <energy> (gModbus, gPhaseL2) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L2_powerfactor:number"}
Number SDM_L3_Leistungsfaktor "Leistungsfaktor L3 [%.2f]" <energy> (gModbus, gPhaseL3) {channel="modbus:data:sdm630_basis:BasisWerte:sdm_L3_powerfactor:number"}

Number SDM_SystemPower "SystemPower [%.2f W]" <energy> (gModbus, gElektrischeLeistung, gElektrizitaet) {channel="modbus:data:sdm630_SystemPower:SystemPower:sdm_systemPower:number"}
Number SDM_Frequenz "Frequenz [%.2f Hz]" <energy> (gModbus, gElektrizitaet) {channel="modbus:data:sdm630_frequenz:Frequenz:sdm_frequency:number"}

Number SDM_kwh_Totalkwh       "Gesamt Verbrauch kWh [%.2f kWh]" <energy> (gModbus, gStromverbrauch, gElektrizitaet) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_Totalkwh:number"}
Number SDM_kwh_Totalkvarh     "Gesamt kVArh [%.2f kVArh]" <energy> (gModbus) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_Totalkvarh:number"}   
Number SDM_kwh_L1_import_kWh  "L1 Import [%.2f kWh]" <energy> (gModbus, gPhaseL1, gStromverbrauch) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L1_import_kWh:number"}   
Number SDM_kwh_L2_import_kWh  "L2 Import [%.2f kWh]" <energy> (gModbus, gPhaseL2, gStromverbrauch) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L2_import_kWh:number"}     
Number SDM_kwh_L3_import_kWh  "L3 Import [%.2f kWh]" <energy> (gModbus, gPhaseL3, gStromverbrauch) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L3_import_kWh:number"}
Number SDM_kwh_L1_export_kWh  "L1 Export [%.2f kWh]" <energy> (gModbus, gPhaseL1) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L1_export_kWh:number"}  
Number SDM_kwh_L2_export_kWh  "L2 Export [%.2f kWh]" <energy> (gModbus, gPhaseL2) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L2_export:number"}
Number SDM_kwh_L3_export_kWh  "L3 Export [%.2f kWh]" <energy> (gModbus, gPhaseL3) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L2_export:number"}
Number SDM_kwh_L1_total_kWh   "L1 Gesamt [%.2f kWh]" <energy> (gModbus, gPhaseL1) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L1_total_kWh:number"}
Number SDM_kwh_L2_total_kWh   "L2 Gesamt [%.2f kWh]" <energy> (gModbus, gPhaseL2) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L2_total_kWh:number"}
Number SDM_kwh_L3_total_kWh   "L3 Gesamt [%.2f kWh]" <energy> (gModbus, gPhaseL3) {channel="modbus:data:sdm630_kWh:kWh:sdm_kwh_L3_total_kWh:number"}