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

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

Vorheriges Thema - Nächstes Thema

t1me2die

Hier die Werte direkt beim Abruf im Terminal  :)

18,7Grad
62,2% Luftfeuchtigkeit


root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read -a 0x36
Characteristic value/descriptor: 08 37 00 10 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read -a 0x38
Characteristic value/descriptor: 0a 39 00 13 00

t1me2die

Hi Leon, klär mich mal etwas auf.
Irgendwie verändert sich die Ausgabe beim Terminal nicht, jedoch sind die Werte auf dem Display andere wie beim letzten Mal.
18,9Grad
63,3% Luftfeuchtigkeit


root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read -a 0x36
Characteristic value/descriptor: 08 37 00 10 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read -a 0x38
Characteristic value/descriptor: 0a 39 00 13 00

CoolTux

Aktuell suche ich im Netz nach Infos und Teste was ich finden kann. Aber irgendwie passt nichts.

Suche: Xiaomi Cleargrass gatttool
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

t1me2die

Moin Leon,

um ein bisschen mehr Verständnis für die Materie zu bekommen, google ich auch etwas.
Kurz zusammengefasst, mit 0x36, 0x32, 0x38 usw. werden einzelne Bereiche aus dem Gerät ausgelesen.
Der Wert wird als HEX Wert ausgelesen, richtig?
Dieser müsste dann noch nach ASCII übersetzt werden und sollte dann, irgendeine Zahl / Wert / Zeichen enthalten, der optimalerweise irgendwie im Gerät vorhanden/sichtbar wäre/ist.
Habe ich das soweit richtig verstanden?

Folgende Werte konnte ich identifizieren:
0x0022 = 51 69 6e 67 70 69 6e 67 20 54 65 63 68 6e 6f 6c 6f 67 79 20 28 42 65 69 6a 69 6e 67 29 20 43 6f 2e 2c 20 4c 74 64 2e
Herstellername = Qingping Technology (Beijing) Co., Ltd.

0x0024 = 43 47 47 31
Produkt ID = CGG1

0x0026 = 46 41 34 43 31 30 33 34 32 44 35 38
Keine Ahnung, was das sein soll?

0x0003 = 43 6c 65 61 72 47 72 61 73 73 20 54 65 6d 70 20 26 20 52 48
Name = ClearGrass Temp & RH

0x002a = 31 2e 31 2e 32 5f 30 30 32 30
Firmwareversion = 1.1.2_0020


Gruß
Mathze

CoolTux

Zitat von: t1me2die am 08 Oktober 2019, 12:23:10
Moin Leon,

um ein bisschen mehr Verständnis für die Materie zu bekommen, google ich auch etwas.
Kurz zusammengefasst, mit 0x36, 0x32, 0x38 usw. werden einzelne Bereiche aus dem Gerät ausgelesen.
Der Wert wird als HEX Wert ausgelesen, richtig?
Dieser müsste dann noch nach ASCII übersetzt werden und sollte dann, irgendeine Zahl / Wert / Zeichen enthalten, der optimalerweise irgendwie im Gerät vorhanden/sichtbar wäre/ist.
Habe ich das soweit richtig verstanden?

Folgende Werte konnte ich identifizieren:
0x0022 = 51 69 6e 67 70 69 6e 67 20 54 65 63 68 6e 6f 6c 6f 67 79 20 28 42 65 69 6a 69 6e 67 29 20 43 6f 2e 2c 20 4c 74 64 2e
Herstellername = Qingping Technology (Beijing) Co., Ltd.

0x0024 = 43 47 47 31
Produkt ID = CGG1

0x0026 = 46 41 34 43 31 30 33 34 32 44 35 38
Keine Ahnung, was das sein soll?

0x0003 = 43 6c 65 61 72 47 72 61 73 73 20 54 65 6d 70 20 26 20 52 48
Name = ClearGrass Temp & RH

0x002a = 31 2e 31 2e 32 5f 30 30 32 30
Firmwareversion = 1.1.2_0020


Gruß
Mathze

Genau so ist es. Und eigentlich sollte Temperatur und Luftfeuchte in getrennten Charactaristics liegen.
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

t1me2die

Ich habe auch gelesen, dass man in manchen Fällen ein Write auf einen Bereich machen muss, damit das gute Gerät einen Wert ausspuckt?
Ist das reines ausprobieren und raten oder wie geht man da am besten vor?
Die ein oder anderen "Strings" habe ich ja schon gefunden, die interessanten Informationen wie Temperatur und Luftfeuchtigkeit nicht...

Gruß
Mathze

t1me2die

So, von 1-40 habe ich nun alle durch, leider ohne große neue Erkenntnisse.
Wie suche ich nun weiter?


root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0001
Characteristic value/descriptor: 00 18
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0002
Characteristic value/descriptor: 0a 03 00 00 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0003
Characteristic value/descriptor: 43 6c 65 61 72 47 72 61 73 73 20 54 65 6d 70 20 26 20 52 48
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0004
Characteristic value/descriptor: 02 05 00 01 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0005
Characteristic value/descriptor: 00 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0006
Characteristic value/descriptor: 02 07 00 04 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0007
Characteristic value/descriptor: 10 00 3c 00 00 00 90 01
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0008
Characteristic value/descriptor: 02 09 00 a6 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0009
Characteristic value/descriptor: 01
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0010
Characteristic value/descriptor:
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0011
Characteristic value/descriptor: 00 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0012
Characteristic value/descriptor: 4d 46 50 44 53 46 42 55 46 45 4a 55 00 00 21 22
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0013
Characteristic value/descriptor: 0c 14 00 01 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0014
Characteristic value/descriptor: 01
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0015
Characteristic value/descriptor: 10 16 00 02 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0016
Characteristic value/descriptor: 05
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0017
Characteristic value/descriptor: 00 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0018
Characteristic value/descriptor: 0c 19 00 03 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0019
Characteristic value/descriptor: fe
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0020
Characteristic value/descriptor: 0a 18
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0021
Characteristic value/descriptor: 02 22 00 29 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0022
Characteristic value/descriptor: 51 69 6e 67 70 69 6e 67 20 54 65 63 68 6e 6f 6c 6f 67 79 20 28 42 65 69 6a 69 6e 67 29 20 43 6f 2e 2c 20 4c 74 64 2e
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0023
Characteristic value/descriptor: 02 24 00 24 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0024
Characteristic value/descriptor: 43 47 47 31
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0025
Characteristic value/descriptor: 02 26 00 25 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0026
Characteristic value/descriptor: 46 41 34 43 31 30 33 34 32 44 35 38
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0027
Characteristic value/descriptor: 02 28 00 27 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0028
Characteristic value/descriptor: 30 30 30 31
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0029
Characteristic value/descriptor: 02 2a 00 26 2a
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0030
Characteristic value/descriptor: 47 03
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0031
Characteristic value/descriptor: 02 32 00 04 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0032
Characteristic value/descriptor: 0a 58 c4 7c d3 b7 2a 2b f1 13
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0033
Characteristic value/descriptor: 18 34 00 05 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0034
Characteristic value/descriptor read failed: Attribute can't be read
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0035
Characteristic value/descriptor: 00 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0036
Characteristic value/descriptor: 08 37 00 10 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0037
Characteristic value/descriptor read failed: Attribute can't be read
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0038
Characteristic value/descriptor: 0a 39 00 13 00
root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0039
Characteristic value/descriptor: 3b 14 99 26 cf db 34 2a f3 53 45 3b 41 6f a3 9f 29 09 70 38


Gruß
Mathze

CoolTux

Im Grunde kann man nur schauen wie die anderen es im Netz gemacht haben. Gerade was die erhaltenden HEX Werte und deren umwandeln an geht.
Leider komme ich aktuell nicht zu viel.
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

t1me2die

Ich habe nun noch etwas herumgespielt, aber so richtig schlau werde ich daraus noch nicht.

Zuerst einmal habe ich mich ins gatttool verbunden mit:
gatttool -I

Danach mit dem Device verbunden und die characteristics abgefragt.
Ich habe dann alle handle's einmal gelesen und hinzugefügt.

[58:2D:34:10:4C:FA][LE]> characteristics
handle: 0x0002, char properties: 0x0a, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
Hex: 43 6c 65 61 72 47 72 61 73 73 20 54 65 6d 70 20 26 20 52 48
ASCII: ClearGrass Temp & RH

handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
Hex: 00 00
ASCII:

handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
HEX: 10 00 3c 00 00 00 90 01
ASCII: Nicht leserlich?!

handle: 0x0008, char properties: 0x02, char value handle: 0x0009, uuid: 00002aa6-0000-1000-8000-00805f9b34fb
HEX: 01
ASCII: Nicht leserlich?!

handle: 0x000b, char properties: 0x20, char value handle: 0x000c, uuid: 00002a05-0000-1000-8000-00805f9b34fb
can't be read

handle: 0x000f, char properties: 0x18, char value handle: 0x0010, uuid: 8ec90003-f315-4f60-9fb8-838830daea50
blank

handle: 0x0013, char properties: 0x0c, char value handle: 0x0014, uuid: 00000001-0000-1000-8000-00805f9b34fb
HEX: 01
ASCII: Nicht leserlich?!

handle: 0x0015, char properties: 0x10, char value handle: 0x0016, uuid: 00000002-0000-1000-8000-00805f9b34fb
HEX: 05
ASCII: Nicht leserlich?!

handle: 0x0018, char properties: 0x0c, char value handle: 0x0019, uuid: 00000003-0000-1000-8000-00805f9b34fb
HEX: fe
ASCII: Nicht leserlich?!

handle: 0x001a, char properties: 0x10, char value handle: 0x001b, uuid: 00000004-0000-1000-8000-00805f9b34fb
HEX: fe
ASCII: Nicht leserlich?!

handle: 0x001d, char properties: 0x10, char value handle: 0x001e, uuid: 00000100-0000-1000-8000-00805f9b34fb
HEX: 05
ASCII: Nicht leserlich?!

handle: 0x0021, char properties: 0x02, char value handle: 0x0022, uuid: 00002a29-0000-1000-8000-00805f9b34fb
HEX: 51 69 6e 67 70 69 6e 67 20 54 65 63 68 6e 6f 6c 6f 67 79 20 28 42 65 69 6a 69 6e 67 29 20 43 6f 2e 2c 20 4c 74 64 2e
ASCII: Qingping Technology (Beijing) Co., Ltd.

handle: 0x0023, char properties: 0x02, char value handle: 0x0024, uuid: 00002a24-0000-1000-8000-00805f9b34fb
HEX: 43 47 47 31
ASCII: CGG1

handle: 0x0025, char properties: 0x02, char value handle: 0x0026, uuid: 00002a25-0000-1000-8000-00805f9b34fb
HEX: 46 41 34 43 31 30 33 34 32 44 35 38
ASCII: FA4C10342D58

handle: 0x0027, char properties: 0x02, char value handle: 0x0028, uuid: 00002a27-0000-1000-8000-00805f9b34fb
HEX: 30 30 30 31
ASCII: 0001

handle: 0x0029, char properties: 0x02, char value handle: 0x002a, uuid: 00002a26-0000-1000-8000-00805f9b34fb
HEX: 31 2e 31 2e 32 5f 30 30 32 30
ASCII: 1.1.2_0020

handle: 0x002c, char properties: 0x18, char value handle: 0x002d, uuid: 00000001-0000-1000-8000-00805f9b34fb
cant be read

handle: 0x002f, char properties: 0x02, char value handle: 0x0030, uuid: 00000002-0000-1000-8000-00805f9b34fb
HEX: 47 03
ASCII: Nicht leserlich?!

handle: 0x0031, char properties: 0x02, char value handle: 0x0032, uuid: 00000004-0000-1000-8000-00805f9b34fb
HEX: 0a 58 c4 7c d3 b7 2a 2b f1 13
ASCII: Nicht leserlich?

handle: 0x0033, char properties: 0x18, char value handle: 0x0034, uuid: 00000005-0000-1000-8000-00805f9b34fb
cant be read

handle: 0x0036, char properties: 0x08, char value handle: 0x0037, uuid: 00000010-0000-1000-8000-00805f9b34fb
cant be read

handle: 0x0038, char properties: 0x0a, char value handle: 0x0039, uuid: 00000013-0000-1000-8000-00805f9b34fb
HEX: 3b 14 99 26 cf db 34 2a f3 53 45 3b 41 6f a3 9f 29 09 70 38
ASCII: Nicht leserlich?!

handle: 0x003a, char properties: 0x02, char value handle: 0x003b, uuid: 00000014-0000-1000-8000-00805f9b34fb
HEX: 51 04 bf 7e 7d 10 be 4d 71 7b 8f 2f
ASCII: Nicht leserlich?!


Einige handles konnte ich gar nicht lesen, obwohl sie mir als characteristics angezeigt wurden, verstehe ich nicht.
Manche ASCII Übersetzungen sind für mich nur Hieroglyphen, ggf. versteckt sich hier eine andere Übersetzung? Vielleicht muss ich den HEX Wert anders übersetzen? Tipps?

Die ganzen handle's bin ich nun gefühlt mehrfach durchgegangen, jedoch ohne ein Anzeichen einer Temperatur / Luftfeuchtigkeit.

[58:2D:34:10:4C:FA][LE]> char-desc
handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x0008, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0009, uuid: 00002aa6-0000-1000-8000-00805f9b34fb
handle: 0x000a, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x000b, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000c, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x000d, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x000e, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x000f, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0010, uuid: 8ec90003-f315-4f60-9fb8-838830daea50
handle: 0x0011, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0012, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0013, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0014, uuid: 00000001-0000-1000-8000-00805f9b34fb
handle: 0x0015, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0016, uuid: 00000002-0000-1000-8000-00805f9b34fb
handle: 0x0017, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0018, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0019, uuid: 00000003-0000-1000-8000-00805f9b34fb
handle: 0x001a, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x001b, uuid: 00000004-0000-1000-8000-00805f9b34fb
handle: 0x001c, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x001d, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x001e, uuid: 00000100-0000-1000-8000-00805f9b34fb
handle: 0x001f, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0020, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0021, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0022, uuid: 00002a29-0000-1000-8000-00805f9b34fb
handle: 0x0023, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0024, uuid: 00002a24-0000-1000-8000-00805f9b34fb
handle: 0x0025, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0026, uuid: 00002a25-0000-1000-8000-00805f9b34fb
handle: 0x0027, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0028, uuid: 00002a27-0000-1000-8000-00805f9b34fb
handle: 0x0029, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x002a, uuid: 00002a26-0000-1000-8000-00805f9b34fb
handle: 0x002b, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x002c, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x002d, uuid: 00000001-0000-1000-8000-00805f9b34fb
handle: 0x002e, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x002f, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0030, uuid: 00000002-0000-1000-8000-00805f9b34fb
handle: 0x0031, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0032, uuid: 00000004-0000-1000-8000-00805f9b34fb
handle: 0x0033, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0034, uuid: 00000005-0000-1000-8000-00805f9b34fb
handle: 0x0035, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0036, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0037, uuid: 00000010-0000-1000-8000-00805f9b34fb
handle: 0x0038, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0039, uuid: 00000013-0000-1000-8000-00805f9b34fb
handle: 0x003a, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x003b, uuid: 00000014-0000-1000-8000-00805f9b34fb


Das war es erstmal von meiner Seite, schwierig da durchzusteigen  ;D

Gruß
Mathze

CoolTux

Temperatur und Humidity sind Hex Zahlen aber gerade bei Temperatur kommt es drauf an. Kann sein das 3-4 vor 1-2 kommen muss und dann / 100 oder 10
Das muss man versuchen im Netz raus zu bekommen.
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

t1me2die

Es soll wohl für HA schon einen Support geben, dazu versuche ich den github Code zu verstehen:
https://github.com/1technophile/OpenMQTTGateway/blob/development/main/ZgatewayBT.ino

Dort ist ein Beispiel vorhanden für den Cleargrass

//example "servicedata":"5030470340743e10342d58041002d6000a100164"

Leider ist der Aufbau hier nicht ganz erklärt.

In einem anderen github:
https://github.com/alexvenom/XiaomiCleargrassInkDislpay/blob/master/XiaomiClearGrassInk.js
gibt es auch ein Beispiel inkl. Erläuterung:

/* All the information is in this Property called "FDCD" on the advertising data.
           The HEX string is as follows:
           "0807453810342d580104f500da02020145" (quotes included)
           To which:
           0807 or 0801: Ignore, but useful to identify relevant data
           453810342d58: MAC address, INVERTED (58:2d:34:10:38:45)
           0104f500da02: Data for Temperature and Humidity, broken as follows
             - 01: Indicates the Temperature and Humidity events
             - 04: Event data length (4, 2 bytes for Temperature, 2 bytes for Humidity)
             - f500: Temperature data inverted (00f5), which translates to 245, equivalent to 24.5C
             - da02: Humitity data inverted (02da), which translates to 730, equivalent to 73.0%
           020145: Data for Battery, bronek as follows
             - 02: Indicates the Battery events
             - 01: Event data length (1 byte)
             - 45: Battery data, which translates to 69, equivalent to 69%
        */


Diese beiden Beispiele ähneln sich in gewisserweise, denn in beiden Beispielen sind auf jeden Fall die MAC Adresse enthalten.
Solch einen langen String erhalte ich aber in keinem handle.
Ausschlaggebend ist wohl der Teil, der direkt hinter der MAC kommt.

Die MAC finde ich:

handle: 0x0025, char properties: 0x02, char value handle: 0x0026, uuid: 00002a25-0000-1000-8000-00805f9b34fb
HEX: 46 41 34 43 31 30 33 34 32 44 35 38
ASCII: FA4C10342D58

Hierbei ist die MAC auch inverted.

Soviel zu meinem aktuellen Wissenstand  :)

Gruß
Mathze

t1me2die

Moin Leon,

ich habe soeben meine alten notierten Werte mit den neuen abgerufenen Werten verglichen.
Nur bei ganz wenigen handle's ist mir eine Veränderung aufgefallen.
Hier habe ich mir die HEX Werte genauer angeschaut.


root@raspberrypi:~# gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x1e
Altes Ergebnis: Characteristic value/descriptor: 05
Neues Ergebnis: Characteristic value/descriptor: 05 08 b0 00 38 02


Bedeutung HEX -> Decimal

b0 = 176 / 10 = 17,6Grad Temperatur
38 = 56 = 56% Luftfeuchtigkeit


Die angezeigte Temperatur passt ziemlich gut mit diesen Werten, jedoch bin ich erstmal vorsichtig mit meiner These.
Ich werde diesen handle nun genauer beobachten und Position des Sensors verändern, sobald ich dazu in der Lage bin  :)

Des Weiteren hatte sich der handle 0x0016 verändert:

root@raspberrypi:~#  gatttool -b 58:2D:34:10:4C:FA --char-read --handle=0x0016
Characteristic value/descriptor: 05
Veränderung: 05 0a 2b 2a 9e 5d


Aus diesen Werten kann ich aber keinerlei Rückschlüße ziehen.

Gruß
Mathze

CoolTux

Super. Vielen Dank das Du Dich da so ein bringst.
Ich werde sehen das ich die Tage da mal eine Version für Dich fertig mache.
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

t1me2die

Zitat von: CoolTux am 10 Oktober 2019, 07:56:01
Super. Vielen Dank das Du Dich da so ein bringst.
Ich werde sehen das ich die Tage da mal eine Version für Dich fertig mache.

Moin Leon,

ich denke mein handle für die Luftfeuchtigkeit ist noch nicht korrekt, da muss ich weiter die Daten analysieren.
Der battery-handle ist mit ziemlicher Sicherheit auch nicht korrekt, jedoch wollte ich mich an deiner Quelle erstmal orientieren!

Folgende handle's sind korrekt:
* devicename
* firmware
* macInverted
* manufactor
* productID

Folgende handle's sind evtl. richtig:
* temperature

Folgende handle's sind höhstwahrscheinlich falsch:
* humidty
* batteryPercent (bzw. daraus ermittelst du ja batteryState)

Ich habe mir die Version 2.4.7 genommen und diese überarbeitet.
Ich habe versucht jeden Code von mir mit
#t1me2die
zu markieren bzw. deinen Code unangetastet zu lassen bzw. ihn einfach auskommentiert.
Im Anhang findest du den vorrübergehenden Code.
Außerdem habe ich paar Screenshots hinzugefügt.

Sobald ich die handle's noch weitere analysiert habe, muss ich die jeweiligen handle's + sub's nur noch anpassen, dass sollte nicht so schwierig sein.

Gruß
Mathze

PS.: Ich bin noch in der Perl-Lernphase  ;)