[74_XiaomiBTLESens.pm] Xiaomi Bluetooth Sensoren FlowerSens/Thermometer

Begonnen von CoolTux, 11 Januar 2018, 15:42:45

Vorheriges Thema - Nächstes Thema

kroonen

Hi,

This one works again, inside (attic)  it is working, see output. I'm also going to try again in the garage, and let you know if humidity is working ok

fhem> l zoldertem
Internals:
   BTMAC      4C:65:A8:D1:7D:DC
   DEF        4C:65:A8:D1:7D:DC
   INTERVAL   300
   NAME       zoldertem
   NOTIFYDEV  global,zoldertem
   NR         21
   NTFY_ORDER 50-zoldertem
   STATE      active
   TYPE       XiaomiBTLESens
   VERSION    2.0.8
   loglevel   4
   READINGS:
     2018-02-09 20:19:52   battery         ok
     2018-02-09 20:19:52   batteryLevel    100
     2018-02-09 08:59:59   firmware        00.00.66
     2018-02-09 20:19:57   humidity        64.3
     2018-02-09 19:26:34   lastGattError   no data response
     2018-02-09 20:19:57   state           active
     2018-02-09 20:19:57   temperature     16.1
   helper:
     CallBattery 0
     CallSensDataCounter 0
     updateTimeCallBattery 1518203992.10542
     updateTimestampCallBattery 2018-02-09 20:19:52
Attributes:
   interval   300
   model      thermoHygroSens
   room       XiaomiBTLESens


kroonen

Hi,

Below 10 degrees, the humidity looks like failing again. Herre the first when placed in the garage, after couple minutes, it goes wrong

fhem> l zoldertem
Internals:
   BTMAC      4C:65:A8:D1:7D:DC
   DEF        4C:65:A8:D1:7D:DC
   INTERVAL   300
   NAME       zoldertem
   NOTIFYDEV  global,zoldertem
   NR         21
   NTFY_ORDER 50-zoldertem
   STATE      active
   TYPE       XiaomiBTLESens
   VERSION    2.0.8
   loglevel   4
   READINGS:
     2018-02-09 20:24:58   battery         ok
     2018-02-09 20:24:58   batteryLevel    100
     2018-02-09 08:59:59   firmware        00.00.66
     2018-02-09 20:25:04   humidity        55.5
     2018-02-09 19:26:34   lastGattError   no data response
     2018-02-09 20:25:04   state           active
     2018-02-09 20:25:04   temperature     13.6
   helper:
     CallBattery 0
     CallSensDataCounter 0
     updateTimeCallBattery 1518204298.91355
     updateTimestampCallBattery 2018-02-09 20:24:58
Attributes:
   interval   300
   model      thermoHygroSens
   room       XiaomiBTLESens

fhem> l zoldertem
Internals:
   BTMAC      4C:65:A8:D1:7D:DC
   DEF        4C:65:A8:D1:7D:DC
   INTERVAL   300
   NAME       zoldertem
   NOTIFYDEV  global,zoldertem
   NR         21
   NTFY_ORDER 50-zoldertem
   STATE      active
   TYPE       XiaomiBTLESens
   VERSION    2.0.8
   loglevel   4
   READINGS:
     2018-02-09 20:24:58   battery         ok
     2018-02-09 20:24:58   batteryLevel    100
     2018-02-09 08:59:59   firmware        00.00.66
     2018-02-09 20:31:20   humidity        0.1
     2018-02-09 19:26:34   lastGattError   no data response
     2018-02-09 20:31:20   state           active
     2018-02-09 20:31:20   temperature     9.3
   helper:
     CallBattery 0
     CallSensDataCounter 0
     updateTimeCallBattery 1518204298.91355
     updateTimestampCallBattery 2018-02-09 20:24:58
Attributes:
   interval   300
   model      thermoHygroSens
   room       XiaomiBTLESens

here the logging:

2018.02.09 20:32:57 4: XiaomiBTLESens (zoldertem) - Run CreateParamGatttool with mod: write
2018.02.09 20:32:57 4: BlockingCall (XiaomiBTLESens_ExecGatttool_Run): created child (535), uses telnetPort to connect back
2018.02.09 20:32:57 5: Starting notify loop for zoldertem, 1 event(s), first is write sensor data
2018.02.09 20:32:57 5: createNotifyHash
2018.02.09 20:32:57 5: End notify loop for zoldertem
2018.02.09 20:32:57 5: XiaomiBTLESens (zoldertem) - Write XiaomiBTLESens_ExecGatttool_Run zoldertem|4C:65:A8:D1:7D:DC|write|0x10|0100
2018.02.09 20:32:57 4: XiaomiBTLESens (zoldertem) - stateRequestTimer: Call Request Timer
2018.02.09 20:32:57 4: Connection accepted from telnetPort_127.0.0.1_41188
2018.02.09 20:32:57 5: Cmd: >{BlockingRegisterTelnet($cl,4)}<
2018.02.09 20:32:57 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop 0
2018.02.09 20:33:02 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result
2018.02.09 20:33:02 1: PERL WARNING: Use of uninitialized value in split at ./FHEM/74_XiaomiBTLESens.pm line 487.
2018.02.09 20:33:02 1: PERL WARNING: Use of uninitialized value $gtResult[1] in substitution (s///) at ./FHEM/74_XiaomiBTLESens.pm line 488.
2018.02.09 20:33:02 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop 1
2018.02.09 20:33:07 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result
2018.02.09 20:33:07 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop 2
2018.02.09 20:33:12 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 38 2e 34 20 48 3d 37 32 2e 35 00
Notification handle = 0x000e value,54 3d 31 31 2e 36 20 48 3d 35 38 2e 38 00
Notification handle = 0x000e value,54 3d 38 2e 35 20 48 3d 37 32 2e 36 00
Notification handle = 0x000e value,54 3d 31 31 2e 36 20 48 3d 35 38 2e 38 00
Notification handle = 0x000e value,54 3d 38 2e 35 20 48 3d 37 32 2e 37 00
Notification handle = 0x000e value,54 3d 31 31 2e 36 20 48 3d 35 38 2e 39 00
Notification handle = 0x000e value,54 3d 38 2e 35 20 48 3d 37 32 2e 38 00
Notification handle = 0x000e value,54 3d 31 31 2e 36 20 48 3d 35 39 2e 30 00
Notification handle = 0x000e value,54 3d 38 2e 34 20 48 3d 37 32 2e 34 00
Notification handle = 0x000e value,54 3d 31 31 2e 35 20 48 3d 35 39 2e 30 00

2018.02.09 20:33:12 4: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 38 2e 34 20 48 3d 37 32 2e 35 00 ,54 3d 31 31 2e 36 20 48 3d 35 38 2e 38 00
Notification handle = 0x000e value,54 3d 38 2e 35 20 48 3d 37 32 2e 36 00
Notification handle = 0x000e value,54 3d 31 31 2e 36 20 48 3d 35 38 2e 38 00
Notification handle = 0x000e value,54 3d 38 2e 35 20 48 3d 37 32 2e 37 00
Notification handle = 0x000e value,54 3d 31 31 2e 36 20 48 3d 35 38 2e 39 00
Notification handle = 0x000e value,54 3d 38 2e 35 20 48 3d 37 32 2e 38 00
Notification handle = 0x000e value,54 3d 31 31 2e 36 20 48 3d 35 39 2e 30 00
Notification handle = 0x000e value,54 3d 38 2e 34 20 48 3d 37 32 2e 34 00
Notification handle = 0x000e value,54 3d 31 31 2e 35 20 48 3d 35 39 2e 30 00

2018.02.09 20:33:12 5: Cmd: >{BlockingStart('4')}<
2018.02.09 20:33:12 5: Cmd: >{XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"54 3d 38 2e 34 20 48 3d 37 32 2e 35 00 "}')}<
2018.02.09 20:33:12 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Done: gatttool return string: zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"54 3d 38 2e 34 20 48 3d 37 32 2e 35 00 "}
2018.02.09 20:33:12 4: XiaomiBTLESens (zoldertem) - ProcessingNotification
2018.02.09 20:33:12 4: XiaomiBTLESens (zoldertem) - ProcessingNotification: handle 0x10
2018.02.09 20:33:12 4: XiaomiBTLESens (zoldertem) - Thermo/Hygro Sens Handle0x10
2018.02.09 20:33:12 5: Starting notify loop for zoldertem, 3 event(s), first is temperature: 8.4
2018.02.09 20:33:12 5: End notify loop for zoldertem
2018.02.09 20:33:12 4: XiaomiBTLESens (zoldertem) - WriteReadings: Readings were written
2018.02.09 20:34:18 5: Cmd: >q<
2018.02.09 20:34:18 5: AnalyzeCommand: trying quit for q

CoolTux

please can you test this version https://github.com/LeonGaultier/fhem-XiaomiBTLESens/archive/master.zip.
this is not the solution for your problem, put i will see is the change code running.

can you tell me what was the value of the humidity at your last log?
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

kroonen

Hi,

This reading humidity 84.0 (or maybe 83.9), and temperature 05.7 read from the physical display. I used the testversion module

fhem> l zoldertem
Internals:
   BTMAC      4C:65:A8:D1:7D:DC
   DEF        4C:65:A8:D1:7D:DC
   INTERVAL   300
   NAME       zoldertem
   NOTIFYDEV  global,zoldertem
   NR         21
   NTFY_ORDER 50-zoldertem
   STATE      active
   TYPE       XiaomiBTLESens
   VERSION    2.0.8
   loglevel   4
   READINGS:
     2018-02-10 11:07:04   battery         ok
     2018-02-10 11:07:04   batteryLevel    100
     2018-02-09 08:59:59   firmware        00.00.66
     2018-02-10 11:07:09   humidity        2.7
     2018-02-10 11:04:47   lastGattError   no data response
     2018-02-10 11:07:09   state           active
     2018-02-10 11:07:09   temperature     5.7
   helper:
     CallBattery 0
     CallSensDataCounter 0
     updateTimeCallBattery 1518257224.41969
     updateTimestampCallBattery 2018-02-10 11:07:04
Attributes:
   interval   300
   model      thermoHygroSens
   room       XiaomiBTLESens


2018.02.10 11:06:58 4: XiaomiBTLESens (zoldertem) - Run CreateParamGatttool with mod: read
2018.02.10 11:06:58 4: BlockingCall (XiaomiBTLESens_ExecGatttool_Run): created child (2842), uses telnetPort to connect back
2018.02.10 11:06:58 5: Starting notify loop for zoldertem, 1 event(s), first is read sensor data
2018.02.10 11:06:58 5: End notify loop for zoldertem
2018.02.10 11:06:58 5: XiaomiBTLESens (zoldertem) - Read XiaomiBTLESens_ExecGatttool_Run zoldertem|4C:65:A8:D1:7D:DC|read|0x18
2018.02.10 11:06:58 4: XiaomiBTLESens (zoldertem) - stateRequestTimer: Call Request Timer
2018.02.10 11:06:58 5: End notify loop for global
2018.02.10 11:06:58 0: Featurelevel: 5.8
2018.02.10 11:06:58 0: Server started with 11 defined entities (fhem.pl:16107/2018-02-07 perl:5.024001 os:linux user:fhem pid:2835)
2018.02.10 11:06:58 4: Connection accepted from telnetPort_127.0.0.1_41396
2018.02.10 11:06:58 5: Cmd: >{BlockingRegisterTelnet($cl,1)}<
2018.02.10 11:06:58 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-read -a 0x18 2>&1 /dev/null and loop 0
2018.02.10 11:06:59 4: Connection accepted from WEB_192.168.180.35_65058
2018.02.10 11:06:59 4: Connection accepted from WEB_192.168.180.35_65061
2018.02.10 11:07:00 4: WEB_192.168.180.35_65058 GET /; BUFLEN:0
2018.02.10 11:07:00 4: WEB: redirecting / to /fhem
2018.02.10 11:07:00 4: Connection accepted from WEB_192.168.180.35_65062
2018.02.10 11:07:00 4: WEB_192.168.180.35_65061 GET /fhem/pgm2/jquery.min.js; BUFLEN:0
2018.02.10 11:07:00 4: Connection accepted from WEB_192.168.180.35_65063
2018.02.10 11:07:00 4: WEB_192.168.180.35_65058 GET /fhem/pgm2/defaultCommon.css; BUFLEN:0
2018.02.10 11:07:00 4: WEB_192.168.180.35_65058 => 304 Not Modified
2018.02.10 11:07:00 4: WEB_192.168.180.35_65062 GET /fhem/images/default/icoEverything.png; BUFLEN:0
2018.02.10 11:07:00 4: WEB_192.168.180.35_65061 GET /fhem/images/default/fhemicon.png; BUFLEN:0
2018.02.10 11:07:00 4: WEB_192.168.180.35_65061 => 304 Not Modified
2018.02.10 11:07:00 4: WEB_192.168.180.35_65063 GET /fhem/pgm2/dashboard_style.css; BUFLEN:0
2018.02.10 11:07:00 4: Connection accepted from WEB_192.168.180.35_65064
2018.02.10 11:07:00 4: WEB_192.168.180.35_65058 GET /fhem/pgm2/fhemweb.js; BUFLEN:0
2018.02.10 11:07:00 4: WEB_192.168.180.35_65058 => 304 Not Modified
2018.02.10 11:07:00 4: Connection accepted from WEB_192.168.180.35_65065
2018.02.10 11:07:00 4: WEB_192.168.180.35_65064 GET /fhem/pgm2/jquery-ui.min.css; BUFLEN:0
2018.02.10 11:07:00 4: WEB_192.168.180.35_65064 => 304 Not Modified
2018.02.10 11:07:00 4: WEB_192.168.180.35_65062 GET /fhem; BUFLEN:0
2018.02.10 11:07:00 4: WEB: /fhem / RL:1388 / text/html; charset=UTF-8 / Content-Encoding: gzip
/
2018.02.10 11:07:00 4: WEB_192.168.180.35_65065 GET /fhem/pgm2/jquery-ui.min.js; BUFLEN:0
2018.02.10 11:07:00 4: WEB_192.168.180.35_65065 => 304 Not Modified
2018.02.10 11:07:00 4: WEB_192.168.180.35_65058 GET /fhem/pgm2/style.css?v=1518257209; BUFLEN:0
2018.02.10 11:07:00 4: WEB_192.168.180.35_65058 GET /fhem?XHR=1&inform=type=status;filter=;since=1518257219;fmt=JSON&fw_id=27&timestamp=1518257220830; BUFLEN:0
2018.02.10 11:07:02 4: Connection closed for WEB_192.168.180.35_65058: EOF
2018.02.10 11:07:02 4: WEB_192.168.180.35_65061 GET /fhem?room=XiaomiBTLESens; BUFLEN:0
2018.02.10 11:07:02 4: WEB: /fhem?room=XiaomiBTLESens / RL:1403 / text/html; charset=UTF-8 / Content-Encoding: gzip
/
2018.02.10 11:07:04 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result Characteristic value/descriptor,64

2018.02.10 11:07:04 4: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool result Characteristic value/descriptor,64

2018.02.10 11:07:04 5: Cmd: >{BlockingStart('1')}<
2018.02.10 11:07:04 5: Cmd: >{XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|read|0x18|{"gtResult":"64 "}')}<
2018.02.10 11:07:04 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Done: gatttool return string: zoldertem|4C:65:A8:D1:7D:DC|ok|read|0x18|{"gtResult":"64 "}
2018.02.10 11:07:04 4: XiaomiBTLESens (zoldertem) - ProcessingNotification
2018.02.10 11:07:04 4: XiaomiBTLESens (zoldertem) - ProcessingNotification: handle 0x18
2018.02.10 11:07:04 4: XiaomiBTLESens (zoldertem) - Thermo/Hygro Sens Handle0x18
2018.02.10 11:07:04 1: PERL WARNING: Illegal hexadecimal digit ' ' ignored at ./FHEM/74_XiaomiBTLESens.pm line 691.
2018.02.10 11:07:04 3: eval: {XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|read|0x18|{"gtResult":"64 "}')}
2018.02.10 11:07:04 1: PERL WARNING: Illegal hexadecimal digit ' ' ignored at ./FHEM/74_XiaomiBTLESens.pm line 692.
2018.02.10 11:07:04 3: eval: {XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|read|0x18|{"gtResult":"64 "}')}
2018.02.10 11:07:04 5: Starting notify loop for zoldertem, 3 event(s), first is battery: ok
2018.02.10 11:07:04 5: createNotifyHash
2018.02.10 11:07:04 5: End notify loop for zoldertem
2018.02.10 11:07:04 4: XiaomiBTLESens (zoldertem) - WriteReadings: Readings were written
2018.02.10 11:07:04 4: XiaomiBTLESens (zoldertem) - Run CreateParamGatttool with mod: write
2018.02.10 11:07:04 4: BlockingCall (XiaomiBTLESens_ExecGatttool_Run): created child (2852), uses telnetPort to connect back
2018.02.10 11:07:04 5: Starting notify loop for zoldertem, 1 event(s), first is write sensor data
2018.02.10 11:07:04 5: End notify loop for zoldertem
2018.02.10 11:07:04 5: XiaomiBTLESens (zoldertem) - Write XiaomiBTLESens_ExecGatttool_Run zoldertem|4C:65:A8:D1:7D:DC|write|0x10|0100
2018.02.10 11:07:04 4: Connection accepted from telnetPort_127.0.0.1_41398
2018.02.10 11:07:04 5: Cmd: >{BlockingRegisterTelnet($cl,2)}<
2018.02.10 11:07:04 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop 0
2018.02.10 11:07:05 4: WEB_192.168.180.35_65061 GET /fhem?XHR=1&inform=type=status;filter=room=XiaomiBTLESens;since=1518257221;fmt=JSON&fw_id=26&timestamp=1518257225135; BUFLEN:0
2018.02.10 11:07:09 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 35 2e 37 20 48 3d 38 32 2e 37 00
Notification handle = 0x000e value,54 3d 35 2e 35 20 48 3d 38 34 2e 30 00
Notification handle = 0x000e value,54 3d 35 2e 38 20 48 3d 38 33 2e 30 00
Notification handle = 0x000e value,54 3d 35 2e 36 20 48 3d 38 34 2e 30 00
Notification handle = 0x000e value,54 3d 35 2e 37 20 48 3d 38 32 2e 37 00
Notification handle = 0x000e value,54 3d 35 2e 35 20 48 3d 38 34 2e 31 00
Notification handle = 0x000e value,54 3d 35 2e 37 20 48 3d 38 32 2e 39 00
Notification handle = 0x000e value,54 3d 35 2e 35 20 48 3d 38 34 2e 30 00
Notification handle = 0x000e value,54 3d 35 2e 37 20 48 3d 38 32 2e 38 00
Notification handle = 0x000e value,54 3d 35 2e 35 20 48 3d 38 34 2e 30 00

2018.02.10 11:07:09 4: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 35 2e 37 20 48 3d 38 32 2e 37 00 ,54 3d 35 2e 35 20 48 3d 38 34 2e 30 00
Notification handle = 0x000e value,54 3d 35 2e 38 20 48 3d 38 33 2e 30 00
Notification handle = 0x000e value,54 3d 35 2e 36 20 48 3d 38 34 2e 30 00
Notification handle = 0x000e value,54 3d 35 2e 37 20 48 3d 38 32 2e 37 00
Notification handle = 0x000e value,54 3d 35 2e 35 20 48 3d 38 34 2e 31 00
Notification handle = 0x000e value,54 3d 35 2e 37 20 48 3d 38 32 2e 39 00
Notification handle = 0x000e value,54 3d 35 2e 35 20 48 3d 38 34 2e 30 00
Notification handle = 0x000e value,54 3d 35 2e 37 20 48 3d 38 32 2e 38 00
Notification handle = 0x000e value,54 3d 35 2e 35 20 48 3d 38 34 2e 30 00

2018.02.10 11:07:09 5: Cmd: >{BlockingStart('2')}<
2018.02.10 11:07:09 5: Cmd: >{XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"54 3d 35 2e 37 20 48 3d 38 32 2e 37 00 "}')}<
2018.02.10 11:07:09 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Done: gatttool return string: zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"54 3d 35 2e 37 20 48 3d 38 32 2e 37 00 "}
2018.02.10 11:07:09 4: XiaomiBTLESens (zoldertem) - ProcessingNotification
2018.02.10 11:07:09 4: XiaomiBTLESens (zoldertem) - ProcessingNotification: handle 0x10
2018.02.10 11:07:09 4: XiaomiBTLESens (zoldertem) - Thermo/Hygro Sens Handle0x10
2018.02.10 11:07:09 5: Starting notify loop for zoldertem, 3 event(s), first is humidity: 2.7\000
2018.02.10 11:07:09 5: createNotifyHash
2018.02.10 11:07:09 5: End notify loop for zoldertem

CoolTux

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

ok i have find the problem and evaluateted the solution. give me one day.
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

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

kroonen

almost, the humidity it gives 8.9 and should give 78.9


fhem> l zoldertem 
Internals:
   BTMAC      4C:65:A8:D1:7D:DC
   DEF        4C:65:A8:D1:7D:DC
   INTERVAL   300
   NAME       zoldertem
   NOTIFYDEV  global,zoldertem
   NR         21
   NTFY_ORDER 50-zoldertem
   STATE      active
   TYPE       XiaomiBTLESens
   VERSION    2.0.8pri1
   loglevel   4
   READINGS:
     2018-02-10 18:51:41   battery         ok
     2018-02-10 18:51:41   batteryLevel    100
     2018-02-09 08:59:59   firmware        00.00.66
     2018-02-10 18:51:46   humidity        8.9
     2018-02-10 13:13:46   lastGattError   no data response
     2018-02-10 18:51:46   state           active
     2018-02-10 18:51:46   temperature     6.9
   helper:
     CallBattery 0
     CallSensDataCounter 0
     updateTimeCallBattery 1518285101.49253
     updateTimestampCallBattery 2018-02-10 18:51:41
Attributes:
   interval   300
   model      thermoHygroSens
   room       XiaomiBTLESens



2018.02.10 18:47:54 5: Cmd: >get zoldertem sensorData<
2018.02.10 18:47:54 4: XiaomiBTLESens (zoldertem) - Run CreateParamGatttool with mod: write
2018.02.10 18:47:54 4: BlockingCall (XiaomiBTLESens_ExecGatttool_Run): created child (1290), uses telnetPort to connect back
2018.02.10 18:47:54 5: Starting notify loop for zoldertem, 1 event(s), first is write sensor data
2018.02.10 18:47:54 5: createNotifyHash
2018.02.10 18:47:54 5: End notify loop for zoldertem
2018.02.10 18:47:54 5: XiaomiBTLESens (zoldertem) - Write XiaomiBTLESens_ExecGatttool_Run zoldertem|4C:65:A8:D1:7D:DC|write|0x10|0100
2018.02.10 18:47:54 4: WEB: /fhem?detail=zoldertem&dev.getzoldertem=zoldertem&cmd.getzoldertem=get&arg.getzoldertem=sensorData&val.getzoldertem=&XHR=1&addLinks=1&fwcsrf=csrf_204325950458568&fw_id=50 / RL:20 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/
2018.02.10 18:47:54 4: Connection accepted from telnetPort_127.0.0.1_36184
2018.02.10 18:47:54 5: Cmd: >{BlockingRegisterTelnet($cl,4)}<
2018.02.10 18:47:54 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command - timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop - 0
2018.02.10 18:47:59 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result
2018.02.10 18:47:59 1: PERL WARNING: Use of uninitialized value in split at ./FHEM/74_XiaomiBTLESens.pm line 485.
2018.02.10 18:47:59 1: PERL WARNING: Use of uninitialized value $gtResult[1] in substitution (s///) at ./FHEM/74_XiaomiBTLESens.pm line 486.
2018.02.10 18:47:59 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command - timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop - 1
2018.02.10 18:48:04 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 36 2e 39 20 48 3d 37 38 2e 39 00
Notification handle = 0x000e value,54 3d 36 2e 39 20 48 3d 37 38 2e 38 00
Notification handle = 0x000e value,54 3d 36 2e 38 20 48 3d 37 38 2e 33 00
Notification handle = 0x000e value,54 3d 36 2e 38 20 48 3d 37 38 2e 37 00
Notification handle = 0x000e value,54 3d 36 2e 38 20 48 3d 37 38 2e 35 00
Notification handle = 0x000e value,54 3d 36 2e 38 20 48 3d 37 38 2e 38 00

2018.02.10 18:48:04 4: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 36 2e 39 20 48 3d 37 38 2e 39 00 ,54 3d 36 2e 39 20 48 3d 37 38 2e 38 00
Notification handle = 0x000e value,54 3d 36 2e 38 20 48 3d 37 38 2e 33 00
Notification handle = 0x000e value,54 3d 36 2e 38 20 48 3d 37 38 2e 37 00
Notification handle = 0x000e value,54 3d 36 2e 38 20 48 3d 37 38 2e 35 00
Notification handle = 0x000e value,54 3d 36 2e 38 20 48 3d 37 38 2e 38 00

2018.02.10 18:48:04 5: Cmd: >{BlockingStart('4')}<
2018.02.10 18:48:04 5: Cmd: >{XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"54 3d 36 2e 39 20 48 3d 37 38 2e 39 00 "}')}<
2018.02.10 18:48:04 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Done: gatttool return string: zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"54 3d 36 2e 39 20 48 3d 37 38 2e 39 00 "}
2018.02.10 18:48:04 4: XiaomiBTLESens (zoldertem) - ProcessingNotification
2018.02.10 18:48:04 4: XiaomiBTLESens (zoldertem) - ProcessingNotification: handle 0x10
2018.02.10 18:48:04 4: XiaomiBTLESens (zoldertem) - Thermo/Hygro Sens Handle0x10
2018.02.10 18:48:04 5: Starting notify loop for zoldertem, 3 event(s), first is humidity: 8.9\000
2018.02.10 18:48:04 5: End notify loop for zoldertem
2018.02.10 18:48:04 4: XiaomiBTLESens (zoldertem) - WriteReadings: Readings were written

CoolTux

exchanged numbers, sorry.
the humidity bug is fixed but i have change code from loop to outside of the loop. can you please test it? thanks

https://github.com/LeonGaultier/fhem-XiaomiBTLESens/archive/master.zip


tip. verbose not global, set verbose attribut at the sensor device to 5.
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

kroonen

It works, thnx for the support.

Another question, is there a reason why the interval can't be smaller than 300 sec. Is this for battery saving??? I like to set it to 150 sec

regards Richard

CoolTux

i have change the minimum inteval to 120s, but you have interval + random 90
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

Morgen früh wird es eine neue Version geben wo alle relevanten Änderungen welche sich in Zusammenarbeit mit kroonen ergeben haben.
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

kroonen

Hi,

I get sometimes in the logging some strange values, signs (ھɇ). I will try to debug if I get again one again.



2018-02-10_21:32:55 zoldertem write sensor data
2018-02-10_21:33:00 zoldertem temperature: ھɇ
2018-02-10_21:33:00 zoldertem humidity:
2018-02-10_21:33:00 zoldertem active
2018-02-10_21:34:45 zoldertem read sensor data
2018-02-10_21:34:49 zoldertem batteryLevel: 100
2018-02-10_21:34:49 zoldertem battery: ok
2018-02-10_21:34:49 zoldertem active
2018-02-10_21:34:49 zoldertem write sensor data
2018-02-10_21:34:54 zoldertem humidity: 79.8
2018-02-10_21:34:54 zoldertem temperature: 6.5
2018-02-10_21:34:54 zoldertem active
2018-02-10_21:38:03 zoldertem write sensor data

kroonen

I got one, and some debug..


2018.02.10 21:46:09 4: XiaomiBTLESens (zoldertem) - Run CreateParamGatttool with mod: write
2018.02.10 21:46:09 4: BlockingCall (XiaomiBTLESens_ExecGatttool_Run): created child (2658), uses telnetPort to connect back
2018.02.10 21:46:09 5: Starting notify loop for zoldertem, 1 event(s), first is write sensor data
2018.02.10 21:46:09 5: End notify loop for zoldertem
2018.02.10 21:46:09 5: XiaomiBTLESens (zoldertem) - Write XiaomiBTLESens_ExecGatttool_Run zoldertem|4C:65:A8:D1:7D:DC|write|0x10|0100
2018.02.10 21:46:09 4: XiaomiBTLESens (zoldertem) - stateRequestTimer: Call Request Timer
2018.02.10 21:46:09 4: Connection accepted from telnetPort_127.0.0.1_36268
2018.02.10 21:46:09 5: Cmd: >{BlockingRegisterTelnet($cl,6)}<
2018.02.10 21:46:09 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command: timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop 0
2018.02.10 21:46:14 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result
2018.02.10 21:46:14 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command: timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop 1
2018.02.10 21:46:14 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result connect error,Transport endpoint is not connected (107)

2018.02.10 21:46:14 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: call gatttool with command: timeout 5 gatttool -i hci0 -b 4C:65:A8:D1:7D:DC --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null and loop 2
2018.02.10 21:46:19 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool loop result Characteristic value was written successfully

2018.02.10 21:46:19 4: XiaomiBTLESens (zoldertem) - ExecGatttool_Run: gatttool result Characteristic value was written successfully

2018.02.10 21:46:19 5: Cmd: >{BlockingStart('6')}<
2018.02.10 21:46:19 5: Cmd: >{XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"no data response"}')}<
2018.02.10 21:46:19 5: XiaomiBTLESens (zoldertem) - ExecGatttool_Done: gatttool return string: zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"no data response"}
2018.02.10 21:46:19 4: XiaomiBTLESens (zoldertem) - ProcessingNotification
2018.02.10 21:46:19 4: XiaomiBTLESens (zoldertem) - ProcessingNotification: handle 0x10
2018.02.10 21:46:19 4: XiaomiBTLESens (zoldertem) - Thermo/Hygro Sens Handle0x10
2018.02.10 21:46:19 1: PERL WARNING: substr outside of string at ./FHEM/74_XiaomiBTLESens.pm line 718.
2018.02.10 21:46:19 3: eval: {XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"no data response"}')}
2018.02.10 21:46:19 1: PERL WARNING: Use of uninitialized value in pack at ./FHEM/74_XiaomiBTLESens.pm line 718.
2018.02.10 21:46:19 3: eval: {XiaomiBTLESens_ExecGatttool_Done('zoldertem|4C:65:A8:D1:7D:DC|ok|write|0x10|{"gtResult":"no data response"}')}
2018.02.10 21:46:19 5: Starting notify loop for zoldertem, 3 event(s), first is temperature: ھɇ
2018.02.10 21:46:19 5: End notify loop for zoldertem
2018.02.10 21:46:19 4: XiaomiBTLESens (zoldertem) - WriteReadings: Readings were written

CoolTux

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