ArduCounter Support und neue Versionen (war: Stromzähler mit S0 Schnitt...)

Begonnen von StefanStrobel, 26 Januar 2014, 12:08:13

Vorheriges Thema - Nächstes Thema

thymjan

Hallo Stefan,

hier mein list ACT (history und levels sind noch aktiv, ist das ein Problem?):

Internals:
   Board      T-Display
   BoardDet   Espressif ESP32 Dev Module with display
   DEF        192.168.1.161:80
   DeviceName 192.168.1.161:80
   FD         24
   FUUID      6366ee98-f33f-c6f0-bea1-1c54d9f5c80481f6
   HistIdx    10
   Initialized 1
   LASTOPEN   1669054598.65708
   LastHistSeq 8497
   NAME       ACT
   NOTIFYDEV  global
   NR         291
   NTFY_ORDER 50-ACT
   PARTIAL   
   STATE      State: opened
<br>
Momentanverbrauch Wärme: 0.069 kW
<br>
Zählerstände Wärme kumuliert: 129007.8 kWh
<br>
zuletzt aktualisiert:
2022-11-21 20:09:15
<br>
RSSI -67 dB
<br>
Wärme
<br>
Now Hour: 0.0 Day: 22.3 Month: 45.1 Year: 45.1 (since: 2022-11-20 )
<br>
Last Hour: 0.1 Day: 22.8 Month: - Year: -
   SketchCompile Jun  6 2020 12:41:51
   TCP        1
   TYPE       ArduCounter
   VersionFirmware 4.26
   VersionModule 8.00 - 21.10.2021
   allowedPins 4,17,21,22,25,26,27,32,33,34,35,36,A0,39
   buffer     
   deviceBooted 1668800248.93236
   devioLoglevel 3
   eventCount 15982
   nextOpenDelay 60
   Helper:
     DBLOG:
       RSSI:
         energydb:
           TIME       1669057892.62505
           VALUE      -67
       calcCounter36f:
         energydb:
           TIME       1669057755.98235
           VALUE      129007.8
       power36:
         energydb:
           TIME       1669057755.98235
           VALUE      0.069
   History:
     Seq   8488 2022-11-21 19:10:23 Pin 36 686.128 seconds at 1 (analog 736) -> gap
     Seq   8489 2022-11-21 19:21:49 Pin 36  29.668 seconds at 0 (analog 552) -> pulse counted
     Seq   8490 2022-11-21 19:22:19 Pin 36 680.296 seconds at 1 (analog 771) -> gap
     Seq   8491 2022-11-21 19:33:39 Pin 36  29.589 seconds at 0 (analog 552) -> pulse counted
     Seq   8492 2022-11-21 19:34:09 Pin 36 677.066 seconds at 1 (analog 770) -> gap
     Seq   8493 2022-11-21 19:45:26 Pin 36  29.968 seconds at 0 (analog 552) -> pulse counted
     Seq   8494 2022-11-21 19:45:56 Pin 36 669.511 seconds at 1 (analog 773) -> gap
     Seq   8495 2022-11-21 19:57:05 Pin 36  29.748 seconds at 0 (analog 551) -> pulse counted
     Seq   8496 2022-11-21 19:57:35 Pin 36 661.812 seconds at 1 (analog 771) -> gap
     Seq   8497 2022-11-21 20:08:37 Pin 36  29.430 seconds at 0 (analog 552) -> pulse counted
   HistoryPin:
     36
     36
     36
     36
     36
     36
     36
     36
     36
     36
   OLDREADINGS:
   READINGS:
     2022-11-21 20:11:32   RSSI            -67
     2022-11-21 20:09:15   calcCounter36   129007.846666667
     2022-11-21 20:09:15   calcCounter36_i 8.29333333333333
     2022-11-21 20:09:15   calcCounter36f  129007.8
     2022-11-21 20:09:15   countDiff36     2
     2022-11-21 20:09:15   interpolatedLong36 11938
     2022-11-21 20:09:15   long36          11316
     2022-11-21 20:09:15   pin36           5097
     2022-11-21 20:09:15   power36         0.069
     2022-11-21 20:09:15   reject36        60
     2022-11-21 20:11:32   statCalcCounter36f Hour: 0.0 Day: 22.3 Month: 45.1 Year: 45.1 (since: 2022-11-20 )
     2022-11-21 19:59:55   statCalcCounter36fLast Hour: 0.1 Day: 22.8 Month: - Year: -
     2022-11-21 20:11:32   statPower36Day  Min: 0.027 Avg: 1.274 Max: 12.135
     2022-11-20 23:59:55   statPower36DayLast Min: 0.053 Avg: 1.002 Max: 10.444
     2022-11-21 20:11:32   statPower36Hour Min: 0.068 Avg: 0.068 Max: 0.069
     2022-11-21 19:59:55   statPower36HourLast Min: 0.066 Avg: 0.067 Max: 0.068
     2022-11-21 20:11:32   statPower36Month Min: 0.027 Avg: 0.906 Max: 12.135 (since: 2022-11-19_12:14:20 )
     2022-11-21 20:11:32   statPower36Year Min: 0.027 Avg: 0.906 Max: 12.135 (since: 2022-11-19_12:14:20 )
     2022-11-21 19:16:38   state           opened
     2022-11-21 20:09:15   timeDiff36      1390501
     2022-11-19 20:37:36   watchdog        ok
   analogLevels:
     438        1
     446        1
     449        1
     450        1
     451        1
     453        3
     454        3
     455        2
     456        7
     457        1
     458        4
     459        2
     460        4
     461        2
     462        4
     463        6
     464        2
     465        6
     466        4
     467        4
     468        4
     469        9
     470        9
     471        8
     472        9
     473        10
     474        16
     475        16
     476        21
     477        16
     478        16
     479        22
     480        17
     481        27
     482        24
     483        27
     484        13
     485        21
     486        20
     487        24
     488        23
     489        27
     490        27
     491        25
     492        35
     493        45
     494        49
     495        54
     496        52
     497        55
     498        65
     499        55
     500        92
     501        115
     502        148
     503        217
     504        265
     505        382
     506        469
     507        658
     508        885
     509        1348
     510        2088
     511        1317
     512        1219
     513        1294
     514        1276
     515        1204
     516        1336
     517        1549
     518        1742
     519        2006
     520        2250
     521        2808
     522        3197
     523        3990
     524        5029
     525        6644
     526        9266
     527        14281
     528        16662
     529        13657
     530        13475
     531        14003
     532        14889
     533        15623
     534        15972
     535        15996
     536        15971
     537        16819
     538        17377
     539        19021
     540        21228
     541        24608
     542        28511
     543        33047
     544        37114
     545        39013
     546        39328
     547        39291
     548        38158
     549        37449
     550        36477
     551        36426
     552        37923
     553        41413
     554        45531
     555        49959
     556        55852
     557        60684
     558        64579
     559        68874
     560        43355
     561        17258
     562        8296
     563        4628
     564        2950
     565        2317
     566        1927
     567        1876
     568        1736
     569        1692
     570        1757
     571        1696
     572        1819
     573        1929
     574        2146
     575        2461
     576        2315
     577        1973
     578        1747
     579        1597
     580        1529
     581        1470
     582        1306
     583        1329
     584        1358
     585        1297
     586        1400
     587        1433
     588        1564
     589        1707
     590        1967
     591        2534
     592        2573
     593        1914
     594        1647
     595        1485
     596        1381
     597        1321
     598        1297
     599        1219
     600        1186
     601        1207
     602        1133
     603        1185
     604        1256
     605        1275
     606        1320
     607        1320
     608        1377
     609        1360
     610        1270
     611        1253
     612        1218
     613        1158
     614        1105
     615        1075
     616        1062
     617        1085
     618        1098
     619        1167
     620        1288
     621        1319
     622        1592
     623        2015
     624        2030
     625        1510
     626        1262
     627        1177
     628        1152
     629        1093
     630        1033
     631        988
     632        1051
     633        1007
     634        1065
     635        1077
     636        1138
     637        1186
     638        1342
     639        1381
     640        1457
     641        1413
     642        1456
     643        1496
     644        1798
     645        1880
     646        2135
     647        2338
     648        2665
     649        2935
     650        3427
     651        4336
     652        5205
     653        6642
     654        9774
     655        15112
     656        18765
     657        15409
     658        14144
     659        13586
     660        13611
     661        13942
     662        14151
     663        14104
     664        13803
     665        14168
     666        14479
     667        15697
     668        17657
     669        19887
     670        22902
     671        25553
     672        28430
     673        29757
     674        30437
     675        30856
     676        31238
     677        31446
     678        31052
     679        30652
     680        30398
     681        30284
     682        31137
     683        32944
     684        35280
     685        40733
     686        51445
     687        71897
     688        78415
     689        60405
     690        50850
     691        47536
     692        46158
     693        45763
     694        45717
     695        43836
     696        42908
     697        42244
     698        42086
     699        42201
     700        44249
     701        48266
     702        53878
     703        59758
     704        61260
     705        58874
     706        57866
     707        58904
     708        60992
     709        62953
     710        63981
     711        63791
     712        62983
     713        63622
     714        63659
     715        64757
     716        67114
     717        72771
     718        84519
     719        109944
     720        116919
     721        95582
     722        89182
     723        86713
     724        85995
     725        84900
     726        81741
     727        78267
     728        75205
     729        73708
     730        71716
     731        72314
     732        73267
     733        75891
     734        79239
     735        81758
     736        82013
     737        81018
     738        80644
     739        80562
     740        81439
     741        82953
     742        82732
     743        82314
     744        80667
     745        80201
     746        81537
     747        85322
     748        93348
     749        108522
     750        138105
     751        192147
     752        206194
     753        160788
     754        138133
     755        126697
     756        122476
     757        122125
     758        121723
     759        122644
     760        123218
     761        126803
     762        130848
     763        135784
     764        142541
     765        151884
     766        164790
     767        177331
     768        182005
     769        182559
     770        180739
     771        178733
     772        177219
     773        176964
     774        176196
     775        175852
     776        178209
     777        184700
     778        194118
     779        208780
     780        229161
     781        259836
     782        312803
     783        416481
     784        434344
     785        338229
     786        301720
     787        287042
     788        285412
     789        288629
     790        291873
     791        294790
     792        299742
     793        306825
     794        315263
     795        325214
     796        333265
     797        342668
     798        352134
     799        356565
     800        350748
     801        338176
     802        325843
     803        317840
     804        314259
     805        312659
     806        308551
     807        303051
     808        299370
     809        301042
     810        304311
     811        310555
     812        320854
     813        344060
     814        391809
     815        492473
     816        471634
     817        334232
     818        270531
     819        234651
     820        213261
     821        198333
     822        185770
     823        175716
     824        169881
     825        170441
     826        172619
     827        179582
     828        187469
     829        198260
     830        211990
     831        223738
     832        208550
     833        176516
     834        151259
     835        134821
     836        125392
     837        117854
     838        113221
     839        109262
     840        106987
     841        107790
     842        110127
     843        112985
     844        116722
     845        123230
     846        135136
     847        156440
     848        129187
     849        78420
     850        58393
     851        47648
     852        40648
     853        35530
     854        31601
     855        28938
     856        26682
     857        24819
     858        23417
     859        21993
     860        21334
     861        20155
     862        19016
     863        17004
     864        14030
     865        11051
     866        8100
     867        5993
     868        4584
     869        3706
     870        3358
     871        3149
     872        3093
     873        3257
     874        3260
     875        3107
     876        2913
     877        2686
     878        2440
     879        2048
     880        782
     881        242
     882        84
     883        31
     884        23
     885        21
     886        15
     887        11
     888        14
     889        13
     890        5
     891        12
     892        6
     893        9
     894        5
   helper:
     _98_statistics Statistik
   runningCfg:
     36         P36fp m50out27t560/640, DR36C5092D1/1T720809X0A30598
     I          30,1800,5,2,0,10
     U          36,75,1,kWh,60,kW
     V          1,0,0,1,0
Attributes:
   board      T-Display
   comment    16.11.22 18 Uhr Counter gestellt
17.11.22 19 Uhr state: disconnected
                Counter gestellt 128920.5 kWh
19.11.22 09 Uhr Impuls auf falling gestellt
                threshold 560,640
                min Impulslänge von 4ms auf 50ms angehoben (bei 6kW ist ein Impuls 270ms lang)
                keepAliveDelay von 30s auf 10s verkürzt (wg. Verbindungsabbrüchen)
                nextOpenDelay von 20s auf 60s erhöht
         13 Uhr userReading connection erstellt, notify auf disconnected
                *** verbose 5 ****
   devStateIcon .*active:15px-orange .*opened:15px-green .*disconnected:15px-red
   deviceDisplay 36,kWh,kW
   disable    0
   enableAnalogDebug 1
   enableHistory 1
   enableSerialEcho 0
   event-on-update-reading state,RSSI,calc.*,connection,power36
   interval   30,1800,5,2,10,3
   keepAliveDelay 10
   keepAliveRetries 3
   keepAliveTimeout 3
   nextOpenDelay 60
   pin36      falling pullup min 50 analog out 27 threshold 560,640
   pulsesPerKWh 75
   room       ArduCounter ACT
   stateFormat State: [$name:state]
<br>
Momentanverbrauch Wärme: [$name:power36] kW
<br>
Zählerstände Wärme kumuliert: [$name:calcCounter36f] kWh
<br>
zuletzt aktualisiert:
[$name:pin36:t]
<br>
RSSI [$name:RSSI] dB
<br>
Wärme
<br>
Now [$name:statCalcCounter36f]
<br>
Last [$name:statCalcCounter36fLast]
   userReadings calcCounter36f:calcCounter36.* {sprintf('%.1f',ReadingsNum($name,"calcCounter36",0))}
   verbose    5


Habe parallel noch ein Presence Modul auf die IP des ArduCounters angelegt. Auf den Ping antwortet er ständig, obwohl ArduCounter sagt, die Verbindung sei unterbrochen.

Im unten angehängten RSSI chart kann man die heutigen Verbindungsabbrüche vom ArduCounter Modul erkennen.

Gruß
thymjan

StefanStrobel

Hallo thymjan,

als Du das list erzeugt hast, war er aber verbunden oder?
state steht ja noch auf open.

Bitte gib doch mal folgendes in die Eingabeleiste ein, sobald er wieder auf disconnected steht, dann sehen wir ob er auf der Liste der Geräte steht, zu denen die Verbindung wieder aufgebaut werden soll:

{join "\n", keys %readyfnlist}

Dazu nochmal ein list hilft hoffentlich bei der Eingrenzung...

Gruss / Thanx
   Stefan

thymjan

Zitatals Du das list erzeugt hast, war er aber verbunden oder?
Ja, das Modul war verbunden (bzw. auf "opened").

Habe nur die zwei Zustände "opened" und "disconnected". Etwas anderes wird mir nicht angezeigt.
ZitatBitte gib doch mal folgendes in die Eingabeleiste ein, sobald er wieder auf disconnected steht, dann sehen wir ob er auf der Liste der Geräte steht, zu denen die Verbindung wieder aufgebaut werden soll:

Mach ich, danke für s'Kümmern!

Grüße
Stefan

thymjan

Antwort:
act.192.168.1.161:80


Internals:
   Board      T-Display
   BoardDet   Espressif ESP32 Dev Module with display
   DEF        192.168.1.161:80
   DevIoJustClosed 1
   DeviceName 192.168.1.161:80
   FUUID      6366ee98-f33f-c6f0-bea1-1c54d9f5c80481f6
   Initialized 1
   LASTOPEN   1669058198.65751
   NAME       ACT
   NOTIFYDEV  global
   NR         291
   NTFY_ORDER 50-ACT
   STATE      State: disconnected
<br>
Momentanverbrauch Wärme: 0.085 kW
<br>
Zählerstände Wärme kumuliert: 129008.0 kWh
<br>
zuletzt aktualisiert:
2022-11-21 21:55:19
<br>
RSSI -59 dB
<br>
Wärme
<br>
Now Hour: 0.0 Day: 22.5 Month: 45.3 Year: 45.3 (since: 2022-11-20 )
<br>
Last Hour: 0.1 Day: 22.8 Month: - Year: -
   SketchCompile Jun  6 2020 12:41:51
   TCP        1
   TYPE       ArduCounter
   VersionFirmware 4.26
   VersionModule 8.00 - 21.10.2021
   allowedPins 4,17,21,22,25,26,27,32,33,34,35,36,A0,39
   buffer     
   deviceBooted 1668800248.94188
   devioLoglevel 3
   eventCount 16702
   nextOpenDelay 60
   Helper:
     DBLOG:
       RSSI:
         energydb:
           TIME       1669064994.30009
           VALUE      -59
       calcCounter36f:
         energydb:
           TIME       1669064119.40647
           VALUE      129008.0
       power36:
         energydb:
           TIME       1669064119.40647
           VALUE      0.085
   OLDREADINGS:
   READINGS:
     2022-11-21 22:09:54   RSSI            -59
     2022-11-21 21:55:19   calcCounter36   129007.980000001
     2022-11-21 21:55:19   calcCounter36_i 8.29333333333333
     2022-11-21 21:55:19   calcCounter36f  129008.0
     2022-11-21 21:55:19   countDiff36     2
     2022-11-21 21:55:19   interpolatedLong36 11948
     2022-11-21 21:55:19   long36          11326
     2022-11-21 21:55:19   pin36           5107
     2022-11-21 21:55:19   power36         0.085
     2022-11-21 21:55:19   reject36        60
     2022-11-21 22:10:03   statCalcCounter36f Hour: 0.0 Day: 22.5 Month: 45.3 Year: 45.3 (since: 2022-11-20 )
     2022-11-21 21:59:55   statCalcCounter36fLast Hour: 0.1 Day: 22.8 Month: - Year: -
     2022-11-21 22:10:03   statPower36Day  Min: 0.027 Avg: 1.167 Max: 12.135
     2022-11-20 23:59:55   statPower36DayLast Min: 0.053 Avg: 1.002 Max: 10.444
     2022-11-21 22:10:03   statPower36Hour Min: 0.085 Avg: 0.085 Max: 0.085
     2022-11-21 21:59:55   statPower36HourLast Min: 0.071 Avg: 0.076 Max: 0.085
     2022-11-21 22:10:03   statPower36Month Min: 0.027 Avg: 0.878 Max: 12.135 (since: 2022-11-19_12:14:20 )
     2022-11-21 22:10:03   statPower36Year Min: 0.027 Avg: 0.878 Max: 12.135 (since: 2022-11-19_12:14:20 )
     2022-11-21 22:10:03   state           disconnected
     2022-11-21 21:55:19   timeDiff36      1123573
     2022-11-19 20:37:36   watchdog        ok
   helper:
     _98_statistics Statistik
   runningCfg:
     36         P36fp m50out27t560/640, DR36C5097D0/0T0X0
     I          30,1800,5,2,0,10
     U          36,75,1,kWh,60,kW
     V          0,0,0,0,0
Attributes:
   board      T-Display
   comment    16.11.22 18 Uhr Counter gestellt
17.11.22 19 Uhr state: disconnected
                Counter gestellt 128920.5 kWh
19.11.22 09 Uhr Impuls auf falling gestellt
                threshold 560,640
                min Impulslänge von 4ms auf 50ms angehoben (bei 6kW ist ein Impuls 270ms lang)
                keepAliveDelay von 30s auf 10s verkürzt (wg. Verbindungsabbrüchen)
                nextOpenDelay von 20s auf 60s erhöht
         13 Uhr userReading connection erstellt, notify auf disconnected
                *** verbose 5 ****
21.11.22 20 Uhr verbose 0
                history/levels deaktiviert und gelöscht
   devStateIcon .*active:15px-orange .*opened:15px-green .*disconnected:15px-red
   deviceDisplay 36,kWh,kW
   disable    0
   enableAnalogDebug 0
   enableHistory 0
   enableSerialEcho 0
   event-on-update-reading state,RSSI,calc.*,connection,power36
   interval   30,1800,5,2,10,3
   keepAliveDelay 10
   keepAliveRetries 3
   keepAliveTimeout 3
   nextOpenDelay 60
   pin36      falling pullup min 50 analog out 27 threshold 560,640
   pulsesPerKWh 75
   room       ArduCounter ACT
   stateFormat State: [$name:state]
<br>
Momentanverbrauch Wärme: [$name:power36] kW
<br>
Zählerstände Wärme kumuliert: [$name:calcCounter36f] kWh
<br>
zuletzt aktualisiert:
[$name:pin36:t]
<br>
RSSI [$name:RSSI] dB
<br>
Wärme
<br>
Now [$name:statCalcCounter36f]
<br>
Last [$name:statCalcCounter36fLast]
   userReadings calcCounter36f:calcCounter36.* {sprintf('%.1f',ReadingsNum($name,"calcCounter36",0))}
   verbose    0

StefanStrobel

Hallo Stefan,

ok, jetzt steht er auf disconnected und das Device ist in der readyfnlist eingetragen, d.h. die readyfn wird regelmäßig aufgerufen und sollte regelmäßig open aufrufen.
Das Internal DevIoJustClosed  sollte auch nach kurzer Zeit verschwunden sein. Wenn verbose immer noch auf 5 steht, müsstest Du die Open-Versuche (Eintrag mit HttpUtils) im Log sehen.
Ist das so?
Ist DevIoJustClosed verschwunden?

Gruss
   Stefan

StefanStrobel

Ich denke ich habe das Problem identifiziert.
In der ReadyFn prüfe ich das Internal STATE vor dem Aufruf von Open:

if($hash->{STATE} eq "disconnected") {
...

Bei Dir war aber das stateFormat irgendwie schneller und hat das Internal STATE auf "State: disconnected" gesetzt.
Damit wird kein open mehr aufgerufen.
Ich kläre das mal und korrigiere das.

Gruss
   Stefan


RalfRog

Zitat von: thymjan am 20 November 2022, 10:34:19
...... Innerhalb eines Tages war es jetzt auf eine Nachkommastelle genau (sind knapp 20kWh durchgelaufen).

Macht Mut  ;D    deutlich besser als bei mir am Diditalausgang
FHEM auf Raspi 2B mit nanoCUL, HM-MOD-RPI-PCB und über LAN MAX!Cube mit a-culFW (Stack 868 + 433)
HM- Fensterkontakte, UP-Schalter, Bewegungsmelder und ein Rauchmelder

thymjan

Zitat von: StefanStrobel am 22 November 2022, 16:56:51
ok, jetzt steht er auf disconnected und das Device ist in der readyfnlist eingetragen, d.h. die readyfn wird regelmäßig aufgerufen und sollte regelmäßig open aufrufen.
Das Internal DevIoJustClosed  sollte auch nach kurzer Zeit verschwunden sein. Wenn verbose immer noch auf 5 steht, müsstest Du die Open-Versuche (Eintrag mit HttpUtils) im Log sehen.
Ist das so?
Ist DevIoJustClosed verschwunden?

Momentan hat das ArduCounter-Modul die Verbindung wieder verloren (disconnected).

Habe ein Presence-Modul auf die IP vom ArduCounter eingerichtet:
defmod preACT PRESENCE lan-ping 192.168.1.161
Das zeigt gerade an, das der ESP sichtbar ist.

Aktuelles list ACT:
Internals:
   Board      T-Display
   BoardDet   Espressif ESP32 Dev Module with display
   DEF        192.168.1.161:80
   DevIoJustClosed 1
   DeviceName 192.168.1.161:80
   FUUID      6366ee98-f33f-c6f0-bea1-1c54d9f5c80481f6
   HistIdx    16
   Initialized 1
   LASTOPEN   1669223745.78449
   LastHistSeq 55
   NAME       ACT
   NOTIFYDEV  global
   NR         291
   NTFY_ORDER 50-ACT
   STATE      State: disconnected
<br>
Momentanverbrauch Wärme: 0.069 kW
<br>
Zählerstände Wärme kumuliert: 129065.8 kWh
<br>
zuletzt aktualisiert:
2022-11-23 19:43:46
<br>
RSSI -65 dB
<br>
Wärme
<br>
Now Hour: 0.0 Day: 27.0 Month: 103.1 Year: 103.1 (since: 2022-11-20 )
<br>
Last Hour: 0.0 Day: 29.3 Month: - Year: -
   SketchCompile Jun  6 2020 12:41:51
   TCP        1
   TYPE       ArduCounter
   VersionFirmware 4.26
   VersionModule 8.00 - 21.10.2021
   allowedPins 4,17,21,22,25,26,27,32,33,34,35,36,A0,39
   buffer     
   deviceBooted 1669181320.02069
   devioLoglevel 3
   eventCount 4762
   nextOpenDelay 60
   Helper:
     DBLOG:
       RSSI:
         energydb:
           TIME       1669229446.7916
           VALUE      -65
       calcCounter36f:
         energydb:
           TIME       1669229026.78967
           VALUE      129065.8
       power36:
         energydb:
           TIME       1669229026.78967
           VALUE      0.069
   History:
     Seq     40 2022-11-23 18:09:25 Pin 36 693.792 seconds at 1 (analog 769) -> gap
     Seq     41 2022-11-23 18:20:59 Pin 36  30.821 seconds at 0 (analog 564) -> pulse counted
     Seq     42 2022-11-23 18:21:30 Pin 36 684.668 seconds at 1 (analog 771) -> gap
     Seq     43 2022-11-23 18:32:54 Pin 36  29.508 seconds at 0 (analog 564) -> pulse counted
     Seq     44 2022-11-23 18:33:24 Pin 36 677.781 seconds at 1 (analog 772) -> gap
     Seq     45 2022-11-23 18:44:41 Pin 36  29.924 seconds at 0 (analog 563) -> pulse counted
     Seq     46 2022-11-23 18:45:11 Pin 36 677.556 seconds at 1 (analog 772) -> gap
     Seq     47 2022-11-23 18:56:29 Pin 36  30.306 seconds at 0 (analog 566) -> pulse counted
     Seq     48 2022-11-23 18:56:59 Pin 36 681.493 seconds at 1 (analog 771) -> gap
     Seq     49 2022-11-23 19:08:21 Pin 36  29.877 seconds at 0 (analog 562) -> pulse counted
     Seq     50 2022-11-23 19:08:51 Pin 36 671.778 seconds at 1 (analog 773) -> gap
     Seq     51 2022-11-23 19:20:02 Pin 36  29.407 seconds at 0 (analog 565) -> pulse counted
     Seq     52 2022-11-23 19:20:32 Pin 36 663.079 seconds at 1 (analog 774) -> gap
     Seq     53 2022-11-23 19:31:35 Pin 36  28.785 seconds at 0 (analog 561) -> pulse counted
     Seq     54 2022-11-23 19:32:04 Pin 36 662.926 seconds at 1 (analog 774) -> gap
     Seq     55 2022-11-23 19:43:07 Pin 36  28.744 seconds at 0 (analog 565) -> pulse counted
   HistoryPin:
     36
     36
     36
     36
     36
     36
     36
     36
     36
     36
     36
     36
     36
     36
     36
     36
   READINGS:
     2022-11-23 19:50:46   RSSI            -65
     2022-11-23 19:43:46   calcCounter36   129065.806666667
     2022-11-23 19:43:46   calcCounter36_i 98.1466666666667
     2022-11-23 19:43:46   calcCounter36f  129065.8
     2022-11-23 19:43:46   countDiff36     2
     2022-11-23 19:43:46   interpolatedLong36 21870
     2022-11-23 19:43:46   long36          14509
     2022-11-23 19:43:46   pin36           871
     2022-11-23 19:43:46   power36         0.069
     2022-11-23 19:43:46   reject36        66
     2022-11-23 20:59:55   statCalcCounter36f Hour: 0.0 Day: 27.0 Month: 103.1 Year: 103.1 (since: 2022-11-20 )
     2022-11-23 20:59:55   statCalcCounter36fLast Hour: 0.0 Day: 29.3 Month: - Year: -
     2022-11-23 20:59:55   statPower36Day  Min: 0.026 Avg: 0.603 Max: 10.146
     2022-11-22 23:59:55   statPower36DayLast Min: 0.026 Avg: 1.411 Max: 12.240
     2022-11-23 20:59:55   statPower36Hour Min: 0.069 Avg: 0.069 Max: 0.069
     2022-11-23 20:59:55   statPower36HourLast Min: 0.069 Avg: 0.069 Max: 0.069
     2022-11-23 20:59:55   statPower36Month Min: 0.026 Avg: 0.943 Max: 12.240 (since: 2022-11-19_12:14:20 )
     2022-11-23 20:59:55   statPower36Year Min: 0.026 Avg: 0.943 Max: 12.240 (since: 2022-11-19_12:14:20 )
     2022-11-23 19:50:50   state           disconnected
     2022-11-23 19:43:46   timeDiff36      1383534
     2022-11-19 20:37:36   watchdog        ok
   analogLevels:
     722        1
     729        1
     741        1
     746        2
     747        1
     748        1
     749        1
     751        1
     752        1
     754        1
     756        1
     758        2
     759        1
     760        1
     761        3
     763        1
     764        1
     765        1
     766        2
     769        2
     770        4
     771        4
     772        5
     773        1
     774        2
     775        2
     776        2
     779        1
     780        4
     781        2
     782        3
     783        3
     784        4
     785        2
     787        7
     788        5
     789        3
     790        3
     791        3
     792        5
     793        2
     794        3
     795        1
     796        4
     797        3
     798        4
     799        4
     800        3
     801        1
     802        2
     804        5
     805        4
     806        4
     807        2
     808        1
     809        4
     810        3
     811        1
     812        2
     813        4
     814        6
     815        3
     816        3
     817        4
     818        1
     819        1
     820        2
     821        2
     823        4
     824        3
     825        1
     827        3
     828        2
     830        2
     836        1
     838        2
     840        1
     844        2
     845        1
     846        1
     852        1
   helper:
     _98_statistics Statistik
   runningCfg:
     36         P36fp m50out27t560/640, DR36C863D0/0T0X0
     I          30,1800,5,2,0,10
     U          36,75,1,kWh,60,kW
     V          1,0,0,0,0
Attributes:
   board      T-Display
   comment    16.11.22 18 Uhr Counter gestellt
17.11.22 19 Uhr state: disconnected
                Counter gestellt 128920.5 kWh
19.11.22 09 Uhr Impuls auf falling gestellt
                threshold 560,640
                min Impulslänge von 4ms auf 50ms angehoben (bei 6kW ist ein Impuls 270ms lang)
                keepAliveDelay von 30s auf 10s verkürzt (wg. Verbindungsabbrüchen)
                nextOpenDelay von 20s auf 60s erhöht
         13 Uhr userReading connection erstellt, notify auf disconnected
                *** verbose 5 ****
21.11.22 20 Uhr verbose 0
                history/levels deaktiviert und gelöscht
   devStateIcon .*active:15px-orange .*opened:15px-green .*disconnected:15px-red
   deviceDisplay 36,kWh,kW
   disable    0
   enableAnalogDebug 0
   enableHistory 1
   enableSerialEcho 0
   event-on-update-reading state,RSSI,calc.*,connection,power36
   interval   30,1800,5,2,10,3
   keepAliveDelay 10
   keepAliveRetries 3
   keepAliveTimeout 3
   nextOpenDelay 60
   pin36      falling pullup min 50 analog out 27 threshold 560,640
   pulsesPerKWh 75
   room       ArduCounter ACT
   stateFormat State: [$name:state]
<br>
Momentanverbrauch Wärme: [$name:power36] kW
<br>
Zählerstände Wärme kumuliert: [$name:calcCounter36f] kWh
<br>
zuletzt aktualisiert:
[$name:pin36:t]
<br>
RSSI [$name:RSSI] dB
<br>
Wärme
<br>
Now [$name:statCalcCounter36f]
<br>
Last [$name:statCalcCounter36fLast]
   userReadings calcCounter36f:calcCounter36.* {sprintf('%.1f',ReadingsNum($name,"calcCounter36",0))}
   verbose    5


Und der Auszug aus dem log:

2022.11.23 19:50:26 5: ACT: sending k(eepAlive) to device
2022.11.23 19:50:26 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.23 19:50:26 5: ACT: device sent alive response: AR-66
2022.11.23 19:50:36 5: ACT: sending k(eepAlive) to device
2022.11.23 19:50:36 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.23 19:50:36 5: ACT: device sent alive response: AR-66
2022.11.23 19:50:46 5: ACT: sending k(eepAlive) to device
2022.11.23 19:50:46 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.23 19:50:46 5: ACT: device sent alive response: AR-65
2022.11.23 19:50:50 3: 192.168.1.161:80 disconnected, waiting to reappear (ACT)
2022.11.23 19:50:56 5: ACT: sending k(eepAlive) to device
2022.11.23 19:50:56 5: ACT: Write: device is disconnected, dropping line to write
2022.11.23 19:50:59 3: ACT: device didn't reply to k(eeepAlive), count=1
2022.11.23 19:51:06 5: ACT: sending k(eepAlive) to device
2022.11.23 19:51:06 5: ACT: Write: device is disconnected, dropping line to write
2022.11.23 19:51:09 3: ACT: device didn't reply to k(eeepAlive), count=2
2022.11.23 19:51:16 5: ACT: sending k(eepAlive) to device
2022.11.23 19:51:16 5: ACT: Write: device is disconnected, dropping line to write
2022.11.23 19:51:19 3: ACT: device didn't reply to k(eeepAlive), count=3
2022.11.23 19:51:26 5: ACT: sending k(eepAlive) to device
2022.11.23 19:51:26 5: ACT: Write: device is disconnected, dropping line to write
2022.11.23 19:51:29 3: ACT: device didn't reply to k(eeepAlive), no retries left, setting device to disconnected

Mehr steht im Log nicht drin. Das ArduCounter Modul hat in der Zeit von 19:51 bis jetzt 21:13 nichts mehr ausgespuckt.
Das INTERNAL Reading "DevIoJustClosed 1" bleibt stehen, bis ich manuell einen Reconnect auslöse.

Hier noch ein Auszug von vorgestern. Hier hat es scheinbar zwischendurch mal funktioniert:

2022.11.21 20:15:32 5: ACT: device sent alive response: AR-66
2022.11.21 20:15:42 5: ACT: sending k(eepAlive) to device
2022.11.21 20:15:42 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:15:42 5: ACT: device sent alive response: AR-66
2022.11.21 20:15:52 5: ACT: sending k(eepAlive) to device
2022.11.21 20:15:52 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:15:52 5: ACT: device sent alive response: AR-66
2022.11.21 20:16:02 5: ACT: sending k(eepAlive) to device
2022.11.21 20:16:02 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:16:02 5: ACT: device sent alive response: AR-67
2022.11.21 20:16:12 5: ACT: sending k(eepAlive) to device
2022.11.21 20:16:12 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:16:12 5: ACT: device sent alive response: AR-67
2022.11.21 20:16:22 5: ACT: sending k(eepAlive) to device
2022.11.21 20:16:22 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:16:22 5: ACT: device sent alive response: AR-67
2022.11.21 20:16:32 5: ACT: sending k(eepAlive) to device
2022.11.21 20:16:32 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:16:33 5: ACT: device sent alive response: AR-67
2022.11.21 20:16:38 4: ACT: set reconnect called
2022.11.21 20:16:38 4: ACT: trying to open connection to 192.168.1.161:80
2022.11.21 20:16:38 3: Opening ACT device 192.168.1.161:80
2022.11.21 20:16:38 5: HttpUtils url=http://192.168.1.161:80/ NonBlocking via http
2022.11.21 20:16:38 4: IP: 192.168.1.161 -> 192.168.1.161
2022.11.21 20:16:38 5: ACT: DoOpen waiting for callback
2022.11.21 20:16:38 3: ACT device opened
2022.11.21 20:16:38 5: ACT: DoOpen succeeded in callback
2022.11.21 20:16:38 5: ACT: sending k(eepAlive) to device
2022.11.21 20:16:38 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:16:38 5: attribute board is set to T-Display and is overwriting board ESP32 reported by device
2022.11.21 20:16:38 5: ACT: device sent hello: ArduCounter V4.26 on ESP32 Espressif ESP32 Dev Module with display compiled Jun  6 2020 12:41:51 Hello
2022.11.21 20:16:38 5: ACT: Device Time 257950.974, Offset 1668800.251, Drift -3.130s in 186435.152s, -0.00%
2022.11.21 20:16:38 4: ACT: device sent time info: N257950974,0B1107,0
2022.11.21 20:16:38 5: ACT: Device sent available pins 4,17,21,22,25,26,27,32,33,34,35,36,39
2022.11.21 20:16:38 4: ACT: device sent interval config 30,1800,5,2,0,10
2022.11.21 20:16:38 4: ACT: device sent devVerbose 1,0,0,1,0
2022.11.21 20:16:38 4: ACT: device sent config for pin 36: P36fp m50out27t560/640
2022.11.21 20:16:38 5: ACT: device sent alive response: AR-67
2022.11.21 20:16:39 5: ACT: ConfigureDevice: send config
2022.11.21 20:16:39 5: ACT: ConfigurePin creates command 36,2,1,50,27,560,640a
2022.11.21 20:16:39 5: DevIo_SimpleWrite ACT: 36,2,1,50,27,560,640a.
2022.11.21 20:16:39 5: ACT: ConfigureDevice: no pins in running config without attribute in Fhem
2022.11.21 20:16:39 5: ACT: ConfigureIntervals creates command 30,1800,5,2,,10,3,10i
2022.11.21 20:16:39 5: DevIo_SimpleWrite ACT: 30,1800,5,2,,10,3,10i.
2022.11.21 20:16:39 5: ACT: ConfigureVerboseLevels creates command 1,0,0,1,0v
2022.11.21 20:16:39 5: DevIo_SimpleWrite ACT: 1,0,0,1,0v.
2022.11.21 20:16:39 5: ACT: ConfigureDisplay pin 36 / 36, ppu 75, fut 60
2022.11.21 20:16:39 5: ACT: ConfigureDisplay 36, 75, 1, kWh, 60, kW
2022.11.21 20:16:39 5: ACT: ConfigureDisplay creates command 36,75,1,22379,104,60,22379,0u
2022.11.21 20:16:39 5: DevIo_SimpleWrite ACT: 36,75,1,22379,104,60,22379,0u.
2022.11.21 20:16:39 5: DevIo_SimpleWrite ACT: s.
2022.11.21 20:16:39 4: ACT: device: defined P36fp m50out27t560/640
2022.11.21 20:16:39 4: ACT: device sent interval config 30,1800,5,2,0,10
2022.11.21 20:16:39 4: ACT: device sent devVerbose 1,0,0,1,0
2022.11.21 20:16:39 4: ACT: device sent unit display config 36,75,1,kWh,60,kW
2022.11.21 20:16:39 4: ACT: device: Status: ArduCounter V4.26 on ESP32 Espressif ESP32 Dev Module with display compiled Jun  6 2020 12:41:51
2022.11.21 20:16:39 4: ACT: device: Connected to mellificium with IP 192.168.1.161 RSSI -66
2022.11.21 20:16:39 4: ACT: device sent interval config 30,1800,5,2,0,10
2022.11.21 20:16:39 4: ACT: device sent devVerbose 1,0,0,1,0
2022.11.21 20:16:40 4: ACT: device sent unit display config 36,75,1,kWh,60,kW
2022.11.21 20:16:40 4: ACT: device sent config for pin 36: P36fp m50out27t560/640, DR36C5097D0/0T0X0
2022.11.21 20:16:40 4: ACT: device: EEPROM Config: 30,1800,5,2,0,10i1,0,0,1,0v36,75,1,22379,104,60,22379u36,2,1,50,27,560,640a
2022.11.21 20:16:40 4: ACT: device: Next report in 5889 milliseconds
2022.11.21 20:16:48 5: ACT: sending k(eepAlive) to device
2022.11.21 20:16:48 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:16:48 5: ACT: device sent alive response: AR-66
2022.11.21 20:16:58 5: ACT: sending k(eepAlive) to device
2022.11.21 20:16:58 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:16:58 5: ACT: device sent alive response: AR-66
2022.11.21 20:17:08 5: ACT: sending k(eepAlive) to device
2022.11.21 20:17:08 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:17:08 5: ACT: device sent alive response: AR-67
2022.11.21 20:17:18 5: ACT: sending k(eepAlive) to device
2022.11.21 20:17:18 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:17:18 5: ACT: device sent alive response: AR-67
2022.11.21 20:17:28 5: ACT: sending k(eepAlive) to device
2022.11.21 20:17:28 5: DevIo_SimpleWrite ACT: 1,10k.
2022.11.21 20:17:28 5: ACT: device sent alive response: AR-67
2022.11.21 20:17:38 5: ACT: sending k(eepAlive) to device

StefanStrobel

Hallo,

entferne doch vorübergehend mal das Attribut stateFormat, bis ich eine neue Version des Moduls fertig habe. Damit sollten die reconnects wieder automatisch gehen.

Gruß
    Stefan

thymjan


thymjan

... ohne stateFormat läufts wie geschmiert! Keine längeren disconnect-Episoden mehr.

StefanStrobel

Das klingt doch gut.
Kannst Du mal das angehängte Modul testen? Da habe ich den Fehler im Zusammenhang mit stateFormat hoffentlich behoben.

Gruss
   Stefan

thymjan

Nach Einpflegen des Moduls will fhem nicht mehr starten.
Im log finde ich folgende Fehlermeldung:
Undefined subroutine &ArduCounter::DevIo_setStates called at ./FHEM/98_ArduCounter.pm line 260, <$fh> line 1426.

StefanStrobel


thymjan

Guten Abend Stefan,

jetzt läuft's erst mal, danke. StateFormat habe ich wieder gesetzt. Beobachte jetzt mal und melde mich wieder.

Grüße
Stefan