Autor Thema: KOSTAL Smart Energy Meter auslesen  (Gelesen 923 mal)

Offline ch.eick

  • Sr. Member
  • ****
  • Beiträge: 728
Antw:KOSTAL Smart Energy Meter auslesen
« Antwort #30 am: 07 April 2020, 15:56:37 »
Hallo zusammen,

ich habe die Modbus Definitionen nochmal ueberarbeitet und mit "dev-type" aufgeraeumt. Auch der Scale Faktor ist jetzt mit drin.

Ein Fehler besteht noch beim Gesamtstrom, jedoch finde ich nicht die Abweichung in der Definition. Laut Kostal Dokumentation ist der Wert identisch zu den anderen Stromwerten definiert, jedoch ist die angezeigte Zahl nicht korrekt.
attr PV_KSEM obj-h40071-reading M_AC_Current
attr PV_KSEM obj-h40071-type INT16_Current

EDIT:
Mit folgenden Werten gibt es da auch ein Problem. In der Doku steht bei allen "0x8000"als Value Range.
Hier sollte die Summe der Stroeme 2.87+5.63+5.11 stehen
M_AC_Current 327.68

Hier musste eigentlich ca 380 Volt stehen
M_AC_Voltage_AB 327.68
M_AC_Voltage_BC 327.68
M_AC_Voltage_CA 327.68
M_AC_Voltage_LL 327.68
M_AC_Voltage_LN 327.68
Im SolarEdge Modul habe ich auch keinen weiteren Hinweis gefunden :-)
Da ist sicher das unpack falsch.


defmod PV_KSEM ModbusAttr 1 60 192.168.178.17:502 TCP

attr PV_KSEM DbLogExclude .*
attr PV_KSEM alias PV_Energy_Manager
attr PV_KSEM comment Kostal KSEM (EM410) Energy Manager

attr PV_KSEM dev-h-defPoll 1

attr PV_KSEM dev-type-INT16-len 1
attr PV_KSEM dev-type-INT16-unpack s>

attr PV_KSEM dev-type-INT16_Current-expr $val * (10 ** ReadingsNum("$name" ,"M_AC_Current_SF",0))
attr PV_KSEM dev-type-INT16_Current-format %.2f
attr PV_KSEM dev-type-INT16_Current-len 1
attr PV_KSEM dev-type-INT16_Current-unpack n

attr PV_KSEM dev-type-INT16_Freq-expr $val * (10 ** ReadingsNum("$name" ,"M_AC_Freq_SF",0))
attr PV_KSEM dev-type-INT16_Freq-format %.2f
attr PV_KSEM dev-type-INT16_Freq-len 1
attr PV_KSEM dev-type-INT16_Freq-unpack s>

attr PV_KSEM dev-type-INT16_PF-expr $val * (10 ** ReadingsNum("$name" ,"M_AC_PF_SF",0))
attr PV_KSEM dev-type-INT16_PF-format %.2f
attr PV_KSEM dev-type-INT16_PF-len 1
attr PV_KSEM dev-type-INT16_PF-unpack s>

attr PV_KSEM dev-type-INT16_Power-expr $val * (10 ** ReadingsNum("$name" ,"M_AC_Power_SF",0))
attr PV_KSEM dev-type-INT16_Power-format %.2f
attr PV_KSEM dev-type-INT16_Power-len 1
attr PV_KSEM dev-type-INT16_Power-unpack s>

attr PV_KSEM dev-type-INT16_VA-expr $val * (10 ** ReadingsNum("$name" ,"M_AC_VA_SF",0))
attr PV_KSEM dev-type-INT16_VA-format %.2f
attr PV_KSEM dev-type-INT16_VA-len 1
attr PV_KSEM dev-type-INT16_VA-unpack s>

attr PV_KSEM dev-type-INT16_VAR-expr $val * (10 ** ReadingsNum("$name" ,"M_AC_VAR_SF",0))
attr PV_KSEM dev-type-INT16_VAR-format %.2f
attr PV_KSEM dev-type-INT16_VAR-len 1
attr PV_KSEM dev-type-INT16_VAR-unpack s>

attr PV_KSEM dev-type-INT16_Voltage-expr $val * (10 ** ReadingsNum("$name" ,"M_AC_Voltage_SF",0))
attr PV_KSEM dev-type-INT16_Voltage-format %.2f
attr PV_KSEM dev-type-INT16_Voltage-len 1
attr PV_KSEM dev-type-INT16_Voltage-unpack n

attr PV_KSEM dev-type-STR32-expr $val =~ s/[\00]+//gr
attr PV_KSEM dev-type-STR32-format %s
attr PV_KSEM dev-type-STR32-len 16
attr PV_KSEM dev-type-STR32-unpack a*

attr PV_KSEM dev-type-UINT16-format %s
attr PV_KSEM dev-type-UINT16-len 1

attr PV_KSEM obj-h40071-reading M_AC_Current
attr PV_KSEM obj-h40071-type INT16_Current
attr PV_KSEM obj-h40072-reading M_AC_Current_A
attr PV_KSEM obj-h40072-type INT16_Current
attr PV_KSEM obj-h40073-reading M_AC_Current_B
attr PV_KSEM obj-h40073-type INT16_Current
attr PV_KSEM obj-h40074-reading M_AC_Current_C
attr PV_KSEM obj-h40074-type INT16_Current
attr PV_KSEM obj-h40075-reading M_AC_Current_SF
attr PV_KSEM obj-h40075-type INT16

attr PV_KSEM obj-h40076-reading M_AC_Voltage_LN
attr PV_KSEM obj-h40076-type INT16_Voltage
attr PV_KSEM obj-h40077-reading M_AC_Voltage_AN
attr PV_KSEM obj-h40077-type INT16_Voltage
attr PV_KSEM obj-h40078-reading M_AC_Voltage_BN
attr PV_KSEM obj-h40078-type INT16_Voltage
attr PV_KSEM obj-h40079-reading M_AC_Voltage_CN
attr PV_KSEM obj-h40079-type INT16_Voltage
attr PV_KSEM obj-h40080-reading M_AC_Voltage_LL
attr PV_KSEM obj-h40080-type INT16_Voltage
attr PV_KSEM obj-h40081-reading M_AC_Voltage_AB
attr PV_KSEM obj-h40081-type INT16_Voltage
attr PV_KSEM obj-h40082-reading M_AC_Voltage_BC
attr PV_KSEM obj-h40082-type INT16_Voltage
attr PV_KSEM obj-h40083-reading M_AC_Voltage_CA
attr PV_KSEM obj-h40083-type INT16_Voltage
attr PV_KSEM obj-h40084-reading M_AC_Voltage_SF
attr PV_KSEM obj-h40084-type INT16

attr PV_KSEM obj-h40085-reading M_AC_Freq
attr PV_KSEM obj-h40085-type INT16_Freq
attr PV_KSEM obj-h40086-reading M_AC_Freq_SF
attr PV_KSEM obj-h40086-type INT16

attr PV_KSEM obj-h40087-reading M_AC_Power
attr PV_KSEM obj-h40087-type INT16_Power
attr PV_KSEM obj-h40088-reading M_AC_Power_A
attr PV_KSEM obj-h40088-type INT16_Power
attr PV_KSEM obj-h40089-reading M_AC_Power_B
attr PV_KSEM obj-h40089-type INT16_Power
attr PV_KSEM obj-h40090-reading M_AC_Power_C
attr PV_KSEM obj-h40090-type INT16_Power
attr PV_KSEM obj-h40091-reading M_AC_Power_SF
attr PV_KSEM obj-h40091-type INT16

attr PV_KSEM obj-h40092-reading M_AC_VA
attr PV_KSEM obj-h40092-type INT16_VA
attr PV_KSEM obj-h40093-reading M_AC_VA_A
attr PV_KSEM obj-h40093-type INT16_VA
attr PV_KSEM obj-h40094-reading M_AC_VA_B
attr PV_KSEM obj-h40094-type INT16_VA
attr PV_KSEM obj-h40095-reading M_AC_VA_C
attr PV_KSEM obj-h40095-type INT16_VA
attr PV_KSEM obj-h40096-reading M_AC_VA_SF
attr PV_KSEM obj-h40096-type INT16

attr PV_KSEM obj-h40097-reading M_AC_VAR
attr PV_KSEM obj-h40097-type INT16_VAR
attr PV_KSEM obj-h40098-reading M_AC_VAR_A
attr PV_KSEM obj-h40098-type INT16_VAR
attr PV_KSEM obj-h40099-reading M_AC_VAR_B
attr PV_KSEM obj-h40099-type INT16_VAR
attr PV_KSEM obj-h40100-reading M_AC_VAR_C
attr PV_KSEM obj-h40100-type INT16_VAR
attr PV_KSEM obj-h40101-reading M_AC_VAR_SF
attr PV_KSEM obj-h40101-type INT16

attr PV_KSEM obj-h40102-reading M_AC_PF
attr PV_KSEM obj-h40102-type INT16_PF
attr PV_KSEM obj-h40103-reading M_AC_PF_A
attr PV_KSEM obj-h40103-type INT16_PF
attr PV_KSEM obj-h40104-reading M_AC_PF_B
attr PV_KSEM obj-h40104-type INT16_PF
attr PV_KSEM obj-h40105-reading M_AC_PF_C
attr PV_KSEM obj-h40105-type INT16_PF
attr PV_KSEM obj-h40106-reading M_AC_PF_SF
attr PV_KSEM obj-h40106-type INT16

attr PV_KSEM obj-h8192-reading ManufacturerID
attr PV_KSEM obj-h8192-type UINT16
attr PV_KSEM obj-h8193-reading ProductID
attr PV_KSEM obj-h8193-type UINT16
attr PV_KSEM obj-h8194-reading ProductVersion
attr PV_KSEM obj-h8194-type UINT16
attr PV_KSEM obj-h8195-reading FirmwareVersion
attr PV_KSEM obj-h8195-type UINT16

attr PV_KSEM obj-h8196-reading VendorName
attr PV_KSEM obj-h8196-type STR32
attr PV_KSEM obj-h8212-reading Productname
attr PV_KSEM obj-h8212-type STR32
attr PV_KSEM obj-h8228-reading SerialNumber
attr PV_KSEM obj-h8228-type STR32

attr PV_KSEM obj-h8244-reading MeasuringInterval
attr PV_KSEM obj-h8244-type UINT16

attr PV_KSEM group PV Eigenverbrauch
attr PV_KSEM icon measure_power
attr PV_KSEM room Strom->Photovoltaik
attr PV_KSEM sortby 02
attr PV_KSEM verbose 0
« Letzte Änderung: 07 April 2020, 16:36:36 von ch.eick »
RPI4; Docker; CUNX; Eltako FSB61NP; 230V zentral verschaltet; SamsungTV H-Serie; DLNARenderer; TV.pl;  Sonos; Vallox; Luxtronik; 2x FB7490; Stromzähler mit DvLIR; wunderground; clever-tanken; Plenticore 10 mit BYD; EM410; SMAEM; Modbus TCP

Offline ch.eick

  • Sr. Member
  • ****
  • Beiträge: 728
Antw:KOSTAL Smart Energy Meter auslesen
« Antwort #31 am: 07 April 2020, 17:15:41 »
Hallo nochmal.

der Code vom "SolarEdge" Modul ist uebrigens aus dem ModbusAttr Moduld mit "set saveAsModule" generiert und dann spaeter veraendert worden.
Das bedeutet, wenn wir hier mit dem Ursprungsmodul "ModbusAttr" die Definitionen korrekt setzen, koennen wir spaeter einen Export durchfuehren und
haben den Beginn eines eigenen Kostal Moduls ;-)

Gruss
    Christian
« Letzte Änderung: 07 April 2020, 18:56:56 von ch.eick »
RPI4; Docker; CUNX; Eltako FSB61NP; 230V zentral verschaltet; SamsungTV H-Serie; DLNARenderer; TV.pl;  Sonos; Vallox; Luxtronik; 2x FB7490; Stromzähler mit DvLIR; wunderground; clever-tanken; Plenticore 10 mit BYD; EM410; SMAEM; Modbus TCP