AlCalzone Hi. Habe noch ein bischen im Internet recherchiert und folgenden Link gefunden:
https://github.com/alexvenom/XiaomiCleargrassInkDislpay/blob/master/XiaomiClearGrassInk.js
Darin steht, dass alle Informationen im service "FDCD" stehen und auch, was sie bedeuten:
/* 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%
Habe das eben mal mit meinem Teil nachgerechnet.
Aktueller Wert in fdcd: 8816 790812342d58 01 04 bb00 5e01 020164
Aufgedröselt nach obiger Beschreibung ergibt das:
8816 - Irgend was
790812342d58 - MAC Adresse umgedreht, passt.
01 04 - irgendwelche Events
bb00 - x00bb sind 187 entspricht 18,7°C
5e01 - x015e sind 350 entspricht 35%
020164 - relevant ist nur x64 entspricht 100%
und der Sensor zeigt an: 18,7°C, 35% Luftfeuchtigkeit und volle Batterie.
Ich würde sagen, das passt exakt. 👍
So wie ich das sehe, braucht es zum Auslesen ein eigenes Plugin, denn das Xiaomi Plugin erwartet die Daten im Service "fe95".
Die Daten aus dem Service String rauszuparsen ist eigentlich simpel (s. obigen Link):
if (JSON.stringify(serviceData[i].uuid).includes('fdcd')){
stringAdvertise = JSON.stringify(serviceData[i].data.toString('hex'))
temp = parseInt(stringAdvertise.substring(23, 25) + stringAdvertise.substring(21, 23), 16)
console.log('Temp: ' + temp/10 + 'ºC')
humidity = parseInt(stringAdvertise.substring(27, 29) + stringAdvertise.substring(25, 27), 16)
console.log('Humidity: ' + humidity/10 + '%')
battery = parseInt(stringAdvertise.substring(33, 35), 16)
console.log('Battery: ' + battery + '%')
console.log('')
}