!!!ABGELÖST!!! [74_XiaomiFlowerSens.pm] Xiaomi Flower Monitor

Begonnen von CoolTux, 17 November 2016, 13:25:06

Vorheriges Thema - Nächstes Thema

CoolTux

Zitat von: andi11 am 08 Februar 2017, 19:29:13
Ja es scheint ein sporadisches Problem zu sein. Bisher bei dem einem Sensor z.b.  3x in ca. 2h.
Stell den Mal bitte auf verbose 5. War eigentlich der Meinung das ich sowas abgefangen habe. Kann aber sein das ich durch die Änderung mein Fehlerhandling was übersehen habe. Dummerweise macht mein einer nie Probleme. Das ist ungünstig wenn man Fehlerbehandlung programmieren will.


Grüße
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

andi11

ist drin. Derweil ein ganz aktuelles List (der Sensor hatte gerade einen Ausfall)
Internals:
   BTMAC      C4:7C:8D:62:48:6A
   DEF        C4:7C:8D:62:48:6A
   INTERVAL   300
   NAME       Pflanze3
   NR         284
   STATE      1°C 0% 0 µS/cm 0 Lux 643.95 Lux/Tag
   TYPE       XiaomiFlowerSens
   VERSION    0.6.4
   Helper:
     Dblog:
       Battery:
         Logdb:
           TIME       1486578699.91356
           VALUE      low
       Batterylevel:
         Logdb:
           TIME       1486578699.91356
           VALUE      0
       Fertility:
         Logdb:
           TIME       1486578699.91356
           VALUE      0
       Fertility_70:
         Logdb:
           TIME       1486577053.56845
           VALUE      2238
       Firmware:
         Logdb:
           TIME       1486578699.91356
           VALUE      -30.-30.-30
       Lightintegral:
         Logdb:
           TIME       1486578699.91356
           VALUE      55637563.6712395
       Lightintegralday:
         Logdb:
           TIME       1486578699.91356
           VALUE      643.953283231938
       Lightintegraldaystate:
         Logdb:
           TIME       1486578699.91356
           VALUE      643.95
       Lux:
         Logdb:
           TIME       1486578699.91356
           VALUE      0
       Moisture:
         Logdb:
           TIME       1486578699.91356
           VALUE      0
       Statmoisturetendency:
         Logdb:
           TIME       1486576795.42973
           VALUE      1h: -2 2h: -4 3h: -4 6h: -6
       Statmoisturetendency1h:
         Logdb:
           TIME       1486573195.30509
           VALUE      -2
       Statmoisturetendency2h:
         Logdb:
           TIME       1486576795.42973
           VALUE      -4
       Statmoisturetendency3h:
         Logdb:
           TIME       1486576795.42973
           VALUE      -4
       Statmoisturetendency6h:
         Logdb:
           TIME       1486576795.42973
           VALUE      -6
       Stattemperaturedayavg:
         Logdb:
           TIME       1486576336.06172
           VALUE      19.4
       Stattemperaturedaymax:
         Logdb:
           TIME       1486567724.38597
           VALUE      23.1
       Stattemperaturedaymin:
         Logdb:
           TIME       1486566043.52286
           VALUE      1.0
       Stattemperaturehourlast:
         Logdb:
           TIME       1486576795.42973
           VALUE      Min: 20.4 Avg: 20.8 Max: 21.3
       State:
         Logdb:
           TIME       1486578699.91356
           VALUE      active
       Temperature:
         Logdb:
           TIME       1486578699.91356
           VALUE      1
   Readings:
     2017-02-08 19:31:39   battery         low
     2017-02-08 19:31:39   batteryLevel    0
     2017-02-08 19:31:39   fertility       0
     2017-02-08 19:31:39   fertility_10    0
     2017-02-08 19:31:39   fertility_20    0
     2017-02-08 19:31:39   fertility_30    0
     2017-02-08 19:31:39   fertility_40    1097
     2017-02-08 19:31:39   fertility_50    1660
     2017-02-08 19:31:39   fertility_60    2009
     2017-02-08 19:31:39   fertility_70    2238
     2017-02-08 19:31:39   fertility_filtered 1634
     2017-02-08 19:31:39   firmware        -30.-30.-30
     2017-02-07 16:59:55   gotWater        1
     2017-01-25 17:36:25   humidity        0
     2017-02-08 19:31:39   lightintegral   55637563.6712395
     2017-02-08 19:31:39   lightintegralday 643.953283231938
     2017-02-08 19:31:39   lightintegraldaystate 643.95
     2017-02-08 19:31:39   lux             0
     2017-02-08 19:31:39   moisture        0
     2017-02-08 18:59:55   statMoistureTendency 1h: -2 2h: -4 3h: -4 6h: -6
     2017-02-08 18:59:55   statMoistureTendency1h -2
     2017-02-08 18:59:55   statMoistureTendency2h -4
     2017-02-08 18:59:55   statMoistureTendency3h -4
     2017-02-08 18:59:55   statMoistureTendency6h -6
     2017-02-08 19:31:39   statTemperatureDay Min: 1.0 Avg: 19.4 Max: 23.1
     2017-02-08 19:31:39   statTemperatureDayAvg 19.4
     2017-02-07 23:59:55   statTemperatureDayAvgLast 20.2
     2017-02-07 23:59:55   statTemperatureDayLast Min: 16.5 Avg: 20.2 Max: 23.2
     2017-02-08 19:31:39   statTemperatureDayMax 23.1
     2017-02-07 23:59:55   statTemperatureDayMaxLast 23.2
     2017-02-08 19:31:39   statTemperatureDayMin 1.0
     2017-02-07 23:59:55   statTemperatureDayMinLast 16.5
     2017-02-08 19:31:39   statTemperatureHour Min: 1.0 Avg: 20.7 Max: 20.7
     2017-02-08 18:59:55   statTemperatureHourLast Min: 20.4 Avg: 20.8 Max: 21.3
     2017-02-08 19:31:39   statTemperatureMonth Min: 1.0 Avg: 20.3 Max: 25.1
     2017-01-31 23:59:55   statTemperatureMonthLast Min: 20.4 Avg: 22.4 Max: 23.3 (since: 2017-01-31_18:26:44 )
     2017-02-08 19:31:39   statTemperatureYear Min: 1.0 Avg: 20.3 Max: 25.1 (since: 2017-01-31_18:26:44 )
     2017-02-08 19:31:39   state           active
     2017-02-08 19:31:39   temperature     1
   Helper:
     _98_statistics statictics.Pflanzen
Attributes:
   alias      Amberbaum
   event-min-interval moisture:3600
   event-on-change-reading .*
   room       Pflanzen
   stateFormat temperature°C moisture% fertility µS/cm lux Lux lightintegraldaystate Lux/Tag
   userReadings lightintegral integral { (ReadingsVal($name,"lux",0) <100) ? 0 : (ReadingsVal($name,"lux",0)) },
lightintegralday  { ReadingsVal($name,"lightintegral",0)/86400 },
lightintegraldaystate {sprintf("%.2f",ReadingsVal($name,"lightintegralday",0)) },
fertility_filtered { if ((ReadingsVal($name,"moisture",0)>=46) and (ReadingsVal($name,"moisture",0)<=48)) {
  ReadingsVal($name,"fertility",0);
}else{
  ReadingsVal($name,"fertility_filtered",0);
}
},
fertility_10 { if ((ReadingsVal($name,"moisture",0)>=8) and (ReadingsVal($name,"moisture",0)<=12)) {
  ReadingsVal($name,"fertility",0);
}else{
  ReadingsVal($name,"fertility_10",0);
}
},
fertility_20 { if ((ReadingsVal($name,"moisture",0)>=18) and (ReadingsVal($name,"moisture",0)<=22)) {
  ReadingsVal($name,"fertility",0);
}else{
  ReadingsVal($name,"fertility_20",0);
}
},
fertility_30 { if ((ReadingsVal($name,"moisture",0)>=28) and (ReadingsVal($name,"moisture",0)<=32)) {
  ReadingsVal($name,"fertility",0);
}else{
  ReadingsVal($name,"fertility_30",0);
}
}
,
fertility_40 { if ((ReadingsVal($name,"moisture",0)>=38) and (ReadingsVal($name,"moisture",0)<=42)) {
  ReadingsVal($name,"fertility",0);
}else{
  ReadingsVal($name,"fertility_40",0);
}
},
fertility_50 { if ((ReadingsVal($name,"moisture",0)>=48) and (ReadingsVal($name,"moisture",0)<=52)) {
  ReadingsVal($name,"fertility",0);
}else{
  ReadingsVal($name,"fertility_50",0);
}
}
,
fertility_60 { if ((ReadingsVal($name,"moisture",0)>=58) and (ReadingsVal($name,"moisture",0)<=62)) {
  ReadingsVal($name,"fertility",0);
}else{
  ReadingsVal($name,"fertility_60",0);
}
},
fertility_70 { if ((ReadingsVal($name,"moisture",0)>=68) and (ReadingsVal($name,"moisture",0)<=72)) {
  ReadingsVal($name,"fertility",0);
}else{
  ReadingsVal($name,"fertility_70",0);
}
}


Nicht wundern, die Userreadings sind ein paar Versuche die Daten die es gibt sinnvoller zu bewerten.

CoolTux

Ich weiß schon wo ich den Fehler habe oder besser nicht weiter geschaut habe beim Programmieren. Das ganze entstand wie ich Mumpitz seine "Vorschläge" umgesetzt habe. Wie gesagt, dadurch das ich keine Fehler bekomme sind solche Hinweise schon gut, aber besser wäre bis zu Ende gedacht. Also entweder Rückbau oder ich versuche das mal komplett zu analysieren.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

andi11

Zitat von: CoolTux am 08 Februar 2017, 19:56:23
Ich weiß schon wo ich den Fehler habe oder besser nicht weiter geschaut habe beim Programmieren. Das ganze entstand wie ich Mumpitz seine "Vorschläge" umgesetzt habe. Wie gesagt, dadurch das ich keine Fehler bekomme sind solche Hinweise schon gut, aber besser wäre bis zu Ende gedacht. Also entweder Rückbau oder ich versuche das mal komplett zu analysieren.
Du bekommst alle Infos die du haben willst, kein Problem. Allerdings stelle ich mal nur einen von den 4 Sensoren um, da es sonst etwas unübersichtlich wird. Aber wenns so weitergeht wie bisher, dürfte es nicht soooo lange dauern.

CoolTux

Habe gerade mal im Code geschaut und denke den Fehler gefunden zu haben. Ich besser das heute noch aus und dann testen wir mal.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

CoolTux

Ich habe eine aktuelle Version 0.6.5 in mein master Branch von Github geladen. Magst mal testen?
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

andi11

Zitat von: CoolTux am 08 Februar 2017, 20:42:44
Ich habe eine aktuelle Version 0.6.5 in mein master Branch von Github geladen. Magst mal testen?
Version aktualisiert. Auf 3 Sensoren normal, bei einem verbose 5. Ich geb bescheid, wie es sich schlägt.
Vielen Dank für deine schnelle Anpassung.

CoolTux

Freu Dich nicht zu früh. Habe die letzte halbe Stunde noch mal in Ruhe geschaut. Meine Anpassungen waren doch korrekt und eigentlich hätte der Fehler den Du hast nicht passieren dürfen.
Ich brauche also doch ein verbose 5. Hilft alles nichts
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

mumpitzstuff

Der Fehler steckt in Zeile 400. Copy/Paste Fehler. Du verwendest dort readSensData anstatt readBatFwData.

CoolTux

In der Tat. Vielen lieben Dank, da hätte ich mich glaube dumm und dämlich gesucht.


Grüße
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

CoolTux

Aktuelle Version liegt im Git und ich mache zu morgen früh ein fhem Update fertig
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

andi11

ob gute Nachrichten oder nicht muss du selbst entscheiden, aber hier ein Fehlerauszug
2017.02.09 14:30:28 4: Sub XiaomiFlowerSens_Run (Pflanze3) - start blocking call
2017.02.09 14:30:28 4: Sub XiaomiFlowerSens_BlockingRun (Pflanze3) - Running nonBlocking
2017.02.09 14:30:28 5: Sub XiaomiFlowerSens_stateRequestTimer (Pflanze3) - Request Timer wird aufgerufen
2017.02.09 14:30:30 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - call gatttool charWrite loop 1
2017.02.09 14:30:30 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - charWrite wresp: Characteristic Write Request failed: Internal application error: I/O

2017.02.09 14:30:30 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - run gatttool
2017.02.09 14:30:40 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - call gatttool charRead loop 1
2017.02.09 14:30:40 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - processing gatttool response. sensData[0]: Characteristic value/descriptor read failed
2017.02.09 14:30:40 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - processing gatttool response. sensData: Internal application error
2017.02.09 14:30:43 4: Sub XiaomiFlowerSens (Pflanze3) - call gatttool readBatFw loop 1
2017.02.09 14:30:43 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - processing gatttool response. batFwData: Internal application error
2017.02.09 14:30:43 4: Sub XiaomiFlowerSens_BlockingRun (Pflanze3) - Processing response data: Internal application error
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value $dataSensor[3] in string ne at ./FHEM/74_XiaomiFlowerSens.pm line 301.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value $dataSensor[4] in string ne at ./FHEM/74_XiaomiFlowerSens.pm line 301.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value $dataSensor[5] in string ne at ./FHEM/74_XiaomiFlowerSens.pm line 301.
2017.02.09 14:30:43 1: PERL WARNING: Illegal hexadecimal digit 'p' ignored at ./FHEM/74_XiaomiFlowerSens.pm line 308.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value $dataSensor[4] in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 310.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 310.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value $dataSensor[7] in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 311.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value $dataSensor[9] in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 312.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 312.
2017.02.09 14:30:43 1: PERL WARNING: Illegal hexadecimal digit 'I' ignored at ./FHEM/74_XiaomiFlowerSens.pm line 321.
2017.02.09 14:30:43 1: PERL WARNING: Argument "error" isn't numeric in subtraction (-) at ./FHEM/74_XiaomiFlowerSens.pm line 322.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value $dataBatFw[4] in subtraction (-) at ./FHEM/74_XiaomiFlowerSens.pm line 322.
2017.02.09 14:30:43 1: PERL WARNING: Use of uninitialized value $dataBatFw[6] in subtraction (-) at ./FHEM/74_XiaomiFlowerSens.pm line 322.
2017.02.09 14:30:43 4: Sub XiaomiFlowerSens_BlockingRun (Pflanze3) - no dataerror, create encode json: {"blevel":0,"temp":10,"moisture":0,"lux":0,"fertility":0,"firmware":"-30.-30.-30"}
2017.02.09 14:30:44 4: Sub XiaomiFlowerSens_BlockingDone (Pflanze3) - Abschluss!
2017.02.09 14:39:51 4: Sub XiaomiFlowerSens_Run (Pflanze3) - start blocking call
2017.02.09 14:39:51 4: Sub XiaomiFlowerSens_BlockingRun (Pflanze3) - Running nonBlocking
2017.02.09 14:39:51 5: Sub XiaomiFlowerSens_stateRequestTimer (Pflanze3) - Request Timer wird aufgerufen
2017.02.09 14:39:54 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - call gatttool charWrite loop 1
2017.02.09 14:39:54 4: Sub XiaomiFlowerSens_callGatttool (Pflanze3) - charWrite wresp: Characteristic value was written successfully

Version hab ich nach deinem letzten Post gestern Abend noch getauscht und neu gestartet

CoolTux

Also das sieht erstmal Kacke aus  ;D
Genauer schaue ich heute Abend mal. Aber irgendwie macht er immer noch kein Brack wenn die Daten nicht passen.
Kannst du mal ein FHEM Update machen? Sollte eigentlich eine neue Version dabei sein.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

andi11

Zitat von: CoolTux am 09 Februar 2017, 16:31:06
Kannst du mal ein FHEM Update machen? Sollte eigentlich eine neue Version dabei sein.
Hab ich vorhin erledigt (Modul wurde aktualisiert). Mal abwarten...

andi11

Es ist wieder passiert :)
2017.02.09 17:30:09 4: Sub XiaomiFlowerSens_Run (Pflanze1) - start blocking call
2017.02.09 17:30:09 4: Sub XiaomiFlowerSens_BlockingRun (Pflanze1) - Running nonBlocking
2017.02.09 17:30:10 5: Sub XiaomiFlowerSens_stateRequestTimer (Pflanze1) - Request Timer wird aufgerufen
2017.02.09 17:30:11 4: Sub XiaomiFlowerSens_callGatttool (Pflanze1) - call gatttool charWrite loop 1
2017.02.09 17:30:11 4: Sub XiaomiFlowerSens_callGatttool (Pflanze1) - charWrite wresp: Characteristic Write Request failed: Internal application error: I/O

2017.02.09 17:30:11 4: Sub XiaomiFlowerSens_callGatttool (Pflanze1) - run gatttool
2017.02.09 17:30:21 4: Sub XiaomiFlowerSens_callGatttool (Pflanze1) - call gatttool charRead loop 1
2017.02.09 17:30:21 4: Sub XiaomiFlowerSens_callGatttool (Pflanze1) - processing gatttool response. sensData[0]: Characteristic value/descriptor read failed
2017.02.09 17:30:21 4: Sub XiaomiFlowerSens_callGatttool (Pflanze1) - processing gatttool response. sensData: Internal application error
2017.02.09 17:30:23 4: Sub XiaomiFlowerSens (Pflanze1) - call gatttool readBatFw loop 1
2017.02.09 17:30:23 4: Sub XiaomiFlowerSens_callGatttool (Pflanze1) - processing gatttool response. batFwData: Internal application error
2017.02.09 17:30:23 4: Sub XiaomiFlowerSens_BlockingRun (Pflanze1) - Processing response data: Internal application error
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value $dataSensor[3] in string ne at ./FHEM/74_XiaomiFlowerSens.pm line 301.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value $dataSensor[4] in string ne at ./FHEM/74_XiaomiFlowerSens.pm line 301.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value $dataSensor[5] in string ne at ./FHEM/74_XiaomiFlowerSens.pm line 301.
2017.02.09 17:30:23 1: PERL WARNING: Illegal hexadecimal digit 'p' ignored at ./FHEM/74_XiaomiFlowerSens.pm line 308.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value $dataSensor[4] in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 310.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 310.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value $dataSensor[7] in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 311.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value $dataSensor[9] in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 312.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/74_XiaomiFlowerSens.pm line 312.
2017.02.09 17:30:23 1: PERL WARNING: Illegal hexadecimal digit 'I' ignored at ./FHEM/74_XiaomiFlowerSens.pm line 321.
2017.02.09 17:30:23 1: PERL WARNING: Argument "error" isn't numeric in subtraction (-) at ./FHEM/74_XiaomiFlowerSens.pm line 322.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value $dataBatFw[4] in subtraction (-) at ./FHEM/74_XiaomiFlowerSens.pm line 322.
2017.02.09 17:30:23 1: PERL WARNING: Use of uninitialized value $dataBatFw[6] in subtraction (-) at ./FHEM/74_XiaomiFlowerSens.pm line 322.
2017.02.09 17:30:23 4: Sub XiaomiFlowerSens_BlockingRun (Pflanze1) - no dataerror, create encode json: {"temp":10,"lux":0,"blevel":0,"firmware":"-30.-30.-30","fertility":0,"moisture":0}
2017.02.09 17:30:23 4: Sub XiaomiFlowerSens_BlockingDone (Pflanze1) - Abschluss!