Neue Versionen und Support zum Modbus-Modul

Begonnen von StefanStrobel, 20 August 2017, 12:11:08

Vorheriges Thema - Nächstes Thema

holle75

Zitat von: holle75 am 21 September 2023, 16:41:02Ich dachte ":" und "," sind die einzigen Delimiter die ausgewertet werden?

Man sollte auf sich selber hören. Im mapping waren im Text "," versteckt. Test läuft. Entschuldigung wahrscheinlich eure Lese-Zeit unnötig geklaut zu haben.

300P

Hallo an die Modbus-User,

ich bin auf der Suche nach einer speziellen Routine und hoffe mir kann jemand dabei helfen sie zu finden oder zu erstellen:

Die Routine soll für einen SMA (SunnyBoyStorage) SBS25 die "richtigen" Register im "richtigen Format" zum zyklischen Beschreiben (ca. 15 Sekunden) setzen, um dadurch eine Be-Ladung des angeschlossenen Speichers zu erwirken. (zur evtl. Nutzung der dynamischen Tarife von Timber/Awatar&Co.)

Mittels ModbusAttr-Modul lese ich bereits diverse passenden Register des SBS25 bereits aus, aber für das beschreiben (der zuständigen WO-Register) mittels Routine fehlt mir die Erfahrung (und auch der Mut es einfach "so mal zu schreiben/machen").
Zum reinen experimentieren ist mir nun doch das mit meinen HV-Akkus und der WR einfach zu kostspielig wenn ich dort "etwas vergeige".

Hier mein aktuell genutztes Modul das soweit erst einmal alles liest:

defmod MB_SBS25 ModbusAttr 3  5   192.168.121.176:502  TCP
attr MB_SBS25 dev-h-defLen 2
attr MB_SBS25 dev-h-defPoll 1
attr MB_SBS25 dev-h-defUnpack N
attr MB_SBS25 dev-type-S16F0-expr $val/1
attr MB_SBS25 dev-type-S16F0-format %.0f
attr MB_SBS25 dev-type-S16F0-len 1
attr MB_SBS25 dev-type-S16F0-unpack N
attr MB_SBS25 dev-type-S16F1-expr $val/1
attr MB_SBS25 dev-type-S16F1-format %.1f
attr MB_SBS25 dev-type-S16F1-len 1
attr MB_SBS25 dev-type-S16F1-unpack N
attr MB_SBS25 dev-type-S16F2-expr $val/1
attr MB_SBS25 dev-type-S16F2-format %.2f
attr MB_SBS25 dev-type-S16F2-len 1
attr MB_SBS25 dev-type-S16F2-unpack N
attr MB_SBS25 dev-type-S32-format %d
attr MB_SBS25 dev-type-S32-len 2
attr MB_SBS25 dev-type-S32-unpack l>
attr MB_SBS25 dev-type-S32F0-expr $val
attr MB_SBS25 dev-type-S32F0-format %.0f
attr MB_SBS25 dev-type-S32F0-len 2
attr MB_SBS25 dev-type-S32F0-unpack i>
attr MB_SBS25 dev-type-S32F1-expr $val
attr MB_SBS25 dev-type-S32F1-format %.1f
attr MB_SBS25 dev-type-S32F1-len 2
attr MB_SBS25 dev-type-S32F1-revRegs 1
attr MB_SBS25 dev-type-S32F1-unpack i>
attr MB_SBS25 dev-type-S32F2-expr $val
attr MB_SBS25 dev-type-S32F2-format %.2f
attr MB_SBS25 dev-type-S32F2-len 2
attr MB_SBS25 dev-type-S32F2-revRegs 1
attr MB_SBS25 dev-type-S32F2-unpack i>
attr MB_SBS25 dev-type-S32F3-expr $val
attr MB_SBS25 dev-type-S32F3-format %.3f
attr MB_SBS25 dev-type-S32F3-len 2
attr MB_SBS25 dev-type-S32F3-unpack i>
attr MB_SBS25 dev-type-S32F4-expr $val
attr MB_SBS25 dev-type-S32F4-format %.4f
attr MB_SBS25 dev-type-S32F4-len 2
attr MB_SBS25 dev-type-S32F4-revRegs 1
attr MB_SBS25 dev-type-S32F4-unpack i>
attr MB_SBS25 dev-type-S32TEMP-expr ($val & 0xFFFF) / 10
attr MB_SBS25 dev-type-S32TEMP-format %.2f
attr MB_SBS25 dev-type-S32TEMP-len 2
attr MB_SBS25 dev-type-S32TEMP-unpack l>
attr MB_SBS25 dev-type-U32-format %u
attr MB_SBS25 dev-type-U32-len 2
attr MB_SBS25 dev-type-U32-unpack I
attr MB_SBS25 dev-type-U32F0-format %.0f
attr MB_SBS25 dev-type-U32F0-len 2
attr MB_SBS25 dev-type-U32F0-unpack N
attr MB_SBS25 dev-type-U32F1-format %.1f
attr MB_SBS25 dev-type-U32F1-len 2
attr MB_SBS25 dev-type-U32F1-unpack N
attr MB_SBS25 dev-type-U32F2-format %.2f
attr MB_SBS25 dev-type-U32F2-len 2
attr MB_SBS25 dev-type-U32F2-unpack N
attr MB_SBS25 dev-type-U32F3-format %.3f
attr MB_SBS25 dev-type-U32F3-len 2
attr MB_SBS25 dev-type-U32F3-unpack N
attr MB_SBS25 dev-type-U32F4-format %.4f
attr MB_SBS25 dev-type-U32F4-len 2
attr MB_SBS25 dev-type-U32F4-unpack N
attr MB_SBS25 dev-type-U32RAW-format %d
attr MB_SBS25 dev-type-U32RAW-len 2
attr MB_SBS25 devStateIcon {\
my $mode = 'measure_power@green';;;;\
$mode = 'measure_power@yellow' if (ReadingsVal($name, "Wirkleistung_W", "") < 1);;;;\
\
my $chargePw = ReadingsVal("SBS25", "state", "")*1000;;;;\
\
my $charge = '';;;;\
$charge = 'control_arrow_leftward@greenyellow' if ($chargePw < 0);;;;\
$charge = 'control_arrow_rightward@green' if ($chargePw > 0);;;;\
\
my $ChargeStatus = 'measure_battery_100@green';;;;\
$ChargeStatus = 'measure_battery_75@green' if (ReadingsVal($name, "BatterieLadezustand_%", "") < 80);;;;\
$ChargeStatus = 'measure_battery_50@yellow' if (ReadingsVal($name, "BatterieLadezustand_%", "") < 55);;;;\
$ChargeStatus = 'measure_battery_25@orange' if (ReadingsVal($name, "BatterieLadezustand_%", "") < 30);;;;\
$ChargeStatus = 'measure_battery_0@red' if (ReadingsVal($name, "BatterieLadezustand_%", "") < 6);;;;\
\
my $Cap = (ReadingsVal($name,"BatterieLadezustand_%",0) ) * 98;;\
\
\
"<div>" . \
FW_makeImage($mode,"measure_power") ." AC ". ReadingsVal($name,"Wirkleistung_W",0) ."W  ". \
FW_makeImage($ChargeStatus,"") . \
FW_makeImage($charge,"") ." ". $chargePw ."W   ". \
ReadingsVal($name,"BatterieLadezustand_%",0) ."% ".\
$Cap."wh  ".\
"</div>"}
attr MB_SBS25 event-min-interval .*:600
attr MB_SBS25 event-on-change-reading .*
attr MB_SBS25 obj-h30003-expr $val / 1
attr MB_SBS25 obj-h30003-format %.f
attr MB_SBS25 obj-h30003-len 2
attr MB_SBS25 obj-h30003-name SBS25_Nameplate.SusyId
attr MB_SBS25 obj-h30003-poll once
attr MB_SBS25 obj-h30003-reading TTTNameplate.SusyId
attr MB_SBS25 obj-h30003-type U32RAW
attr MB_SBS25 obj-h30003-unpack N
attr MB_SBS25 obj-h30005-expr $val / 1
attr MB_SBS25 obj-h30005-format %.f
attr MB_SBS25 obj-h30005-len 2
attr MB_SBS25 obj-h30005-name SBS25_Nameplate.SerNum
attr MB_SBS25 obj-h30005-poll once
attr MB_SBS25 obj-h30005-reading TTTNameplate.SerNum
attr MB_SBS25 obj-h30005-type U32RAW
attr MB_SBS25 obj-h30005-unpack N
attr MB_SBS25 obj-h30051-expr $val / 1
attr MB_SBS25 obj-h30051-format %.f
attr MB_SBS25 obj-h30051-len 2
attr MB_SBS25 obj-h30051-name SBS25_Nameplate.MainModel
attr MB_SBS25 obj-h30051-poll once
attr MB_SBS25 obj-h30051-reading TTTNameplate.MainModel
attr MB_SBS25 obj-h30051-unpack N
attr MB_SBS25 obj-h30053-expr $val / 1
attr MB_SBS25 obj-h30053-format %.f
attr MB_SBS25 obj-h30053-len 2
attr MB_SBS25 obj-h30053-name SBS25_Nameplate.Model
attr MB_SBS25 obj-h30053-poll once
attr MB_SBS25 obj-h30053-reading TTTNameplate.Model
attr MB_SBS25 obj-h30053-unpack N
attr MB_SBS25 obj-h30201-map 35:Fehler, 303:Aus, 307:OK, 455:Warnung
attr MB_SBS25 obj-h30201-name SBS25_StatusWR
attr MB_SBS25 obj-h30201-reading StatusWR
attr MB_SBS25 obj-h30211-map 336:Contact manufacturer, 337:Contact installer, 338:invalid, 887:none
attr MB_SBS25 obj-h30211-name SBS25_UserAction
attr MB_SBS25 obj-h30211-polldelay x1
attr MB_SBS25 obj-h30211-reading UserAction
attr MB_SBS25 obj-h30217-map 16777213:Fehler, 51:geschlossen, 311:offen
attr MB_SBS25 obj-h30217-name SBS25_Netzrelais
attr MB_SBS25 obj-h30217-polldelay x1
attr MB_SBS25 obj-h30217-reading Netzrelais
attr MB_SBS25 obj-h30235-expr $val / 1
attr MB_SBS25 obj-h30235-len 2
attr MB_SBS25 obj-h30235-map 1440: Netzbetrieb (ModGri), 1441: Inselnetzbetrieb (ModOffGri), 316777213: Information liegt nicht vor (NaNStt)
attr MB_SBS25 obj-h30235-name SBS25_TTTBatterie_Backup-Modus
attr MB_SBS25 obj-h30235-poll x13
attr MB_SBS25 obj-h30235-polldelay 1
attr MB_SBS25 obj-h30235-reading TTTBatterie_Backup-Modus
attr MB_SBS25 obj-h30235-unpack N
attr MB_SBS25 obj-h30529-format %.f
attr MB_SBS25 obj-h30529-name SBS25_NetzEMEinspeisungGesamt_Wh
attr MB_SBS25 obj-h30529-polldelay x7
attr MB_SBS25 obj-h30529-reading NetzEMEinspeisungGesamt_Wh
attr MB_SBS25 obj-h30529-type U32F0
attr MB_SBS25 obj-h30531-name SBS25_BatterieLadungTag_Wh
attr MB_SBS25 obj-h30531-polldelay x7
attr MB_SBS25 obj-h30531-reading BatterieLadungTag_Wh
attr MB_SBS25 obj-h30531-type U32F0
attr MB_SBS25 obj-h30535-name SBS25_BatterieEnladungTag_Wh
attr MB_SBS25 obj-h30535-polldelay x7
attr MB_SBS25 obj-h30535-reading BatterieEntladungTag_Wh
attr MB_SBS25 obj-h30535-type U32F0
attr MB_SBS25 obj-h30769-expr $val  / 1000
attr MB_SBS25 obj-h30769-format %.3f
attr MB_SBS25 obj-h30769-len 2
attr MB_SBS25 obj-h30769-name SBS25_DC_Strom_1_A
attr MB_SBS25 obj-h30769-poll 0
attr MB_SBS25 obj-h30769-polldelay x4
attr MB_SBS25 obj-h30769-reading DC_Strom_1_A
attr MB_SBS25 obj-h30771-expr $val  / 100
attr MB_SBS25 obj-h30771-format %.2f
attr MB_SBS25 obj-h30771-len 2
attr MB_SBS25 obj-h30771-name SBS25_DC_Spannung_1_V
attr MB_SBS25 obj-h30771-poll 0
attr MB_SBS25 obj-h30771-polldelay x4
attr MB_SBS25 obj-h30771-reading DC_Spannung_1_V
attr MB_SBS25 obj-h30773-name SBS25_DC_Leistung_1_W
attr MB_SBS25 obj-h30773-poll 0
attr MB_SBS25 obj-h30773-reading DC_Leistung_1_W
attr MB_SBS25 obj-h30775-expr $val
attr MB_SBS25 obj-h30775-name SBS25_Wirkleistung_W
attr MB_SBS25 obj-h30775-poll 1
attr MB_SBS25 obj-h30775-polldelay x3
attr MB_SBS25 obj-h30775-reading Wirkleistung_W
attr MB_SBS25 obj-h30775-type S32F0
attr MB_SBS25 obj-h30777-expr $val
attr MB_SBS25 obj-h30777-name SBS25_Wirkleistung_L1_W
attr MB_SBS25 obj-h30777-poll 0
attr MB_SBS25 obj-h30777-polldelay x3
attr MB_SBS25 obj-h30777-reading Wirkleistung_L1_W
attr MB_SBS25 obj-h30777-type S32F0
attr MB_SBS25 obj-h30779-expr $val
attr MB_SBS25 obj-h30779-name SBS25_Wirkleistung_L2_W
attr MB_SBS25 obj-h30779-poll 0
attr MB_SBS25 obj-h30779-polldelay x3
attr MB_SBS25 obj-h30779-reading Wirkleistung_L2_W
attr MB_SBS25 obj-h30779-type S32F0
attr MB_SBS25 obj-h30781-expr $val
attr MB_SBS25 obj-h30781-name SBS25_Wirkleistung_L3_W
attr MB_SBS25 obj-h30781-poll 0
attr MB_SBS25 obj-h30781-polldelay x3
attr MB_SBS25 obj-h30781-reading Wirkleistung_L3_W
attr MB_SBS25 obj-h30781-type S32F0
attr MB_SBS25 obj-h30783-expr $val
attr MB_SBS25 obj-h30783-format %.2f
attr MB_SBS25 obj-h30783-name SBS25_Grid_Spannung_V
attr MB_SBS25 obj-h30783-poll 0
attr MB_SBS25 obj-h30783-polldelay x7
attr MB_SBS25 obj-h30783-reading Grid_Spannung_V
attr MB_SBS25 obj-h30783-type U32F2
attr MB_SBS25 obj-h30843-expr ($val /1000)
attr MB_SBS25 obj-h30843-name BatterieStrom_DC__A
attr MB_SBS25 obj-h30843-poll 1
attr MB_SBS25 obj-h30843-polldelay x1
attr MB_SBS25 obj-h30843-reading BatterieStrom_DC__A
attr MB_SBS25 obj-h30843-type S32F3
attr MB_SBS25 obj-h30845-name SBS25_BatterieLadezustand_%
attr MB_SBS25 obj-h30845-polldelay x5
attr MB_SBS25 obj-h30845-reading BatterieLadezustand_%
attr MB_SBS25 obj-h30845-unpack N
attr MB_SBS25 obj-h30847-name SBS25_BatterieKapazitaetaktuell_%
attr MB_SBS25 obj-h30847-polldelay x5
attr MB_SBS25 obj-h30847-reading BatterieKapazitaetaktuell_%
attr MB_SBS25 obj-h30847-unpack i>
attr MB_SBS25 obj-h30849-name SBS25_BatterieTemperatur_C
attr MB_SBS25 obj-h30849-polldelay x13
attr MB_SBS25 obj-h30849-reading BatterieTemperatur_C
attr MB_SBS25 obj-h30849-type S32TEMP
attr MB_SBS25 obj-h30851-expr ($val  & 0xFFFF) / 100
attr MB_SBS25 obj-h30851-format %.2f
attr MB_SBS25 obj-h30851-name SBS25_BatterieSpannung_V
attr MB_SBS25 obj-h30851-polldelay x7
attr MB_SBS25 obj-h30851-reading BatterieSpannung_V
attr MB_SBS25 obj-h30851-type U32F2
attr MB_SBS25 obj-h30865-format %.2f
attr MB_SBS25 obj-h30865-name SBS25_Grid_Bezug_W
attr MB_SBS25 obj-h30865-poll 1
attr MB_SBS25 obj-h30865-polldelay x3
attr MB_SBS25 obj-h30865-reading Grid_Bezug_W
attr MB_SBS25 obj-h30865-type U32F2
attr MB_SBS25 obj-h30867-format %.2f
attr MB_SBS25 obj-h30867-name SBS25_Grid_Einspeisung_W
attr MB_SBS25 obj-h30867-poll 1
attr MB_SBS25 obj-h30867-polldelay x3
attr MB_SBS25 obj-h30867-reading Grid_Einspeisung_W
attr MB_SBS25 obj-h30867-type U32F2
attr MB_SBS25 obj-h30953-name SBS25_WR_Temperatur_C
attr MB_SBS25 obj-h30953-polldelay x13
attr MB_SBS25 obj-h30953-reading WR_Temperatur_C
attr MB_SBS25 obj-h30953-type S32TEMP
attr MB_SBS25 obj-h30955-map 16777213:Fehler, 303:Aus, 2291:standby, 2292:laden, 2293:entladen
attr MB_SBS25 obj-h30955-name SBS25_BatterieStatus
attr MB_SBS25 obj-h30955-reading BatterieStatus
attr MB_SBS25 obj-h30957-expr ($val  & 0xFFFF) / 1000
attr MB_SBS25 obj-h30957-format %.3f
attr MB_SBS25 obj-h30957-name SBS25_DC_Strom_2_A
attr MB_SBS25 obj-h30957-poll 0
attr MB_SBS25 obj-h30957-reading DC_Strom_2_A
attr MB_SBS25 obj-h30959-expr ($val  & 0xFFFF) / 100
attr MB_SBS25 obj-h30959-format %.2f
attr MB_SBS25 obj-h30959-name SBS25_DC_Spannung_2_V
attr MB_SBS25 obj-h30959-poll 0
attr MB_SBS25 obj-h30959-reading DC_Spannung_2_V
attr MB_SBS25 obj-h30961-name SBS25_DC_Leistung_2_W
attr MB_SBS25 obj-h30961-poll 0
attr MB_SBS25 obj-h30961-polldelay x1
attr MB_SBS25 obj-h30961-reading DC_Leistung_2_W
attr MB_SBS25 obj-h30977-expr ($val & 0xFFFF) / 1000
attr MB_SBS25 obj-h30977-len 2
attr MB_SBS25 obj-h30977-name SBS25_GridMs.A.phsA
attr MB_SBS25 obj-h30977-poll 0
attr MB_SBS25 obj-h30977-polldelay x1
attr MB_SBS25 obj-h30977-reading BatterieStrom_AC_Phase_L1_A
attr MB_SBS25 obj-h30977-type S32F3
attr MB_SBS25 obj-h30979-expr ($val & 0xFFFF) / 1000
attr MB_SBS25 obj-h30979-len 2
attr MB_SBS25 obj-h30979-name SBS25_GridMs.A.phsB
attr MB_SBS25 obj-h30979-poll 1
attr MB_SBS25 obj-h30979-polldelay x1
attr MB_SBS25 obj-h30979-reading BatterieStrom_AC_Phase_L2_A
attr MB_SBS25 obj-h30979-type S32F3
attr MB_SBS25 obj-h30981-expr ($val & 0xFFFF) / 1000
attr MB_SBS25 obj-h30981-len 2
attr MB_SBS25 obj-h30981-name SBS25_GridMs.A.phsC
attr MB_SBS25 obj-h30981-poll 0
attr MB_SBS25 obj-h30981-polldelay x1
attr MB_SBS25 obj-h30981-reading BatterieStrom_AC_Phase_L3_A
attr MB_SBS25 obj-h30981-type S32F3
attr MB_SBS25 obj-h31377-expr ($val & 0xFFFFFFFF)
attr MB_SBS25 obj-h31377-format %.f
attr MB_SBS25 obj-h31377-len 2
attr MB_SBS25 obj-h31377-name SBS25_Nameplate.Bat.Vendor
attr MB_SBS25 obj-h31377-poll once
attr MB_SBS25 obj-h31377-reading TTTNameplate.Bat.Vendor
attr MB_SBS25 obj-h31377-unpack N
attr MB_SBS25 obj-h31379-expr $val / 1
attr MB_SBS25 obj-h31379-format %.f
attr MB_SBS25 obj-h31379-len 2
attr MB_SBS25 obj-h31379-name SBS25_Nameplate.CmpBMS.Typ
attr MB_SBS25 obj-h31379-poll 1
attr MB_SBS25 obj-h31379-polldelay x5
attr MB_SBS25 obj-h31379-reading TTTNameplate.CmpBMS.Typ
attr MB_SBS25 obj-h31379-unpack N
attr MB_SBS25 obj-h31393-name SBS25_BatterieLadeleistung_W
attr MB_SBS25 obj-h31393-poll 1
attr MB_SBS25 obj-h31393-polldelay x2
attr MB_SBS25 obj-h31393-reading BatterieLadeleistung_W
attr MB_SBS25 obj-h31395-name SBS25_BatterieEntladeleistung_W
attr MB_SBS25 obj-h31395-poll 1
attr MB_SBS25 obj-h31395-polldelay x2
attr MB_SBS25 obj-h31395-reading BatterieEntladeleistung_W
attr MB_SBS25 obj-h31397-expr $val & 0xFFFFFFFFFFFFFFFF
attr MB_SBS25 obj-h31397-len 4
attr MB_SBS25 obj-h31397-name SBS25_BatterieLadungGesamt_Wh
attr MB_SBS25 obj-h31397-poll 1
attr MB_SBS25 obj-h31397-polldelay x2
attr MB_SBS25 obj-h31397-reading BatterieLadungGesamt_Wh
attr MB_SBS25 obj-h31397-unpack Q>
attr MB_SBS25 obj-h31401-expr $val & 0xFFFFFFFFFFFFFFFF
attr MB_SBS25 obj-h31401-len 4
attr MB_SBS25 obj-h31401-name SBS25_BatterieEntladungGesamt_Wh
attr MB_SBS25 obj-h31401-poll 1
attr MB_SBS25 obj-h31401-polldelay x2
attr MB_SBS25 obj-h31401-reading BatterieEntladungGesamt_Wh
attr MB_SBS25 obj-h31401-unpack Q>
attr MB_SBS25 obj-h34113-expr $val / 10
attr MB_SBS25 obj-h34113-name SBS25_WR_Innentemperatur_C
attr MB_SBS25 obj-h34113-poll 1
attr MB_SBS25 obj-h34113-polldelay x13
attr MB_SBS25 obj-h34113-reading WR_Innentemperatur_C
attr MB_SBS25 obj-h34113-type S32TEMP
attr MB_SBS25 obj-h40073-expr $val
attr MB_SBS25 obj-h40073-len 2
attr MB_SBS25 obj-h40073-name SBS25_BatterieUntereEntladegrenze_%
attr MB_SBS25 obj-h40073-poll 1
attr MB_SBS25 obj-h40073-polldelay x10
attr MB_SBS25 obj-h40073-reading BatterieUntereEntladegrenze_%
attr MB_SBS25 obj-h40149-expr $val
attr MB_SBS25 obj-h40149-len 2
attr MB_SBS25 obj-h40149-name SBS25_Set_Leistung_W
attr MB_SBS25 obj-h40149-poll once
attr MB_SBS25 obj-h40149-reading Set_Leistung_W
attr MB_SBS25 obj-h40149-set 1
attr MB_SBS25 obj-h40149-unpack I>
attr MB_SBS25 obj-h40151-expr $val
attr MB_SBS25 obj-h40151-name SBS25_Set_Aktiv
attr MB_SBS25 obj-h40151-poll once
attr MB_SBS25 obj-h40151-reading Set_Aktiv
attr MB_SBS25 obj-h40151-set 1
attr MB_SBS25 obj-h40187-expr $val
attr MB_SBS25 obj-h40187-name SBS25_BatterieNennkapazitaet_Wh
attr MB_SBS25 obj-h40187-poll once
attr MB_SBS25 obj-h40187-reading BatterieNennkapazitaet_Wh
attr MB_SBS25 obj-h40187-type U32F0
attr MB_SBS25 obj-h40236-expr $val / 1
attr MB_SBS25 obj-h40236-map 303:303Aus (Off), 308:308Ein (On), 1438:1438Automatik (Auto), 2289:2289Batterie laden (BatChaMod), 2290:2290Batterie entladen (BatDschMod), 2424:2424Voreinstellung (Dft), 16777213:16777213Information liegt nicht vor (NaNStt)
attr MB_SBS25 obj-h40236-name SBS25_Set_BMS_Mode
attr MB_SBS25 obj-h40236-poll once
attr MB_SBS25 obj-h40236-reading Set_BMS_Mode
attr MB_SBS25 obj-h40721-expr $val
attr MB_SBS25 obj-h40721-len 2
attr MB_SBS25 obj-h40721-name SBS25_BatterieTiefentladeschutzbereichMinimaleBreite_%
attr MB_SBS25 obj-h40721-poll once
attr MB_SBS25 obj-h40721-reading BatterieTiefentladeschutzbereichMinimaleBreite_%
attr MB_SBS25 obj-h40781-expr $val
attr MB_SBS25 obj-h40781-len 2
attr MB_SBS25 obj-h40781-name SBS25_Set_Netzaustauschleistung_W
attr MB_SBS25 obj-h40781-poll once
attr MB_SBS25 obj-h40781-reading Set_Netzaustauschleistung_W
attr MB_SBS25 obj-h40781-set 1
attr MB_SBS25 obj-h40793-expr $val
attr MB_SBS25 obj-h40793-len 2
attr MB_SBS25 obj-h40793-name SBS25_Set_LadeP_min_W
attr MB_SBS25 obj-h40793-poll once
attr MB_SBS25 obj-h40793-reading Set_LadeP_min_W
attr MB_SBS25 obj-h40793-set 1
attr MB_SBS25 obj-h40793-type U32F0
attr MB_SBS25 obj-h40795-expr $val
attr MB_SBS25 obj-h40795-len 2
attr MB_SBS25 obj-h40795-name SBS25_Set_LadeP_max_W
attr MB_SBS25 obj-h40795-poll once
attr MB_SBS25 obj-h40795-reading Set_LadeP_max_W
attr MB_SBS25 obj-h40795-set 1
attr MB_SBS25 obj-h40795-type U32F0
attr MB_SBS25 obj-h40797-expr $val
attr MB_SBS25 obj-h40797-len 2
attr MB_SBS25 obj-h40797-name SBS25_Set_EntladeP_min_W
attr MB_SBS25 obj-h40797-poll once
attr MB_SBS25 obj-h40797-reading Set_EntladeP_min_W
attr MB_SBS25 obj-h40797-set 1
attr MB_SBS25 obj-h40797-type U32F0
attr MB_SBS25 obj-h40799-expr $val
attr MB_SBS25 obj-h40799-len 2
attr MB_SBS25 obj-h40799-name SBS25_Set_EntladeP_max_W
attr MB_SBS25 obj-h40799-poll once
attr MB_SBS25 obj-h40799-reading Set_EntladeP_max_W
attr MB_SBS25 obj-h40799-set 1
attr MB_SBS25 obj-h40801-expr $val
attr MB_SBS25 obj-h40801-len 2
attr MB_SBS25 obj-h40801-name SBS25_Set_Sollwert_Netzaustauschleistung_W
attr MB_SBS25 obj-h40801-poll once
attr MB_SBS25 obj-h40801-reading Set_Sollwert_Netzaustauschleistung_W
attr MB_SBS25 obj-h40801-set 1
attr MB_SBS25 obj-h40801-type S32F0
attr MB_SBS25 obj-h44431-expr $val
attr MB_SBS25 obj-h44431-len 2
attr MB_SBS25 obj-h44431-name SBS25_TTTBatterie_Ladeleistung_Minimal
attr MB_SBS25 obj-h44431-poll 1
attr MB_SBS25 obj-h44431-polldelay x5
attr MB_SBS25 obj-h44431-reading TTTBatterie_Ladeleistung_Minimal
attr MB_SBS25 obj-h44431-type U32F0
attr MB_SBS25 obj-h44433-expr $val
attr MB_SBS25 obj-h44433-len 2
attr MB_SBS25 obj-h44433-name SBS25_TTTBatterie_Ladeleistung_Maximal
attr MB_SBS25 obj-h44433-poll 1
attr MB_SBS25 obj-h44433-polldelay x5
attr MB_SBS25 obj-h44433-reading TTTBatterie_Ladeleistung_Maximal
attr MB_SBS25 obj-h44433-type U32F0
attr MB_SBS25 obj-h44435-expr $val
attr MB_SBS25 obj-h44435-len 2
attr MB_SBS25 obj-h44435-name SBS25_TTTBatterie_Entladeleistung_Minimal
attr MB_SBS25 obj-h44435-poll 1
attr MB_SBS25 obj-h44435-polldelay x5
attr MB_SBS25 obj-h44435-reading TTTBatterie_Entladeleistung_Minimal
attr MB_SBS25 obj-h44435-type U32F0
attr MB_SBS25 obj-h44437-expr $val
attr MB_SBS25 obj-h44437-len 2
attr MB_SBS25 obj-h44437-name SBS25_TTTBatterie_Entladeleistung_Maximal
attr MB_SBS25 obj-h44437-poll 1
attr MB_SBS25 obj-h44437-polldelay x5
attr MB_SBS25 obj-h44437-reading TTTBatterie_Entladeleistung_Maximal
attr MB_SBS25 obj-h44437-type U32F0
attr MB_SBS25 obj-h44439-expr $val
attr MB_SBS25 obj-h44439-len 2
attr MB_SBS25 obj-h44439-name SBS25_TTTNetzaustauschleistung_Sollwert
attr MB_SBS25 obj-h44439-poll 1
attr MB_SBS25 obj-h44439-polldelay x5
attr MB_SBS25 obj-h44439-reading TTTNetzaustauschleistung_Sollwert
attr MB_SBS25 obj-h44439-type S32F0
attr MB_SBS25 room 011_MODBUS
attr MB_SBS25 verbose 2

setstate MB_SBS25 opened
setstate MB_SBS25 2023-10-12 17:06:53 BatterieEntladeleistung_W 146
setstate MB_SBS25 2023-10-12 17:06:59 BatterieEntladungGesamt_Wh 5041633
setstate MB_SBS25 2023-10-12 17:06:58 BatterieEntladungTag_Wh 4874
setstate MB_SBS25 2023-10-12 17:06:48 BatterieKapazitaetaktuell_% 95
setstate MB_SBS25 2023-10-12 17:06:53 BatterieLadeleistung_W 0
setstate MB_SBS25 2023-10-12 17:06:48 BatterieLadezustand_% 16
setstate MB_SBS25 2023-10-12 17:06:53 BatterieLadungGesamt_Wh 7032543
setstate MB_SBS25 2023-10-12 17:06:48 BatterieLadungTag_Wh 1075
setstate MB_SBS25 2023-10-11 21:48:06 BatterieNennkapazitaet_Wh 9800
setstate MB_SBS25 2023-10-12 17:06:38 BatterieSpannung_V 458.97
setstate MB_SBS25 2023-10-12 17:07:02 BatterieStatus entladen
setstate MB_SBS25 2023-10-12 17:06:58 BatterieStrom_AC_Phase_L2_A 0.759
setstate MB_SBS25 2023-10-12 17:06:58 BatterieStrom_DC__A 0.388
setstate MB_SBS25 2023-10-12 17:06:08 BatterieTemperatur_C 22.10
setstate MB_SBS25 2023-10-11 21:48:06 BatterieTiefentladeschutzbereichMinimaleBreite_% 3
setstate MB_SBS25 2023-10-12 17:06:18 BatterieUntereEntladegrenze_% 10
setstate MB_SBS25 2023-10-12 17:06:58 Grid_Bezug_W 0.00
setstate MB_SBS25 2023-10-12 17:06:58 Grid_Einspeisung_W 0.00
setstate MB_SBS25 2023-10-12 17:06:38 NetzEMEinspeisungGesamt_Wh 1074888
setstate MB_SBS25 2023-10-12 17:06:57 Netzrelais geschlossen
setstate MB_SBS25 2023-10-11 21:48:05 Set_Aktiv 16777213
setstate MB_SBS25 2023-10-11 21:48:06 Set_BMS_Mode 16777213Information liegt nicht vor (NaNStt)
setstate MB_SBS25 2023-10-11 21:48:07 Set_EntladeP_max_W 4294967295
setstate MB_SBS25 2023-10-11 21:48:06 Set_EntladeP_min_W 4294967295
setstate MB_SBS25 2023-10-11 21:48:06 Set_LadeP_max_W 4294967295
setstate MB_SBS25 2023-10-11 21:48:06 Set_LadeP_min_W 4294967295
setstate MB_SBS25 2023-10-11 21:48:05 Set_Leistung_W 2147483648
setstate MB_SBS25 2023-10-11 21:48:06 Set_Netzaustauschleistung_W 2147483648
setstate MB_SBS25 2023-10-11 21:48:07 Set_Sollwert_Netzaustauschleistung_W -2147483648
setstate MB_SBS25 2023-10-12 17:07:07 StatusWR OK
setstate MB_SBS25 2023-10-12 17:07:02 TTTBatterie_Backup-Modus  Netzbetrieb (ModGri)
setstate MB_SBS25 2023-10-12 17:06:59 TTTBatterie_Entladeleistung_Maximal 4294967295
setstate MB_SBS25 2023-10-12 17:06:59 TTTBatterie_Entladeleistung_Minimal 4294967295
setstate MB_SBS25 2023-10-12 17:06:59 TTTBatterie_Ladeleistung_Maximal 4294967295
setstate MB_SBS25 2023-10-12 17:06:39 TTTBatterie_Ladeleistung_Minimal 4294967295
setstate MB_SBS25 2023-10-11 21:48:04 TTTNameplate.Bat.Vendor 2340
setstate MB_SBS25 2023-10-12 17:06:58 TTTNameplate.CmpBMS.Typ 8610
setstate MB_SBS25 2023-10-11 21:47:56 TTTNameplate.MainModel 8007
setstate MB_SBS25 2023-10-11 21:47:56 TTTNameplate.Model 9326
setstate MB_SBS25 2023-10-11 21:47:55 TTTNameplate.SerNum 19XXXXXXXXXX
setstate MB_SBS25 2023-10-11 21:47:55 TTTNameplate.SusyId XXX
setstate MB_SBS25 2023-10-12 17:06:39 TTTNetzaustauschleistung_Sollwert -2147483648
setstate MB_SBS25 2023-10-12 17:06:57 UserAction none
setstate MB_SBS25 2023-10-12 17:06:28 WR_Innentemperatur_C 43.70
setstate MB_SBS25 2023-10-12 17:06:58 WR_Temperatur_C 43.70
setstate MB_SBS25 2023-10-12 17:06:48 Wirkleistung_W 143
setstate MB_SBS25 2023-10-11 21:47:55 state opened


Vielleicht hat ja jemand schon das nötige Wissen dazu und hilft !?!

Gruß
300P

FHEM 6.3 - Raspberry Pi 3 / Pi 4 - VControl300 mit VITOVALOR 300P - SMAEM - SMAInverter - DbLog/DbRep - MariaDB/QNAP - div. HTTPMOD - div. Modbus ser+TCP - SolarForecast - Tibber + Ladung mit SMA-SBS25


sukram

Nachdem ich jetzt die Stromzähler (nach eingen Jahren ::) ) im Produktiveinsatz habe, gibt es mal noch ein Update zu der zugehörigen Registerdefinition.

Die folgende ist der alte Stand:

Zitat von: sukram am 31 Mai 2020, 14:39:11Saia ALE3 Modbus Stromzähler

Raw definition der Instanz:
define nioZaehler1 ModbusAttr 2 30 10.102.1.240 TCP
attr nioZaehler1 dev-h-combine 20
attr nioZaehler1 dev-type-dint-expr $val/100
attr nioZaehler1 dev-type-dint-len 2
attr nioZaehler1 dev-type-dint-revRegs 0
attr nioZaehler1 dev-type-dint-unpack N
attr nioZaehler1 obj-h0-reading Firmwareversion
attr nioZaehler1 obj-h1-reading Registercount
attr nioZaehler1 obj-h14-reading Hardwareversion
attr nioZaehler1 obj-h15-reading Serialnumber
attr nioZaehler1 obj-h15-type dint
attr nioZaehler1 obj-h2-reading Flagcount
attr nioZaehler1 obj-h21-reading Status
attr nioZaehler1 obj-h22-reading Modbustimeout
attr nioZaehler1 obj-h23-reading ModbusAddress
attr nioZaehler1 obj-h24-reading Error
attr nioZaehler1 obj-h26-reading Tarif
attr nioZaehler1 obj-h27-poll 1
attr nioZaehler1 obj-h27-reading Total1
attr nioZaehler1 obj-h27-type dint
attr nioZaehler1 obj-h29-poll 1
attr nioZaehler1 obj-h29-reading Subtotal1
attr nioZaehler1 obj-h29-type dint
attr nioZaehler1 obj-h3-reading Baudrate
attr nioZaehler1 obj-h3-type dint
attr nioZaehler1 obj-h31-reading Total2
attr nioZaehler1 obj-h31-type dint
attr nioZaehler1 obj-h33-reading Subtotal2
attr nioZaehler1 obj-h33-type dint
attr nioZaehler1 obj-h35-poll 1
attr nioZaehler1 obj-h35-reading Urms_L1
attr nioZaehler1 obj-h36-expr $val/10
attr nioZaehler1 obj-h36-poll 1
attr nioZaehler1 obj-h36-reading Irms_L1
attr nioZaehler1 obj-h37-expr $val/100
attr nioZaehler1 obj-h37-poll 1
attr nioZaehler1 obj-h37-reading Prms_L1
attr nioZaehler1 obj-h38-expr $val/100
attr nioZaehler1 obj-h38-poll 1
attr nioZaehler1 obj-h38-reading Qrms_L1
attr nioZaehler1 obj-h39-expr $val/100
attr nioZaehler1 obj-h39-poll 1
attr nioZaehler1 obj-h39-reading CosPhi_L1
attr nioZaehler1 obj-h40-poll 0
attr nioZaehler1 obj-h40-reading Urms_L2
attr nioZaehler1 obj-h41-expr $val/10
attr nioZaehler1 obj-h41-poll 0
attr nioZaehler1 obj-h41-reading Irms_L2
attr nioZaehler1 obj-h42-expr $val/100
attr nioZaehler1 obj-h42-poll 0
attr nioZaehler1 obj-h42-reading Prms_L2
attr nioZaehler1 obj-h43-expr $val/100
attr nioZaehler1 obj-h43-poll 0
attr nioZaehler1 obj-h43-reading Qrms_L2
attr nioZaehler1 obj-h44-expr $val/100
attr nioZaehler1 obj-h44-poll 0
attr nioZaehler1 obj-h44-reading CosPhi_L2
attr nioZaehler1 obj-h45-poll 0
attr nioZaehler1 obj-h45-reading Urms_L3
attr nioZaehler1 obj-h46-expr $val/10
attr nioZaehler1 obj-h46-poll 0
attr nioZaehler1 obj-h46-reading Irms_L3
attr nioZaehler1 obj-h47-expr $val/100
attr nioZaehler1 obj-h47-poll 0
attr nioZaehler1 obj-h47-reading Prms_L3
attr nioZaehler1 obj-h48-expr $val/100
attr nioZaehler1 obj-h48-poll 0
attr nioZaehler1 obj-h48-reading Qrms_L3
attr nioZaehler1 obj-h49-expr $val/100
attr nioZaehler1 obj-h49-poll 0
attr nioZaehler1 obj-h49-reading CosPhi_L3
attr nioZaehler1 obj-h50-expr $val/100
attr nioZaehler1 obj-h50-poll 1
attr nioZaehler1 obj-h50-reading Prms_total
attr nioZaehler1 obj-h51-expr $val
attr nioZaehler1 obj-h51-poll 1
attr nioZaehler1 obj-h51-reading Qrms_total
attr nioZaehler1 obj-h6-len 8
attr nioZaehler1 obj-h6-reading Type
attr nioZaehler1 obj-h6-unpack a*
attr nioZaehler1 stateFormat Summe: Total1 kWh Aktuell: Prms_total W Qrms_total VA<br />L1 Urms_L1 V Irms_L1 A Prms_L1 W Qrms_L1 VA Cos Phi CosPhi_L1


Das hier ist der erprobte und fehlerbereinigte aktuelle Stand:

define MBZaehler03 ModbusAttr 3 30
attr MBZaehler03 IODev ModbusLineS1
attr MBZaehler03 alignTime 00:00:15
attr MBZaehler03 comment Modbus Register für Saia ALE3 Stromzähler\
\
Einschraenkungen:\
- nur alle 10sek neue Daten\
- max 20 Register auf einmal lesbar\
\
Subtotal 1+2 lassen sich mit 0 schreiben zurücksetzen\
\
Tarifumschaltung (Total 1/2, Subtotal 1/2) über 230V Schalteingang am Gerät\
\
Modbusaddresse lässt sich über schreiben auf das Adressregister neu setzen\
\
Verwendete Datentypen:\
Num10 - unsigned Integer (16 Bit), umgerechnet mit 1 Nachkommastelle\
Num100 - unsigned Integer (16 Bit), umgerechnet mit 2 Nachkommastellen\
dint - unsigned Integer (32 Bit) big Endian\
sint - signed Integer (16 Bit) big Endian, umgerechnet mit 2 Nachkommastellen\

attr MBZaehler03 dev-h-combine 19
attr MBZaehler03 dev-type-Num10-expr $val/10
attr MBZaehler03 dev-type-Num100-expr $val/100
attr MBZaehler03 dev-type-Total-expr $val/100
attr MBZaehler03 dev-type-Total-len 2
attr MBZaehler03 dev-type-dint-expr $val/100
attr MBZaehler03 dev-type-dint-len 2
attr MBZaehler03 dev-type-dint-unpack N
attr MBZaehler03 dev-type-sdint-expr $val/100
attr MBZaehler03 dev-type-sdint-len 1
attr MBZaehler03 dev-type-sdint-unpack s
attr MBZaehler03 dev-type-sint-expr $val/100
attr MBZaehler03 dev-type-sint-unpack s>
attr MBZaehler03 obj-h00-reading Firmwareversion
attr MBZaehler03 obj-h01-reading Registercount
attr MBZaehler03 obj-h02-reading Flagcount
attr MBZaehler03 obj-h03-reading Baudrate
attr MBZaehler03 obj-h03-type dint
attr MBZaehler03 obj-h06-len 8
attr MBZaehler03 obj-h06-reading Type
attr MBZaehler03 obj-h06-unpack a*
attr MBZaehler03 obj-h14-reading Hardwareversion
attr MBZaehler03 obj-h15-reading Serialnumber
attr MBZaehler03 obj-h15-type dint
attr MBZaehler03 obj-h21-reading Status
attr MBZaehler03 obj-h22-reading Modbustimeout
attr MBZaehler03 obj-h23-reading ModbusAddress
attr MBZaehler03 obj-h24-poll 1
attr MBZaehler03 obj-h24-reading Error
attr MBZaehler03 obj-h26-poll 1
attr MBZaehler03 obj-h26-reading Tarif
attr MBZaehler03 obj-h27-poll 1
attr MBZaehler03 obj-h27-reading Total1
attr MBZaehler03 obj-h27-type dint
attr MBZaehler03 obj-h29-poll 1
attr MBZaehler03 obj-h29-reading Subtotal1
attr MBZaehler03 obj-h29-set 1
attr MBZaehler03 obj-h29-type dint
attr MBZaehler03 obj-h31-reading Total2
attr MBZaehler03 obj-h31-type dint
attr MBZaehler03 obj-h33-reading Subtotal2
attr MBZaehler03 obj-h33-type dint
attr MBZaehler03 obj-h35-poll 1
attr MBZaehler03 obj-h35-reading Urms_L1
attr MBZaehler03 obj-h36-poll 1
attr MBZaehler03 obj-h36-reading Irms_L1
attr MBZaehler03 obj-h36-type Num10
attr MBZaehler03 obj-h37-poll 1
attr MBZaehler03 obj-h37-reading Prms_L1
attr MBZaehler03 obj-h37-type Num100
attr MBZaehler03 obj-h38-poll 1
attr MBZaehler03 obj-h38-reading Qrms_L1
attr MBZaehler03 obj-h38-type sint
attr MBZaehler03 obj-h39-poll 1
attr MBZaehler03 obj-h39-reading CosPhi_L1
attr MBZaehler03 obj-h39-type Num100
attr MBZaehler03 obj-h40-poll 1
attr MBZaehler03 obj-h40-reading Urms_L2
attr MBZaehler03 obj-h41-poll 1
attr MBZaehler03 obj-h41-reading Irms_L2
attr MBZaehler03 obj-h41-type Num10
attr MBZaehler03 obj-h42-poll 1
attr MBZaehler03 obj-h42-reading Prms_L2
attr MBZaehler03 obj-h42-type Num100
attr MBZaehler03 obj-h43-poll 1
attr MBZaehler03 obj-h43-reading Qrms_L2
attr MBZaehler03 obj-h43-type sint
attr MBZaehler03 obj-h44-poll 1
attr MBZaehler03 obj-h44-reading CosPhi_L2
attr MBZaehler03 obj-h44-type Num100
attr MBZaehler03 obj-h45-poll 1
attr MBZaehler03 obj-h45-reading Urms_L3
attr MBZaehler03 obj-h46-poll 1
attr MBZaehler03 obj-h46-reading Irms_L3
attr MBZaehler03 obj-h46-type Num10
attr MBZaehler03 obj-h47-poll 1
attr MBZaehler03 obj-h47-reading Prms_L3
attr MBZaehler03 obj-h47-type Num100
attr MBZaehler03 obj-h48-poll 1
attr MBZaehler03 obj-h48-reading Qrms_L3
attr MBZaehler03 obj-h48-type sint
attr MBZaehler03 obj-h49-poll 1
attr MBZaehler03 obj-h49-reading CosPhi_L3
attr MBZaehler03 obj-h49-type Num100
attr MBZaehler03 obj-h50-poll 1
attr MBZaehler03 obj-h50-reading Prms_total
attr MBZaehler03 obj-h50-type Num100
attr MBZaehler03 obj-h51-poll 1
attr MBZaehler03 obj-h51-reading Qrms_total
attr MBZaehler03 obj-h51-type sint
attr MBZaehler03 room Geraete
attr MBZaehler03 stateFormat <b>Summe:</b> Total1 kWh <b>Aktuell:</b> Prms_total kW Qrms_total kvar\
<br /><b>L1</b> Urms_L1 V Irms_L1 A Prms_L1 kW Qrms_L1 kvar Cos Phi CosPhi_L1\
<br /><b>L2</b> Urms_L2 V Irms_L2 A Prms_L2 kW Qrms_L2 kvar Cos Phi CosPhi_L2\
<br /><b>L3</b> Urms_L3 V Irms_L3 A Prms_L3 kW Qrms_L3 kvar Cos Phi CosPhi_L3



Marlon

Hallo Stefan,

im Forum habe ich Timeout nur im Zusammenhang mit Fehlern gefunden.
Im Gegensatz dazu würde ich bei Auftreten eines Timeouts gerne eine Funktion ausführen.

Normalerweise wird mein Deye-Wechselrichter mit ModbusAttr minütlich abgefragt und dann ausgewertet mit:
defmod DeyeMacro notify Mod_Deye:PV4_Leistung_W:.* {appendDeye()}Bei leerer Batterie ohne Sonne deaktiviere ich den Wechselrichter normalerweise, um Energie zu sparen.
Dann gibt es natürlich bei den minütlichen Polls des ModbusAttr timeouts.
Nun würde ich gerne bei Auftreten der Timeouts eine alternative Funktion ausführen, mit der ich z.B. den Betriebszustand "Deaktiviert" detektieren kann.

Zunächst hatte ich dafür folgendes vorgesehen:
defmod DeyeTimeout notify <pattern> {appendDeyeTimeout()}
Allerdings konnte ich nirgends finden, welcher Event bei einem Timout von ModbusAttr ausgeführt wird.
Einen Event muss es ja geben, der auch zum Eintrag des Timeouts ins Log dient.
Was müsste man hier also bei <pattern> einsetzen?

Alternativ hatte ich folgendes mit watchdog vorgesehen:
define DeyeDog watchdog <regexp1> 00:01:05 Mod_Deye:PV4_Leistung_W:.* {appendDeyeTimeout()}Allerdings konnte ich auch nirgends finden, welcher Event beim Pollen von ModbusAttr generiert wird.
Was müsste man hier also bei <regexp1> einsetzen?

kaiman

Hallo zusammen,
Ich habe eine Frage:

Ich habe zwei PE11 Modbus LAN Adapter und jeweils einen Zähler angeschlossen, jeweils SDM72D-M.

Kann ich die Zählerstände und den aktuellen Verbrauch mit dem Modul in FHEM anzeigen? Gibt es dazu eine Anleitung? Dieser Thread ist schon ziemlich lang geworden.

Beide Zähler werden aktuell von einer openWB schon ausgewertet, ich würde die Zählerstände aber zusätzlich noch in FHEM sehen.

LG Kaiman

StefanStrobel

Hallo Marlon,

es gibt z.B. das Attribut showError. Wenn das auf dem physischen Device auf 1 steht, dann wird im Fehlerfall und auch bei Timouts ein Reading und Event mit Namen LAST_ERROR" erzeugt.

Gruß
    Stefan

StefanStrobel


Marlon

Zitat von: StefanStrobel am 05 November 2023, 17:02:42es gibt z.B. das Attribut showError. Wenn das auf dem physischen Device auf 1 steht, dann wird im Fehlerfall und auch bei Timouts ein Reading und Event mit Namen LAST_ERROR" erzeugt.
Hallo Stefan,
danke für den Hinweis. Nach update auf FHEM 6.2 gab es bei mir auch das Attribut showError.
Allerdings ist dies nicht in der Modbus-Hilfe beschrieben.
Mit diesem notify wird nun die gewünschte Funktion aufgerufen:
defmod DeyeTimeout notify Modbus_Deye:LAST_ERROR:.* {appendDeyeTimeout()}
attr DeyeTimeout disabledAfterTrigger 30
Kann man mit LAST_ERROR auch auf bestimmte Readings filtern bzw. wie geht das?
Da die Abfrage aller Readings in 8 Blöcke aufgeteilt wird, gibt es 8 Timeout-Events in 2-Sekunden-Abständen.
Lieber wäre mir, wenn man statt disabledAfterTrigger von vornherein nur auf den Timeout des ersten Blocks ab h500 filtern könnte.
Ohne Filterung sieht das im Logging so aus:
2023.11.05 22:00:02 3: Modbus_Deye: Timeout waiting for a modbus response, read buffer empty,
request: id 1, read fc 3 h500, len 20, master device Mod_Deye, reading Deye_Betriebszustand (getUpdate for combined h500 len 1 Deye_Betriebszustand with h503 len 1 Grid_Tagesverbindungszeit_s and h514 len 1 Batt_Tagesladung_kWh and h515 len 1 Batt_Tagesentladung_kWh and h516 len 2 Batt_Gesamtladung_kWh and h518 len 2 Batt_Gesamtentladung_kWh), queued 2.01 secs ago, sent 2.00 secs ago
2023.11.05 22:00:02 3: DeyeTimeout return value: <xml><exec>/GET /x.exe</exec><sessionId></sessionId><httpUserAgent>User-Agent: fhem</httpUserAgent><antwort>true</antwort></xml>
2023.11.05 22:00:04 3: Modbus_Deye: Timeout waiting for a modbus response, read buffer empty,
request: id 1, read fc 3 h520, len 16, master device Mod_Deye, reading Netz_Tagesbezug_kWh (getUpdate for combined h520 len 1 Netz_Tagesbezug_kWh with h521 len 1 Netz_Tageseinspeisung_kWh and h522 len 2 Netz_Gesamtbezug_kWh and h524 len 2 Netz_Gesamteinspeisung_kWh and h525 len 1 Load_Tagesverbrauch_kWh and h526 len 2 Load_Gesamtverbrauch_kWh and h529 len 1 PV_Tagesertrag_kWh and h534 len 2 PV_Gesamtertrag_kWh), queued 4.03 secs ago, sent 2.00 secs ago
2023.11.05 22:00:04 3: DeyeTimeout return value: <xml><exec>/GET /x.exe</exec><sessionId></sessionId><httpUserAgent>User-Agent: fhem</httpUserAgent><antwort>true</antwort></xml>
2023.11.05 22:00:06 3: Modbus_Deye: Timeout waiting for a modbus response, read buffer empty,
request: id 1, read fc 3 h541, len 12, master device Mod_Deye, reading Deye_Kuehlkoerpertemperatur (getUpdate for combined h541 len 1 Deye_Kuehlkoerpertemperatur with h550 len 1 Deye_LCD_Test_Flag and h551 len 1 Deye_Schalterstatus and h552 len 1 Deye_Relaisstatus), queued 6.05 secs ago, sent 2.00 secs ago
2023.11.05 22:00:06 3: DeyeTimeout return value: <xml><exec>/GET /x.exe</exec><sessionId></sessionId><httpUserAgent>User-Agent: fhem</httpUserAgent><antwort>true</antwort></xml>
2023.11.05 22:00:08 3: Modbus_Deye: Timeout waiting for a modbus response, read buffer empty,
request: id 1, read fc 3 h586, len 20, master device Mod_Deye, reading Batt_Temperatur (getUpdate for combined h586 len 1 Batt_Temperatur with h587 len 1 Batt_Spannung_V and h588 len 1 Batt_SOC and h590 len 1 Batt_Leistung_W and h591 len 1 Batt_Strom_A and h592 len 1 Batt_Kap_korrigiert_Ah and h604 len 1 Grid_L1_Leistung_W and h605 len 1 Grid_L2_Leistung_W), queued 8.07 secs ago, sent 2.00 secs ago
2023.11.05 22:00:08 3: DeyeTimeout return value: <xml><exec>/GET /x.exe</exec><sessionId></sessionId><httpUserAgent>User-Agent: fhem</httpUserAgent><antwort>true</antwort></xml>
2023.11.05 22:00:10 3: Modbus_Deye: Timeout waiting for a modbus response, read buffer empty,
request: id 1, read fc 3 h606, len 20, master device Mod_Deye, reading Grid_L3_Leistung_W (getUpdate for combined h606 len 1 Grid_L3_Leistung_W with h607 len 1 Grid_Wirkleistung_W and h616 len 1 Netz_L1_Leistung_W and h617 len 1 Netz_L2_Leistung_W and h618 len 1 Netz_L3_Leistung_W and h619 len 1 Netz_Wirkleistung_W and h622 len 1 GN_L1_Leistung_W and h623 len 1 GN_L2_Leistung_W and h624 len 1 GN_L3_Leistung_W and h625 len 1 GN_Wirkleistung_W), queued 10.10 secs ago, sent 2.00 secs ago
2023.11.05 22:00:10 3: DeyeTimeout return value: <xml><exec>/GET /x.exe</exec><sessionId></sessionId><httpUserAgent>User-Agent: fhem</httpUserAgent><antwort>true</antwort></xml>
2023.11.05 22:00:12 3: Modbus_Deye: Timeout waiting for a modbus response, read buffer empty,
request: id 1, read fc 3 h633, len 20, master device Mod_Deye, reading Deye_L1_Leistung_W (getUpdate for combined h633 len 1 Deye_L1_Leistung_W with h634 len 1 Deye_L2_Leistung_W and h635 len 1 Deye_L3_Leistung_W and h636 len 1 Deye_Wirkleistung_W and h640 len 1 USV_L1_Leistung_W and h641 len 1 USV_L2_Leistung_W and h642 len 1 USV_L3_Leistung_W and h643 len 1 USV_Leistung_W and h650 len 1 Load_L1_Leistung_W and h651 len 1 Load_L2_Leistung_W and h652 len 1 Load_L3_Leistung_W), queued 12.13 secs ago, sent 2.00 secs ago
2023.11.05 22:00:12 3: DeyeTimeout return value: <xml><exec>/GET /x.exe</exec><sessionId></sessionId><httpUserAgent>User-Agent: fhem</httpUserAgent><antwort>true</antwort></xml>
2023.11.05 22:00:14 3: Modbus_Deye: Timeout waiting for a modbus response, read buffer empty,
request: id 1, read fc 3 h653, len 20, master device Mod_Deye, reading Load_Wirkleistung_W (getUpdate for combined h653 len 1 Load_Wirkleistung_W with h654 len 1 Load_Scheinleistung_VA and h664 len 1 Gen_L1_Leistung_W and h665 len 1 Gen_L2_Leistung_W and h666 len 1 Gen_L3_Leistung_W and h667 len 1 Gen_Leistung_W and h672 len 1 PV1_Leistung_W), queued 14.15 secs ago, sent 2.00 secs ago
2023.11.05 22:00:14 3: DeyeTimeout return value: <xml><exec>/GET /x.exe</exec><sessionId></sessionId><httpUserAgent>User-Agent: fhem</httpUserAgent><antwort>true</antwort></xml>
2023.11.05 22:00:16 3: Modbus_Deye: Timeout waiting for a modbus response, read buffer empty,
request: id 1, read fc 3 h673, len 3, master device Mod_Deye, reading PV2_Leistung_W (getUpdate for combined h673 len 1 PV2_Leistung_W with h674 len 1 PV3_Leistung_W and h675 len 1 PV4_Leistung_W), queued 16.18 secs ago, sent 2.00 secs ago
2023.11.05 22:00:16 3: DeyeTimeout return value: <xml><exec>/GET /x.exe</exec><sessionId></sessionId><httpUserAgent>User-Agent: fhem</httpUserAgent><antwort>true</antwort></xml>
Gruß
Marlon

kaiman

Super vielen Dank!

Habe die Zähler eingebunden bekommen.

Die nächste Nuss wird wohl nicht mit dem Modbus-Modul machbar sein. Ich habe vom Elektriker noch zwei DSZ15DE-3x80A Zähler verbaut bekommen. Diese haben ja nur einen S0 Ausgang. Wenn ich das richtig verstanden habe, bekomme ich bei denen nicht so gut die Werte ausgelesen.

Was ist sinnvoller? Umbau auf die SDM Zähler oder versuchen auszulesen?
Könnte ich bei einem Umbau auf SDM72 Zähler den Zählerstand im SDM72 Zähler anpassen, so dass dieser mit dem gleichen Startwert weiter zählt, oder geht das nicht und ich würde wieder mit 0khw beginnen?

LG

Zitat von: StefanStrobel am 05 November 2023, 17:11:59Hilft das:
https://forum.fhem.de/index.php?topic=128695.0

Gruß
    Stefan


Nobbynews

Zitat von: kaiman am 06 November 2023, 08:35:18Könnte ich bei einem Umbau auf SDM72 Zähler den Zählerstand im SDM72 Zähler anpassen, so dass dieser mit dem gleichen Startwert weiter zählt, oder geht das nicht und ich würde wieder mit 0khw beginnen?
Die Zählerstände im SDM72 selbst kannst Du nicht verändern.
Allenfalls in fhem über ein userreading und Addition eines Startwertes.

StefanStrobel

Hallo Marlon,

vermutlich ist es dann am einfachsten das ganze mit dem Modul readingsWatcher zu machen.
Wenn im aktiven Zeitraum definierte Readings länger als x Sekunden nicht aktualisiert werden, dann kannst Du damit reagieren.
ModbusAttr hat bisher kein Feature um bei Timeouts für einzelne Readings einen Event zu erzeugen.

Gruss
   Stefan

Aurel_B

Zitat von: kaiman am 06 November 2023, 08:35:18Die nächste Nuss wird wohl nicht mit dem Modbus-Modul machbar sein. Ich habe vom Elektriker noch zwei DSZ15DE-3x80A Zähler verbaut bekommen. Diese haben ja nur einen S0 Ausgang. Wenn ich das richtig verstanden habe, bekomme ich bei denen nicht so gut die Werte ausgelesen.
Was ist sinnvoller? Umbau auf die SDM Zähler oder versuchen auszulesen?

Das hängt von deinen Bedürfnissen ab: wenn du möglichst "Echtzeitwerte" möchtest und auch weitergehende Infos (Gesamtzählerstand, Spannung etc) wirst du mit S0 nicht so recht glücklich. Für einen Kühlschrank oder sonst irgendeinen voraussagbaren Verbraucher reicht wohl S0 (und ein Arduino Counter um ihn auszulesen).

holsteiner-kiel

#1198
Moin Moin,

Ich hoffe, ich stelle nun keine Frage doppelt, aber dieser thread ist mittlerweile etwas unübersichtlich;)

Ich habe eine tecalor Wärmepumpe und lese per modbusattr erfolgreich Werte aus.

Den Betriebsstatus lese ich per
obj-i02000-reading BETRIEBSSTATUS
aus.

Mit
obj-i02000-unpack B16
bekomme ich als Ergebnis eine bitmaske wie zum Beispiel

0000010000000111

Die letzte 1 steht zum Beispiel für "Schaltprogramm aktiv", die vorletzte für "Verdichter" und so weiter.

Wie kann ich diesen Wert nun in einzelne zerlegen und dann entsprechend zu "Klartext Mappen"?

Die map Funktion kenne und nutze ich. Bin aber unsicher in Bezug auf die "Zerlegung".

Hat jemand eine Idee?

Vielen Dank vorab und viele Grüße aus dem hohen Norden!

Markus

Marlon

Zitat von: StefanStrobel am 07 November 2023, 19:13:53Hallo Marlon,

vermutlich ist es dann am einfachsten das ganze mit dem Modul readingsWatcher zu machen.
Wenn im aktiven Zeitraum definierte Readings länger als x Sekunden nicht aktualisiert werden, dann kannst Du damit reagieren.
ModbusAttr hat bisher kein Feature um bei Timeouts für einzelne Readings einen Event zu erzeugen.

Gruss
  Stefan
Hallo Stefan,
die Auswertung der Timeouts ist doch komplexer als zunächst gedacht.
Das Problem ist, dass es auch bei eingeschaltetem Wechselrichter ab und zu Timeouts gibt.
Zusätzlich habe ich im LOG bereits zwei Tage gesehen, wo offenbar das Modbus-Modul einmal am Tag das parametrierte minütliche Abfragen der Daten vom Wechselrichter unterlässt. An einer Überlastung des Raspi 4b kann es nicht liegen, da er fast nie mehr als 1 % ausgelastet ist.
Um möglichst schnell das Ausschalten des WR sicher zu detektieren und trotzdem false Positives zuverlässig zu vermeiden, habe ich es nun bei der Auswertung aller Timeouts belassen. Bei LAST_ERROR ruft ein notify eine Perl-Funktion auf, die wiederum ein notify triggert, welches dann weiteres Triggern für 30 s unterbindet.
Die Perl-Funktion triggert das Timeout-notify, wenn seit den letzten vom Wechselrichter empfangenen Daten mehr als 150 s vergangen sind. Zusätzlich triggert sie das Timeout-notify, wenn seit den letzten vom Wechselrichter empfangenen Daten mehr als 30 s vergangen sind und mindestens 15 s der laufenden Minute um sind.
Damit wird erstmals 16 s nach Abfragen des ausgeschalteten Wechselrichters, wenn es für alle acht Datenblöcke LAST_ERROR gab, ein Timeout festgestellt und später immer 2 s nach jeder vollen Minute, solange der WR ausgeschaltet ist. Das ist zwar gefühlt umständlich, aber nach mehr als einer Woche mit zahlreichen Änderungen funktioniert es nun so, wie ich mir das vorgestellt hatte. :)  Danke für die Hilfe.
Gruß
Marlon