custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.9k stars 243 forks source link

Question about HHCCJCY01 #1390

Open danergo opened 1 day ago

danergo commented 1 day ago

Hi, I'm trying to understand this plant sensor's LE Service data. I know it's not sending its battery state, but I'm interested in others (temperature, soil, fertilization, sun).

Can you help me decoding, or point me to some docs?

For example: (service data in LE packet):

71209800a5FFEEDDCCBBAA0d0810011f

Packets have a fixed prefix:

71209800a5FFEEDDCCBBAA

(AA:BB:CC:DD:EE:FF is its MAC)

But I'm having issues understanding the rest bytes:

0d0810011f

Can you please help me with this?

Ernst79 commented 1 day ago

This device is also sending data in Xiaomi format (look for messages with 1695FE) That is what I use to get the data. https://github.com/custom-components/ble_monitor/blob/master/custom_components/ble_monitor/ble_parser/xiaomi.py

However, you might also be able to use the other data format you are showing.

In general, it is either a one byte or two byte data format, that has to be reversed order.

for example 0d08 has to be read as 080D. After converting it from hex to dec you get 2061, which most likely is 20,61°C 1001 is 0110 --> hex to dec --> 272 1f --> hex to dec --> 31 https://www.rapidtables.com/convert/number/hex-to-decimal.html

you have to do some guessing how the message is spit up, but the first two bytes look like temperature to me. In helps to make a long log with multiple messages. If a byte changes a lot, is is most likely the second byte of a two byte value. If it hardly changes, it is most likely a single byte value.

danergo commented 1 day ago

Thanks!

My values were:

Moisture: 31% Light: 105lux Temperature: 23.1C Fertility: 770us/cm

So 1f can be matched to Moisture, but rest are unclear.

So my device is not sending these broadcasts with xiaomi format?

Can I somehow force it to send the xiaomi format?

Service data is fe95, and interpreted as xiaomi (by btmon).

Ernst79 commented 1 day ago

You can force it to send xiaomi format by adding it to the Xiaomi Mi Home app. After adding it, it should start broadcasting in xiaomi format.

danergo commented 1 day ago

Thanks, I gave it a shot, but MiHome doesn't see it at all. It works with "Flower care" app, is it possible this is something different device?

On the packaging it shows: HHCCJCY01HHCC