Closed GrumpyMeow closed 4 years ago
You mean here? https://github.com/espruino/EspruinoHub/blob/master/lib/attributes.js#L44
Aren't those characteristics for when you're connected? attributes.js just deals with advertising data - although I'm sure it could be extended to deal with different types of data.
It'd definitely not specifically for "Xiaomi Mija LYWSDCGQ/01ZM" since I have the Mi Flora and that sends the same advertising data.
I think this commit https://github.com/espruino/EspruinoHub/commit/8a6fe25df61367eb4f1fdeab69a6460be60f17e2 broke support for CGG1. temp
, humidity
and battery
now only work for LYWSDCGQ.
conservatory - MJ_HT_V1 (RSSI -82)
fe95 => {"frameControl":8272,"productId":426,"counter":233,"productName":"LYWSDCGQ","temp":13.9,"humidity":82.1}
ffff => {"data":"224,19,104,80,168,155"}
hallway - Qingping Temp & RH M (RSSI -72)
fe95 => {"frameControl":12368,"productId":839,"counter":70,"productName":"CGG1"}
fdcd => [8,7,62,82,16,52,45,88,1,4,187,0,165,2,2,1,18]
Thanks for letting me know. Looks like this could be fixed by moving the if (d[11] == 0x04) {
line and what follows outside of the switch
statement. Do you think you could give it a go and let me know if it works? I don't have the stuff here to test
I'll give it a go tonight.
Yep. That fixes it.
conservatory - MJ_HT_V1 (RSSI -82)
fe95 => {"frameControl":8272,"productId":426,"counter":36,"productName":"LYWSDCGQ","temp":14.7,"humidity":76.9}
ffff => {"data":"224,19,104,80,168,155"}
hallway - Qingping Temp & RH M (RSSI -71)
fdcd => [8,7,62,82,16,52,45,88,1,4,188,0,160,2,2,1,18]
fe95 => {"frameControl":12368,"productId":839,"counter":239,"productName":"CGG1","temp":18.8,"humidity":67.2}
@gfwilliams was your Mi Flora broken?
Ahh, I didn't twig that the Mi Flora was the one - actually it's not within range of my EspruinoHub device so I'd kindof forgotten about it.
Thanks for the fix!
Hi,
the current implementation is very specific for the "Xiaomi Mija LYWSDCGQ/01ZM". Other Xiaomi devices (yee-rc and Amazfit watches) advertise the same service "fe95". I'll try to do some refactoring to support more Xiaomi device types.
Services exposed by my Xiaomi Amazfit Stratos watch: