Autor Thema: ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]  (Gelesen 47245 mal)

Offline Benni

  • Developer
  • Hero Member
  • ****
  • Beiträge: 2463
  • FHEMinist
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #60 am: 22 Oktober 2018, 20:01:01 »
bei den Registern 40071 bis 40075 hast Du ja 5 Register, die gemeinsam gelesen werden müssen und 4 Readings, die daraus erzeugt werden müssen.

...

um das mit einem Request zu machen würde ich folgendes definieren:

attr <DEVICE-NAME> obj-h40071-reading CurrentBlock
attr <DEVICE-NAME> obj-h40071-len 5
attr <DEVICE-NAME> obj-h40071-unpack nnnns>
attr <DEVICE-NAME> obj-h40071-expr readingsBulkUpdate($hash, 'Current', $val[0] * 10 ** $val[4]); readingsBulkUpdate($hash, 'CurrentA', $val[1] * 10 ** $val[4]); readingsBulkUpdate($hash, 'CurrentB', $val[2] * 10 ** $val[4]); readingsBulkUpdate($hash, 'CurrentC', $val[3] * 10 ** $val[4]); "$val[0] $val[1] $val[2] $val[3] $val[4]"

ich kann leider nicht selbst testen, da ich keine SolarEdge-Anlage habe, aber das Feintuning bekommt Ihr bestimmt hin ;-)

Also, soweit ich testen konnte, scheint das zu funktionieren. ( :-[ äh nö! Siehe Udate unten)
Muss ich aber mal noch unter Tags testen, da ich im Nachtmodus aktuell keine Werte an dieser Stelle bekomme.

Ich musste die Expression dazu aber wie folgt abändern:

attr <DEVICE-NAME> obj-h40071-expr readingsBeginUpdate($hash);;readingsBulkUpdate($hash,'I_AC_Current',$val[0]*10**$val[4]);;readingsBulkUpdate($hash,'I_AC_CurrentA',$val[1]*10**$val[4]);;readingsBulkUpdate($hash,'I_AC_CurrentB',$val[2]*10**$val[4]);;readingsBulkUpdate($hash,'I_AC_CurrentC',$val[3]*10**$val[4]);;"$val[0]$val[1]$val[2]$val[3]$val[4]";;readingsEndUpdate($hash,1);;

Also doppelte Semikolons für die Definition und das Begin- und End-Update für das aktualisieren der Readings.

Update:

Irgendwas passt da doch noch nicht ganz. Habe eben im Log noch folgende Einträge entdeckt:

Zitat
2018.10.22 19:53:17 1: readingsUpdate(tstInverter,I_Status_Vendor,0) missed to call readingsBeginUpdate first.
2018.10.22 19:53:17 1: stacktrace:
2018.10.22 19:53:17 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.22 19:53:17 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.22 19:53:17 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.22 19:53:17 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.22 19:53:17 1:     main::CallFn                        called by fhem.pl (726)

Da muss ich mit dem Fine-Tuning wohl nochmal ran (Werde mir die expression wohl mal in die 99_myUtils.pm packen).   ???
Aber heute nicht mehr ;D

gb#
« Letzte Änderung: 22 Oktober 2018, 20:10:26 von Benni »

Offline StefanStrobel

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1866
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #61 am: 23 Oktober 2018, 11:10:25 »
Hallo Benni,

Ein Aufruf von readingsBeginUpdate bzw. readingsEndUpdate sollte in die Expression nicht rein.
Die Auswertung der Expressions erfolgt in einem Kontext, in dem vorher readingsBeginUpdate aufgerufen wurde und nach Abarbeitung aller Readings readingsEndUpdate.

Die Fehlermeldung kommt beim Starten von Fhem von der Attr-Funktion, die die Gültigkeit einer Expr. prüfen möchte. Um das zu umgehen, sollte die Expr noch auf $inCheckEval prüfen. In der Attr-Funktion ist $inCheckEval nicht gesetzt. Später beim Verarbeiten der Readings enthält die Variable den Wert 1.

Die „leisere“ Variante wäre also so etwas wie
attr <DEVICE-NAME> obj-h40071-expr if ($inCheckEval) {readingsBulkUpdate($hash, 'Current', $val[0] * 10 ** $val[4]); readingsBulkUpdate($hash, 'CurrentA', $val[1] * 10 ** $val[4]); readingsBulkUpdate($hash, 'CurrentB', $val[2] * 10 ** $val[4]); readingsBulkUpdate($hash, 'CurrentC', $val[3] * 10 ** $val[4]); "$val[0] $val[1] $val[2] $val[3] $val[4]}"

Bei den Semikolons kommt es darauf an, wo man das Attribut eingibt.
In der Fhem.cfg müssen Semikolons verdoppelt werden.

Gruß
   Stefan

Offline StefanStrobel

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1866
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #62 am: 23 Oktober 2018, 11:21:06 »
Hallo Philipp,

Wenn man ein Objekt mit Start-Adresse 801 und Länge 2 definiert, dann werden beim Parsen die Register-Werte von 801 und 802 „verbraucht“. Der Unpack-Code, expression etc. werden auf die 32-Bit (aus Verkettung der beiden 16-Bit Register 801 und 802) angewendet.
Zusätzliche Attribute für 802 würden ignoriert.

Deshalb kann in der Expr für h801 entweder ein einziger Wert für ein einziges Reading zurückgegeben werden oder man müsste in der Expression selbst readingsBeginUpdate aufrufen um weitere Readings zu setzen. Das habe ich ja in meinem Beispiel für h40071 gepostet.

Gruß
   Stefan


Offline Benni

  • Developer
  • Hero Member
  • ****
  • Beiträge: 2463
  • FHEMinist
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #63 am: 23 Oktober 2018, 12:05:48 »
Die Auswertung der Expressions erfolgt in einem Kontext, in dem vorher readingsBeginUpdate aufgerufen wurde und nach Abarbeitung aller Readings readingsEndUpdate.

So hatte ich das eigentlich auch verstanden, dennoch hat er mir genau das readingsBulkUpdate angemeckert, deshalb habe ich die eingefügt.

Eventuell habe ich doch nicht die aktuellste Modbus-Variante bei mir installiert. Ich hatte die letzte aus dem anderen Thread genommen (Stand war glaube ich 13.10.)

Ich komme aber frühestens heute Abend zuhause dann nochmal testen.

Danke und Gruß Benni.

Offline kingmathers

  • Full Member
  • ***
  • Beiträge: 284
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #64 am: 25 Oktober 2018, 12:07:29 »
Hallo Stefan,

vielen Dank für die Erklärungen. Seit einigen Tagen habe ich das neue Modbus Modul (Modbus 4.0.12 - 13.10.2018) jetzt installiert. Bei den attributes habe ich ein paar Änderungen vorgenommen, insgesamt sieht es nun so aus:

Internals:
   DEF        1 60 192.168.10.99 TCP
   DeviceName 192.168.10.99:502
   EXPECT     idle
   FD         105
   INTERVAL   60
   IODev      SolarEdgeWR
   LASTOPEN   1540457772.99154
   MODBUSID   1
   MODE       master
   MODULEVERSION Modbus 4.0.12 - 13.10.2018
   NAME       SolarEdgeWR
   NOTIFYDEV  global
   NR         518
   NTFY_ORDER 50-SolarEdgeWR
   PARTIAL   
   PROTOCOL   TCP
   STATE      454 W; 392274 Wh; 34 °C
   TCPConn    1
   TRIGGERTIME 1540461349.19701
   TRIGGERTIME_FMT 2018-10-25 11:55:49
   TYPE       ModbusAttr
   devioLoglevel 3
   nextOpenDelay 60
   QUEUE:
   READ:
     BUFFER     
   READINGS:
     2018-10-25 11:54:50   C_DeviceAddress 1
     2018-10-25 11:54:49   C_Manufacturer  SolarEdge
     2018-10-25 11:54:49   C_Model         SE5000
     2018-10-25 11:54:50   C_PhaseDesign   101
     2018-10-25 11:54:49   C_SunSpec_ID    SunS
     2018-10-25 11:54:50   C_SunSpec_Length 50
     2018-10-25 11:54:49   C_Version       0003.230
     2018-10-25 11:54:50   I_AC_Current    2.16
     2018-10-25 11:54:50   I_AC_CurrentA   2.16
     2018-10-25 11:54:50   I_AC_CurrentB   655.35
     2018-10-25 11:54:51   I_AC_CurrentC   655.35
     2018-10-25 11:54:51   I_AC_Current_SF -2
     2018-10-25 11:54:53   I_AC_Energy_WH  392674
     2018-10-25 11:54:54   I_AC_Energy_WH_SF 0
     2018-10-25 11:54:52   I_AC_Frequency  49.997
     2018-10-25 11:54:52   I_AC_PF         92.35
     2018-10-25 11:54:52   I_AC_Power      454.1
     2018-10-25 11:54:52   I_AC_VA         498.5
     2018-10-25 11:54:52   I_AC_VAR        204.62
     2018-10-25 11:54:51   I_AC_VoltageAB  229.5
     2018-10-25 11:54:51   I_AC_VoltageAN  6553.5
     2018-10-25 11:54:51   I_AC_VoltageBC  6553.5
     2018-10-25 11:54:51   I_AC_VoltageBN  6553.5
     2018-10-25 11:54:51   I_AC_VoltageCA  6553.5
     2018-10-25 11:54:51   I_AC_VoltageCN  6553.5
     2018-10-25 11:54:52   I_AC_Voltage_SF -1
     2018-10-25 11:54:54   I_DC_Current    1.2486
     2018-10-25 11:54:54   I_DC_Power      462.5
     2018-10-25 11:54:54   I_DC_Voltage    370
     2018-10-25 11:54:54   I_Status        4
     2018-10-25 11:54:55   I_Status_Vendor 0
     2018-10-25 11:54:54   I_Temp_SF       -2
     2018-10-25 11:54:54   I_Temp_Sink     34.45
     2018-10-25 10:56:13   state           opened
     2018-10-25 11:54:50   uC_PhaseDesign  single
     2018-10-25 11:54:55   uI_Status       day
   REMEMBER:
     lid        1
     lrecv      1540461295.00753
     lsend      1540461294.99997
   defptr:
     SolarEdgeWR 1
   gotReadings:
     I_Status_Vendor 0
   lastRead:
     h40000     1540461289.52141
     h40004     1540461289.64267
     h40020     1540461289.76407
     h40044     1540461289.88645
     h40068     1540461290.1367
     h40069     1540461290.25361
     h40070     1540461290.46295
     h40071     1540461290.75543
     h40072     1540461290.88314
     h40073     1540461291.00141
     h40074     1540461291.12025
     h40075     1540461291.23439
     h40076     1540461291.36766
     h40077     1540461291.48446
     h40078     1540461291.60853
     h40079     1540461291.72611
     h40080     1540461291.84568
     h40081     1540461291.9717
     h40082     1540461292.10625
     h40083     1540461292.26155
     h40085     1540461292.60431
     h40087     1540461292.72388
     h40089     1540461292.86829
     h40091     1540461292.99165
     h40093     1540461293.19306
     h40095     1540461294.03027
     h40096     1540461294.19401
     h40098     1540461294.39386
     h40100     1540461294.51783
     h40103     1540461294.64282
     h40106     1540461294.76572
     h40107     1540461294.89944
     h40108     1540461295.02613
Attributes:
   alias      SolarEdge SE5000H
   dev-h-defPoll 1
   icon       measure_power_meter
   obj-h40000-len 4
   obj-h40000-reading C_SunSpec_ID
   obj-h40000-unpack (a4)
   obj-h40004-len 16
   obj-h40004-reading C_Manufacturer
   obj-h40004-unpack (a16)
   obj-h40020-len 16
   obj-h40020-reading C_Model
   obj-h40020-unpack (a16)
   obj-h40044-len 8
   obj-h40044-reading C_Version
   obj-h40044-unpack (a8)
   obj-h40052-len 16
   obj-h40052-reading C_SerialNumber
   obj-h40052-unpack (a16)
   obj-h40068-reading C_DeviceAddress
   obj-h40069-reading C_PhaseDesign
   obj-h40070-reading C_SunSpec_Length
   obj-h40071-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Current_SF',0))
   obj-h40071-reading I_AC_Current
   obj-h40072-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Current_SF',0))
   obj-h40072-reading I_AC_CurrentA
   obj-h40073-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Current_SF',0))
   obj-h40073-reading I_AC_CurrentB
   obj-h40074-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Current_SF',0))
   obj-h40074-reading I_AC_CurrentC
   obj-h40075-reading I_AC_Current_SF
   obj-h40075-unpack s>
   obj-h40076-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Voltage_SF',0))
   obj-h40076-reading I_AC_VoltageAB
   obj-h40077-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Voltage_SF',0))
   obj-h40077-reading I_AC_VoltageBC
   obj-h40078-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Voltage_SF',0))
   obj-h40078-reading I_AC_VoltageCA
   obj-h40079-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Voltage_SF',0))
   obj-h40079-reading I_AC_VoltageAN
   obj-h40080-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Voltage_SF',0))
   obj-h40080-reading I_AC_VoltageBN
   obj-h40081-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Voltage_SF',0))
   obj-h40081-reading I_AC_VoltageCN
   obj-h40082-reading I_AC_Voltage_SF
   obj-h40082-unpack s>
   obj-h40083-expr $val[0] * (10 ** $val[1])
   obj-h40083-len 2
   obj-h40083-reading I_AC_Power
   obj-h40083-unpack s>s>
   obj-h40085-expr $val[0] * (10 ** $val[1])
   obj-h40085-len 2
   obj-h40085-reading I_AC_Frequency
   obj-h40085-unpack ns>
   obj-h40087-expr $val[0] * (10 ** $val[1])
   obj-h40087-len 2
   obj-h40087-reading I_AC_VA
   obj-h40087-unpack s>s>
   obj-h40089-expr $val[0] * (10 ** $val[1])
   obj-h40089-len 2
   obj-h40089-reading I_AC_VAR
   obj-h40089-unpack s>s>
   obj-h40091-expr $val[0] * (10 ** $val[1])
   obj-h40091-len 2
   obj-h40091-reading I_AC_PF
   obj-h40091-unpack s>s>
   obj-h40093-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_AC_Energy_WH_SF',0))
   obj-h40093-len 2
   obj-h40093-reading I_AC_Energy_WH
   obj-h40093-unpack I>
   obj-h40095-reading I_AC_Energy_WH_SF
   obj-h40096-expr $val[0] * (10 ** $val[1])
   obj-h40096-len 2
   obj-h40096-reading I_DC_Current
   obj-h40096-unpack ns>
   obj-h40098-expr $val[0] * (10 ** $val[1])
   obj-h40098-len 2
   obj-h40098-reading I_DC_Voltage
   obj-h40098-unpack ns>
   obj-h40100-expr $val[0] * (10 ** $val[1])
   obj-h40100-len 2
   obj-h40100-reading I_DC_Power
   obj-h40100-unpack s>s>
   obj-h40103-expr $val * (10 ** ReadingsNum ('SolarEdgeWR' ,'I_Temp_SF',0))
   obj-h40103-reading I_Temp_Sink
   obj-h40103-unpack s>
   obj-h40106-reading I_Temp_SF
   obj-h40106-unpack s>
   obj-h40107-reading I_Status
   obj-h40108-reading I_Status_Vendor
   room       Solar
   sortUpdate 1
   stateFormat {sprintf("%.0f W; %.0f Wh; %.0f °C ",ReadingsVal($name,"I_AC_Power",0),ReadingsVal($name,"uI_AC_Energy_WHSinceInstall",0),ReadingsVal($name,"I_Temp_Sink",0))}
   userReadings uI_Status:I_Status.* {my $om=ReadingsNum($name,'I_Status',-1);($om==2?'night':($om==4?'day':'off'))},
uC_PhaseDesign:C_PhaseDesign.* {my $pd=ReadingsVal($name,'C_PhaseDesign','000');($pd eq '101'?'single':($pd eq '102'?'split':($pd eq '103'?'3-phase':'unknown')))}

Die Auswertung klappt an sich auch ganz gut (Wert und SF werden passen zueinander), allerdings bricht jetzt gelegentlich die Verbindung ab. Der state wechselt dann auf "opened" und die Werte aktualisieren sich nicht mehr.

Im Logfile finde ich dann folgende Einträge:

2018.10.25 06:04:38 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 06:04:38 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 134, type h, adr 40000, len 4 for device SolarEdgeWR reading C_SunSpec_ID, read buffer empty

2018.10.25 06:04:41 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 06:04:41 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 117, type h, adr 40004, len 16 for device SolarEdgeWR reading C_Manufacturer, read buffer empty
2018.10.25 06:04:43 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 06:04:43 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 47, type h, adr 40020, len 16 for device SolarEdgeWR reading C_Model, read buffer empty
2018.10.25 06:04:45 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 06:04:45 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 123, type h, adr 40044, len 8 for device SolarEdgeWR reading C_Version, read buffer empty
2018.10.25 06:04:47 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 06:04:47 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 103, type h, adr 40052, len 16 for device SolarEdgeWR reading C_SerialNumber, read buffer empty
2018.10.25 06:04:49 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 06:04:49 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 56, type h, adr 40068, len 1 for device SolarEdgeWR reading C_DeviceAddress, read buffer empty
2018.10.25 06:04:51 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 06:04:51 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 3, type h, adr 40069, len 1 for device SolarEdgeWR reading C_PhaseDesign, read buffer empty
2018.10.25 06:04:51 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 06:04:53 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 06:04:53 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 187, type h, adr 40070, len 1 for device SolarEdgeWR reading C_SunSpec_Length, read buffer empty
2018.10.25 06:05:37 3: Opening SolarEdgeWR device 192.168.10.99:502
2018.10.25 06:05:37 3: SolarEdgeWR device opened
...
2018.10.25 06:07:42 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 06:07:43 3: 192.168.10.99:502 reappeared (SolarEdgeWR)
...
2018.10.25 10:46:46 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 10:46:48 3: 192.168.10.99:502 reappeared (SolarEdgeWR)
...
2018.10.25 10:48:46 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 10:48:47 3: 192.168.10.99:502 reappeared (SolarEdgeWR)
...
2018.10.25 10:50:46 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 10:50:51 3: 192.168.10.99:502 reappeared (SolarEdgeWR)
...
2018.10.25 10:52:46 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 10:52:47 3: 192.168.10.99:502 reappeared (SolarEdgeWR)
...
2018.10.25 10:56:12 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 10:56:13 3: 192.168.10.99:502 reappeared (SolarEdgeWR)

Durch den set-Befehl "reread" (ggfs. mehrfach) kann ich das Problem meist beheben und die Werte werden wieder gelesen. Weißt du woran das liegen könnte oder wie man das Problem behebt? Am Netzwerk habe ich in der Zeit eigentlich nichts verändert und vorher hatte ich diese Probleme (dass die Werte nicht mehr geladen werden) nicht.

Grüße,
Philipp
Raspberry Pi B+, FS20, 1-Wire, HM
FHEM Home Control (App für Windows 10): https://forum.fhem.de/index.php/topic,49891.0.html
FHEM Arduino Library: https://forum.fhem.de/index.php/topic,94093.0.html

Offline StefanStrobel

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1866
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #65 am: 25 Oktober 2018, 16:14:09 »
Hallo Philipp,

zu den Verbindungsabbrüchen:
es ist normal wenn der Modbus-Slave (der ja der TCP-Server ist und Port 502 anbietet) nach einem Timeout die Verbindungen schließt. 2 Minuten sind dabei nicht selten. In einer älteren Version des Moduls hatte ich das mit Loglevel 4 oder 5 protokolliert. Ohne verbose 4 oder 5 hat man das nicht bemerkt. In neueren Versionen wird disconnected und reappeared protokolliert, es sei denn man setzt silentReconnect auf 1.
Das sollte jedoch keine Auswirkungen auf die Abfragen haben. Das Modul sollte bei Bedarf automatisch eine neue Verbindung öffnen. Falls das nicht funktioniert, wäre ein Log mit verbose 5 hilfreich, in dem man sieht, was beim Beginn der Abfragen passiert.

Zu den Attributen für die Objekte:
Solange sich die Scale-Faktoren selten ändern wird alles gut funktionieren. Es kann aber bei Deiner Konfiguration passieren, dass Du zuerst einen Wert abfragst, dann ändert sich der Scale-Fator bevor er gelesen wird und dann passt der gelesene Scale-Faktor nicht zum eigentlichen Wert.
Deshalb habe ich hier ein alternatives Verfahren empfohlen, bei dem die Register mit den Werten und dem Scale-Faktur gleichzeitig gelesen werden.

Gruss
   Stefan

Offline kingmathers

  • Full Member
  • ***
  • Beiträge: 284
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #66 am: 25 Oktober 2018, 16:23:34 »
Danke für die Antwort, dann werde ich das nochmal weiter beobachten.

Ich habe noch nicht alles umgestellt, aber folgende Werte werden doch gleichzeitig (Wert und Scale Factor) gelesen oder?:

   obj-h40083-expr $val[0] * (10 ** $val[1])
   obj-h40083-len 2
   obj-h40083-reading I_AC_Power
   obj-h40083-unpack s>s>
   obj-h40085-expr $val[0] * (10 ** $val[1])
   obj-h40085-len 2
   obj-h40085-reading I_AC_Frequency
   obj-h40085-unpack ns>
   obj-h40087-expr $val[0] * (10 ** $val[1])
   obj-h40087-len 2
   obj-h40087-reading I_AC_VA
   obj-h40087-unpack s>s>
   obj-h40089-expr $val[0] * (10 ** $val[1])
   obj-h40089-len 2
   obj-h40089-reading I_AC_VAR
   obj-h40089-unpack s>s>
   obj-h40091-expr $val[0] * (10 ** $val[1])
   obj-h40091-len 2
   obj-h40091-reading I_AC_PF
   obj-h40091-unpack s>s>
Raspberry Pi B+, FS20, 1-Wire, HM
FHEM Home Control (App für Windows 10): https://forum.fhem.de/index.php/topic,49891.0.html
FHEM Arduino Library: https://forum.fhem.de/index.php/topic,94093.0.html

Offline StefanStrobel

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1866
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #67 am: 25 Oktober 2018, 17:16:16 »
Hallo Philipp,

Jedes Objekt wird mit einem eigenen Request abgefragt, es sei denn Du hast dem Modul erlaubt, mehrere Requests zu kombinieren (dev-h-combine). Aber selbst dann werden die Gelesenen Daten nacheinander geparsed. Da die Werte vor dem Scale-Faktor stehen, wird in der Perl-Expression zur Berechnung des tatsächlichen Wertes der Scale-Faktor aus der letzten Lese-Runde verwendet. Erst danach wird der neu gelesene Scale-Faktor in sein Reading geschrieben.

Deshalb habe ich empfohlen, ein Objekt mit größerer Länge zu definieren, so dass die Register für die Werte und den zugehörigen Scale-Faktor tatsächlich mit einem einzigen Request gelesen werden.

Gruß
    Stefan

Offline kingmathers

  • Full Member
  • ***
  • Beiträge: 284
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #68 am: 25 Oktober 2018, 17:24:18 »
Hallo Stefan,

also prinzipiell ist es für mich ja ok, wenn verschiedene, unabhängige Werte nicht gleichzeitig abgefragt werden. Ich wollte vor allem Werte mit Scaling Factor gleichzeitig abfragen. In der Vergangenheit hatte ich oft das Problem, dass nur einer der beiden Werte sich geändert hatte und ich dann von z.B. 3 kW auf 30kW oder 300 Watt gesprungen bin.

obj-h40083-expr $val[0] * (10 ** $val[1])
obj-h40083-len 2
obj-h40083-reading I_AC_Power
obj-h40083-unpack s>s>

Mit diesen Attributen mache ich doch genau dies (ein request liest beide Werte aus) oder?

Ich weiß, dass ich das noch nicht für alle Werte umgestellt habe weil ich es erstmal mit den einfachen probieren wollte.

Gruß,
Philipp
Raspberry Pi B+, FS20, 1-Wire, HM
FHEM Home Control (App für Windows 10): https://forum.fhem.de/index.php/topic,49891.0.html
FHEM Arduino Library: https://forum.fhem.de/index.php/topic,94093.0.html

Offline StefanStrobel

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1866
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #69 am: 25 Oktober 2018, 20:56:51 »
Genau.

so wird holding register 40083 zusammen mit 40084 gelesen.
Wenn das bei Dir schon funktioniert, musst Du es nur noch bei den anderen Werten entsprechend umbauen :-)

Gruss
   Stefan

Offline kingmathers

  • Full Member
  • ***
  • Beiträge: 284
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #70 am: 25 Oktober 2018, 23:34:17 »
Danke! Da ich vor allem I_AC_Power auswerte, war es mir da besonders wichtig da die richtigen Werte zu kriegen.

Seit 3 Tagen habe ich jetzt immer gegen 20:00 (± 2 min) Uhr das Problem, dass der state zu "opened" wechselt und die readings sich nicht mehr aktualisieren.

Folgendes stand im Log:

2018.10.25 19:57:49 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 19:57:49 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 82, type h, adr 40000, len 4 for device SolarEdgeWR reading C_SunSpec_ID, read buffer empty
2018.10.25 19:57:51 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 19:57:51 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 151, type h, adr 40004, len 16 for device SolarEdgeWR reading C_Manufacturer, read buffer empty
2018.10.25 19:57:53 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 19:57:53 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 206, type h, adr 40020, len 16 for device SolarEdgeWR reading C_Model, read buffer empty
2018.10.25 19:57:55 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 19:57:55 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 237, type h, adr 40044, len 8 for device SolarEdgeWR reading C_Version, read buffer empty
2018.10.25 19:57:57 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 19:57:57 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 223, type h, adr 40052, len 16 for device SolarEdgeWR reading C_SerialNumber, read buffer empty
2018.10.25 19:57:59 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 19:57:59 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, type h, adr 40068, len 1 for device SolarEdgeWR reading C_DeviceAddress, read buffer empty
2018.10.25 19:58:01 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 19:58:01 3: SolarEdgeWR: ResponseTimeout called, devhash=HASH(0x3f06560), name of devhash=SolarEdgeWR
2018.10.25 19:58:01 3: SolarEdgeWR: Timeout waiting for a modbus response, request: id 1, fCode 3, tid 101, type h, adr 40069, len 1 for device SolarEdgeWR reading C_PhaseDesign, read buffer empty
2018.10.25 19:58:47 3: Opening SolarEdgeWR device 192.168.10.99:502
2018.10.25 19:58:48 3: SolarEdgeWR device opened
...
2018.10.25 20:00:53 3: 192.168.10.99:502 disconnected, waiting to reappear (SolarEdgeWR)
2018.10.25 20:00:55 3: 192.168.10.99:502 reappeared (SolarEdgeWR)
(wird alle paar Minuten wiederholt)

Ist anhand der Daten eine Erklärung möglich? Ich stelle jetzt einmal verbose auf 5 und kann dann morgen hoffentlich mehr sehen.
Raspberry Pi B+, FS20, 1-Wire, HM
FHEM Home Control (App für Windows 10): https://forum.fhem.de/index.php/topic,49891.0.html
FHEM Arduino Library: https://forum.fhem.de/index.php/topic,94093.0.html

Offline StefanStrobel

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1866
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #71 am: 26 Oktober 2018, 07:46:00 »
Hallo  Philipp,

jetzt wäre es sehr spannend zu sehen, was kurz vor den ersten Fehlermeldungen im Log steht.
Kannst Du mal mit verbose 5 den Ausschnitt zwischen dem letzten Erfolgreichen Abruf und der ersten Fehlermeldung posten?

Gruss
   Stefan

Offline StefanStrobel

  • Developer
  • Hero Member
  • ****
  • Beiträge: 1866
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #72 am: 26 Oktober 2018, 13:01:20 »
Hallo Philipp,

vermutlich ist Dein Problem ein Bug gewesen, der jetzt behoben sein sollte.
Ich habe gerade eine neue Version gepostet.

Gruss
   Stefan

Offline pejonp

  • Hero Member
  • *****
  • Beiträge: 1340
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #73 am: 26 Oktober 2018, 22:37:34 »
Hallo Stefan,

ich wollte die Funktionen gerne in einem Modul haben. siehe Anlage. Das auslesen der Werte funktioniert. Nur das schreiben/setzen der Readings nicht. Ich habe im Modul eine extra Funktion geschrieben die die Readings setzen soll. Es kommen Fehler, die Reading werden gesetzt, aber es werden dann keine weiteren Register mehr ausgelesen.

MODULEVERSION Modbus 4.0.13 - 26.10.2018

2018.10.26 22:15:20 3: lg868 device opened
2018.10.26 22:15:22 1: readingsUpdate(SEdge,CurrentBlock2,5 0 0 0 0 -2) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VoltageAB,0.00 V) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VoltageBC,0.00 V) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VoltageCA,0.00 V) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VoltageAN,237.00 V) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VoltageBN,237.00 V) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VoltageCN,237.00 V) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_Voltage_SF,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_Power,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_Power_SF,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_Frequency,50 Hz) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_Frequency_SF,65534) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VA,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VA_SF,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VAR,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_VAR_SF,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_PF,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_PF_SF,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_Energie_WH_kWh,18029.26 kWh) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_AC_Energy_WH_SF,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_DC_Current,65535.00 A) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_DC_Current_SF,32768) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_DC_Voltage,0.00 V) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)
2018.10.26 22:15:22 1: readingsUpdate(SEdge,I_DC_Voltage_SF,0) missed to call readingsBeginUpdate first.
2018.10.26 22:15:22 1: stacktrace:
2018.10.26 22:15:22 1:     main::readingsBulkUpdate            called by ./FHEM/98_Modbus.pm (2426)
2018.10.26 22:15:22 1:     main::ModbusLD_ParseObj             called by ./FHEM/98_Modbus.pm (2116)
2018.10.26 22:15:22 1:     main::Modbus_HandleResponse         called by ./FHEM/98_Modbus.pm (1796)
2018.10.26 22:15:22 1:     main::Modbus_Read                   called by fhem.pl (3599)
2018.10.26 22:15:22 1:     main::CallFn                        called by fhem.pl (726)

Was mache ich falsch ? Was muss geändert werden ? Wenn ich diese Abfrage nicht ins Modul lege sondern als Konfig ins fhem.cfg geht es.

attr SEdge userattr obj-h40087-expr obj-h40087-len obj-h40087-reading obj-h40087-unpack verbose
attr SEdge obj-h40087-expr readingsBulkUpdate($hash, 'AC_VA', $val[0] * 10 ** $val[1])
attr SEdge obj-h40087-len 2
attr SEdge obj-h40087-reading VABlock
attr SEdge obj-h40087-unpack ns>

Es kommt auch ein Fehler beim Start von FHEM, aber die Readings werden gesetzt und danach geht es ohne Fehler weiter.

2018.10.26 22:28:22 3: SEdge: defined with id 3, interval 60, protocol RTU, mode master, connection to 192.168.2.7:20108
2018.10.26 22:28:22 1: readingsUpdate(SEdge,AC_VA,0) missed to call readingsBeginUpdate first.
2018.10.26 22:28:22 1: stacktrace:
2018.10.26 22:28:22 1:     main::readingsBulkUpdate            called by (eval 73) (1)
2018.10.26 22:28:22 1:     (eval)                              called by ./FHEM/98_Modbus.pm (741)
2018.10.26 22:28:22 1:     main::ModbusLD_Attr                 called by fhem.pl (3599)
2018.10.26 22:28:22 1:     main::CallFn                        called by fhem.pl (2871)
2018.10.26 22:28:22 1:     main::CommandAttr                   called by fhem.pl (1216)
2018.10.26 22:28:22 1:     main::AnalyzeCommand                called by fhem.pl (1062)
2018.10.26 22:28:22 1:     main::AnalyzeCommandChain           called by fhem.pl (1357)
2018.10.26 22:28:22 1:     main::CommandInclude                called by fhem.pl (580)
sh: 1: [0]: not found
....
2018.10.26 22:32:25 4: SEdge: ProcessRequestQueue got pdu from PackRequest: 039c6c001a
2018.10.26 22:32:25 5: SEdge: PackFrame called from ProcessRequestQueue id 3, pdu 039c6c001a
2018.10.26 22:32:25 4: SEdge: ProcessRequestQueue (V4.0.13 - 26.10.2018) sending, request: id 3, fCode 3, type h, adr 40044, len 26 for device SEdge reading C_Version, read buffer empty
2018.10.26 22:32:25 5: SW: 03039c6c001a2bae
2018.10.26 22:32:25 5: SEdge: read buffer: 030334303030322e31303533000000000000003745313832304541000000000000000000000000000000000000000000000000000300670bad
2018.10.26 22:32:25 5: SEdge: ParseFrameStart (RTU) extracted id 3, fCode 3 and data 34303030322e3130353300000000000000374531383230454100000000000000000000000000000000000000000000000000030067
2018.10.26 22:32:25 5: SEdge: HandleResponse called from Read
2018.10.26 22:32:25 5: SEdge: ParseResponse called from HandleResponse
2018.10.26 22:32:25 5: SEdge: CheckChecksum (called from HandleResponse): 0bad is valid
2018.10.26 22:32:25 5: SEdge: HandleResponse now passing to logical device SEdge for parsing data
2018.10.26 22:32:25 5: SEdge: ParseObj called with data 303030322e3130353300000000000000374531383230454100000000000000000000000000000000000000000000000000030067, type h, adr 40044, valuesLen 26, op read
2018.10.26 22:32:25 5: SEdge: ParseObj ObjInfo for h40044: reading=C_Version, unpack=a8, expr=$val =~ s/[\00]+//gr, format=, map=
2018.10.26 22:32:25 5: SEdge: ParseObj unpacked 303030322e3130353300000000000000374531383230454100000000000000000000000000000000000000000000000000030067 with a8 to 0002.105 hex 303030322e313035
2018.10.26 22:32:25 5: SEdge: CheckEval for ModbusLD_ParseObj evaluates expr for C_Version, val=0002.105, expr=$val =~ s/[\00]+//gr
2018.10.26 22:32:25 5: SEdge: CheckEval for ModbusLD_ParseObj result is 0002.105
2018.10.26 22:32:25 4: SEdge: ParseObj assigns value 0002.105 to C_Version
2018.10.26 22:32:25 5: SEdge: ParseObj moves to next object, skip 4 to h40048
2018.10.26 22:32:25 5: SEdge: ParseObj has no information about parsing h40048
2018.10.26 22:32:25 5: SEdge: ParseObj moves to next object, skip 1 to h40049
2018.10.26 22:32:25 5: SEdge: ParseObj has no information about parsing h40049
2018.10.26 22:32:25 5: SEdge: ParseObj moves to next object, skip 1 to h40050
2018.10.26 22:32:25 5: SEdge: ParseObj has no information about parsing h40050
2018.10.26 22:32:25 5: SEdge: ParseObj moves to next object, skip 1 to h40051
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40051
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40052
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40052: reading=C_SerialNumber, unpack=a16, expr=$val =~ s/[\00]+//gr, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 374531383230454100000000000000000000000000000000000000000000000000030067 with a16 to 7E1820EA hex 37453138323045410000000000000000
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj evaluates expr for C_SerialNumber, val=7E1820EA, expr=$val =~ s/[\00]+//gr
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj result is 7E1820EA
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 7E1820EA to C_SerialNumber
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 8 to h40060
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40060
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40061
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40061
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40062
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40062
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40063
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40063
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40064
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40064
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40065
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40065
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40066
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40066
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40067
2018.10.26 22:32:26 5: SEdge: ParseObj has no information about parsing h40067
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40068
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40068: reading=C_DeviceAddress, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 00030067 with n to 3 hex 33
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 3 to C_DeviceAddress
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40069
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40069: reading=C_SunSpec_DID, unpack=n, expr=, format=, map=101:Einphasig, 102:Spaltphase1, 103:Dreiphasig
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 0067 with n to 103 hex 313033
2018.10.26 22:32:26 5: SEdge: MapConvert called from ModbusLD_ParseObj converted 103 to Dreiphasig with map 101:Einphasig, 102:Spaltphase1, 103:Dreiphasig
2018.10.26 22:32:26 5: SEdge: ParseObj for C_SunSpec_DID maps value 103 to Dreiphasig with 101:Einphasig, 102:Spaltphase1, 103:Dreiphasig
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value Dreiphasig to C_SunSpec_DID
2018.10.26 22:32:26 5: SEdge: HandleResponse got 4 readings from ParseObj for SEdge
2018.10.26 22:32:26 4: SEdge: ResponseDone, request: id 3, fCode 3, type h, adr 40044, len 26 for device SEdge reading C_Version, Current read buffer: 030334303030322e31303533000000000000003745313832304541000000000000000000000000000000000000000000000000000300670bad, Id 3, fCode 3, response: id 3, fCode 3, type h, adr 40044, len 26, value 303030322e3130353300000000000000374531383230454100000000000000000000000000000000000000000000000000030067
2018.10.26 22:32:26 5: SEdge: DropFrame - drop 030334303030322e31303533000000000000003745313832304541000000000000000000000000000000000000000000000000000300670bad
2018.10.26 22:32:26 5: SEdge: StartQueueTimer called form Read sets internal timer to call Modbus_ProcessRequestQueue in 0.000 seconds
2018.10.26 22:32:26 5: SEdge: ProcessRequestQueue called from HandleTimeout as queue:SEdge
2018.10.26 22:32:26 5: SEdge: StopQueueTimer called from ProcessRequestQueue removes internal timer to call Modbus_ProcessRequestQueue
2018.10.26 22:32:26 5: SEdge: CheckDelay called from ProcessRequestQueue commDelay (0.1s since 22:32:25.966) for SEdge, delay over
2018.10.26 22:32:26 5: SEdge: CheckDelay called from ProcessRequestQueue sendDelay (0.1s since 22:32:25.939) for SEdge, delay over
2018.10.26 22:32:26 5: SEdge: PackRequest called from ProcessRequestQueue
2018.10.26 22:32:26 4: SEdge: ProcessRequestQueue got pdu from PackRequest: 039c87001d
2018.10.26 22:32:26 5: SEdge: PackFrame called from ProcessRequestQueue id 3, pdu 039c87001d
2018.10.26 22:32:26 4: SEdge: ProcessRequestQueue (V4.0.13 - 26.10.2018) sending, request: id 3, fCode 3, type h, adr 40071, len 29 for device SEdge reading CurrentBlock2, read buffer empty
2018.10.26 22:32:26 5: SW: 03039c87001d1a58
2018.10.26 22:32:26 5: SEdge: read buffer: 03033a0000000000000000fffe0199019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000a861
2018.10.26 22:32:26 5: SEdge: ParseFrameStart (RTU) extracted id 3, fCode 3 and data 3a0000000000000000fffe0199019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000
2018.10.26 22:32:26 5: SEdge: HandleResponse called from Read
2018.10.26 22:32:26 5: SEdge: ParseResponse called from HandleResponse
2018.10.26 22:32:26 5: SEdge: CheckChecksum (called from HandleResponse): a861 is valid
2018.10.26 22:32:26 5: SEdge: HandleResponse now passing to logical device SEdge for parsing data
2018.10.26 22:32:26 5: SEdge: ParseObj called with data 0000000000000000fffe0199019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000, type h, adr 40071, valuesLen 29, op read
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40071: reading=CurrentBlock2, unpack=nnnns>, expr=@val." ".$val[0]." ".$val[1]." ".$val[2]." ".$val[3]." ".$val[4], format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 0000000000000000fffe0199019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with nnnns> to 0 hex 30, 0 hex 30, 0 hex 30, 0 hex 30, -2 hex 2d32
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj evaluates expr for CurrentBlock2, val=0 0 0 0 -2, expr=@val." ".$val[0]." ".$val[1]." ".$val[2]." ".$val[3]." ".$val[4]
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj result is 5 0 0 0 0 -2
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 5 0 0 0 0 -2 to CurrentBlock2
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 5 to h40076
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40076: reading=I_AC_VoltageAB, unpack=n, expr=, format=%.2f V, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 0199019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 409 hex 343039
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageAB does sprintf with format %.2f V, value is 409
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageAB sprintf result is 409.00 V
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 409.00 V to I_AC_VoltageAB
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40077
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40077: reading=I_AC_VoltageBC, unpack=n, expr=, format=%.2f V, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 410 hex 343130
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageBC does sprintf with format %.2f V, value is 410
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageBC sprintf result is 410.00 V
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 410.00 V to I_AC_VoltageBC
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40078
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40078: reading=I_AC_VoltageCA, unpack=n, expr=, format=%.2f V, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 411 hex 343131
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageCA does sprintf with format %.2f V, value is 411
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageCA sprintf result is 411.00 V
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 411.00 V to I_AC_VoltageCA
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40079
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40079: reading=I_AC_VoltageAN, unpack=n, expr=, format=%.2f V, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 236 hex 323336
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageAN does sprintf with format %.2f V, value is 236
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageAN sprintf result is 236.00 V
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 236.00 V to I_AC_VoltageAN
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40080
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40080: reading=I_AC_VoltageBN, unpack=n, expr=, format=%.2f V, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 237 hex 323337
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageBN does sprintf with format %.2f V, value is 237
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageBN sprintf result is 237.00 V
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 237.00 V to I_AC_VoltageBN
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40081
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40081: reading=I_AC_VoltageCN, unpack=n, expr=, format=%.2f V, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 236 hex 323336
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageCN does sprintf with format %.2f V, value is 236
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_VoltageCN sprintf result is 236.00 V
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 236.00 V to I_AC_VoltageCN
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40082
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40082: reading=I_AC_Voltage_SF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_AC_Voltage_SF
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40083
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40083: reading=I_AC_Power, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 000000001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_AC_Power
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40084
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40084: reading=I_AC_Power_SF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 00001385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_AC_Power_SF
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40085
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40085: reading=I_AC_Frequency, unpack=n, expr=$val/100, format=%.f Hz, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 1385fffe00000000000000000000000001131aca0000ffff800000000000 with n to 4997 hex 34393937
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj evaluates expr for I_AC_Frequency, val=4997, expr=$val/100
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj result is 49.97
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_Frequency does sprintf with format %.f Hz, value is 49.97
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_Frequency sprintf result is 50 Hz
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 50 Hz to I_AC_Frequency
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40086
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40086: reading=I_AC_Frequency_SF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked fffe00000000000000000000000001131aca0000ffff800000000000 with n to 65534 hex 3635353334
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 65534 to I_AC_Frequency_SF
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40087
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40087: reading=VABlock, unpack=ns>, expr=readingsBulkUpdate($hash, 'AC_VA', $val[0] * 10 ** $val[1]), format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 00000000000000000000000001131aca0000ffff800000000000 with ns> to 0 hex 30, 0 hex 30
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj evaluates expr for VABlock, val=0 0, expr=readingsBulkUpdate($hash, 'AC_VA', $val[0] * 10 ** $val[1])
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj result is AC_VA: 0
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value AC_VA: 0 to VABlock
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 2 to h40089
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40089: reading=I_AC_VAR, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 000000000000000001131aca0000ffff800000000000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_AC_VAR
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40090
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40090: reading=I_AC_VAR_SF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 00000000000001131aca0000ffff800000000000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_AC_VAR_SF
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40091
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40091: reading=I_AC_PF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 0000000001131aca0000ffff800000000000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_AC_PF
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40092
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40092: reading=I_AC_PF_SF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 000001131aca0000ffff800000000000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_AC_PF_SF
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40093
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40093: reading=I_AC_Energie_WH_kWh, unpack=l>, expr=$val / 1000, format=%.2f kWh, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 01131aca0000ffff800000000000 with l> to 18029258 hex 3138303239323538
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj evaluates expr for I_AC_Energie_WH_kWh, val=18029258, expr=$val / 1000
2018.10.26 22:32:26 5: SEdge: CheckEval for ModbusLD_ParseObj result is 18029.258
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_Energie_WH_kWh does sprintf with format %.2f kWh, value is 18029.258
2018.10.26 22:32:26 5: SEdge: ParseObj for I_AC_Energie_WH_kWh sprintf result is 18029.26 kWh
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 18029.26 kWh to I_AC_Energie_WH_kWh
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 2 to h40095
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40095: reading=I_AC_Energy_WH_SF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 0000ffff800000000000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_AC_Energy_WH_SF
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40096
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40096: reading=I_DC_Current, unpack=n, expr=, format=%.2f A, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked ffff800000000000 with n to 65535 hex 3635353335
2018.10.26 22:32:26 5: SEdge: ParseObj for I_DC_Current does sprintf with format %.2f A, value is 65535
2018.10.26 22:32:26 5: SEdge: ParseObj for I_DC_Current sprintf result is 65535.00 A
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 65535.00 A to I_DC_Current
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40097
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40097: reading=I_DC_Current_SF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 800000000000 with n to 32768 hex 3332373638
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 32768 to I_DC_Current_SF
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40098
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40098: reading=I_DC_Voltage, unpack=n, expr=, format=%.2f V, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 00000000 with n to 0 hex 30
2018.10.26 22:32:26 5: SEdge: ParseObj for I_DC_Voltage does sprintf with format %.2f V, value is 0
2018.10.26 22:32:26 5: SEdge: ParseObj for I_DC_Voltage sprintf result is 0.00 V
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0.00 V to I_DC_Voltage
2018.10.26 22:32:26 5: SEdge: ParseObj moves to next object, skip 1 to h40099
2018.10.26 22:32:26 5: SEdge: ParseObj ObjInfo for h40099: reading=I_DC_Voltage_SF, unpack=n, expr=, format=, map=
2018.10.26 22:32:26 5: SEdge: ParseObj unpacked 0000 with n to 0 hex 30
2018.10.26 22:32:26 4: SEdge: ParseObj assigns value 0 to I_DC_Voltage_SF
2018.10.26 22:32:26 5: SEdge: HandleResponse got 23 readings from ParseObj for SEdge
2018.10.26 22:32:26 4: SEdge: ResponseDone, request: id 3, fCode 3, type h, adr 40071, len 29 for device SEdge reading CurrentBlock2, Current read buffer: 03033a0000000000000000fffe0199019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000a861, Id 3, fCode 3, response: id 3, fCode 3, type h, adr 40071, len 29, value 0000000000000000fffe0199019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000
2018.10.26 22:32:26 5: SEdge: DropFrame - drop 03033a0000000000000000fffe0199019a019b00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff800000000000a861
2018.10.26 22:32:59 5: SEdge: read buffer: 03031400000000000000008000000080008000fffe0002ffe5
2018.10.26 22:32:59 5: SEdge: ParseFrameStart (RTU) extracted id 3, fCode 3 and data 1400000000000000008000000080008000fffe0002
2018.10.26 22:32:59 3: SEdge: read got new data while idle, drop buffer 03031400000000000000008000000080008000fffe0002ffe5
2018.10.26 22:32:59 5: SEdge: read buffer: 03033c0003006700320000000000000000fffe0199019a019a00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff8000a8ee
2018.10.26 22:32:59 5: SEdge: ParseFrameStart (RTU) extracted id 3, fCode 3 and data 3c0003006700320000000000000000fffe0199019a019a00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff8000
2018.10.26 22:32:59 3: SEdge: read got new data while idle, drop buffer 03033c0003006700320000000000000000fffe0199019a019a00ec00ed00ec0000000000001385fffe00000000000000000000000001131aca0000ffff8000a8ee

Tschüß Jörg
LaCrossGW 868MHz:WT470+TFA+TX37-IT+EMT7110+W136+WH25A HP1003+WH2621
SignalD(CC1101):Bresser+WS-0101(868MHz WH1080)+Velux KLF200+MAX!+HM-MOD-UART:Smoke HM-SEC-SD+VITOSOLIC 200 RESOL VBUS-LAN+SolarEdge SE5K(Modbus)+Sonnen!eco8(10kWh)+TD3511+DRT710M(Modbus)+ZigBee+Z-Wave+MQTT+vitoconnect

Offline Benni

  • Developer
  • Hero Member
  • ****
  • Beiträge: 2463
  • FHEMinist
Antw:ModbusAttr an Wechselrichter SolarEdge SE10k [gelöst]
« Antwort #74 am: 26 Oktober 2018, 22:47:29 »
Das auslesen der Werte funktioniert. Nur das schreiben/setzen der Readings nicht. Ich habe im Modul eine extra Funktion geschrieben die die Readings setzen soll. Es kommen Fehler, die Reading werden gesetzt, aber es werden dann keine weiteren Register mehr ausgelesen.

Ah! Das sind die gleichen Meldungen, die ich bekommen hatte. Das war dann auch der Grund, weshalb ich das readingsBeginUpdate und das readingsEndUpdate direkt in meine expression eingebaut hatte:

https://forum.fhem.de/index.php/topic,80767.msg848823.html#msg848823

gb#

 

decade-submarginal