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

Xiaomi flowerpot support (Ropot, HHCCPOT002) #28

Closed Magalex2x14 closed 4 years ago

Magalex2x14 commented 4 years ago

Would it be possible to read data from a smart flowerpot from Xiaomi (Ropot)? I have the HHCCPOT002 version. This product appeared on the market at the same time as Flower Sensor. It only measures the moisture and conductivity of the soil. Has a built-in rechargeable battery.

_Originally posted by @kleju00 in https://github.com/custom-components/sensor.mitemp_bt/issues/3#issuecomment-576791285_

Magalex2x14 commented 4 years ago

@kleju00 Hello! Since I do not have this device, some information is needed. Here is the data collection instruction:

kleju00 commented 4 years ago

I have a problem eliminating all BLE devices because I have a lot of them. I used the Android application and captured some RAW data from this particular device:

0x020106030295FE141695FE71205D010D0D0C6D8D7CC40D091002A8000609726F706F74 0x020106030295FE141695FE71205D01490D0C6D8D7CC40D091002A7000609726F706F74 0x020106030295FE141695FE71205D012B0D0C6D8D7CC40D091002A9000609726F706F74 0x020106030295FE141695FE71205D01390D0C6D8D7CC40D091002A8000609726F706F74

The device was not connected to the phone and the BLE gateway from my Xiaomi Humidifier was turned off.

Real Soil moisture ~45 % Real Soil fertility ~170 uS/cm Battery level - 76%

Previously I used SmartThigs SmartApp which supported this pot. https://github.com/fison67/mi_connector/blob/master/devicetypes/fison67/xiaomi-flora-pot.src/xiaomi-flora-pot.groovy Maybe it will be helpful. If this is not enough, I will try to figure something out.

Magalex2x14 commented 4 years ago

I have a problem eliminating all BLE devices

It's okay if there is no such possibility. I’ll find the packets I need anyway. It would be more convenient for me to work with the hcidump dump... If possible, do it. I can tackle your question closer to the end of this week (now busy with #9). As far as I can see, there should be no problems with the implementation of the support of your pot.

kleju00 commented 4 years ago

Thanks a lot. I will try hcidump tomorrow.

kleju00 commented 4 years ago

This is my hcidump.txt

Real Soil moisture ~0 % (this reading sometimes breaks, connecting the charger helps) Real Soil fertility ~162 uS/cm Battery level - 76%

The file should also contain data from my LYWSD03MMC.

Magalex2x14 commented 4 years ago
NEW DATA: %s {'rssi': -80, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 117, 'conductivity': 163}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 118, 'moisture': 79}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 119, 'conductivity': 162}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 120, 'moisture': 79}
NEW DATA: %s {'rssi': -81, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 121, 'conductivity': 164}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 122, 'moisture': 79}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 123, 'conductivity': 162}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 124, 'moisture': 79}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 125, 'conductivity': 162}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 126, 'moisture': 79}
NEW DATA: %s {'rssi': -81, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 127, 'conductivity': 162}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 128, 'moisture': 79}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 129, 'conductivity': 162}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 130, 'moisture': 79}
NEW DATA: %s {'rssi': -85, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 131, 'conductivity': 162}
NEW DATA: %s {'rssi': -81, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 132, 'moisture': 79}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 133, 'conductivity': 162}
NEW DATA: %s {'rssi': -80, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 134, 'moisture': 79}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 135, 'conductivity': 162}
NEW DATA: %s {'rssi': -84, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 136, 'moisture': 79}
NEW DATA: %s {'rssi': -62, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 137, 'conductivity': 163}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 138, 'moisture': 79}
NEW DATA: %s {'rssi': -79, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 139, 'conductivity': 162}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 140, 'moisture': 79}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 141, 'conductivity': 162}
NEW DATA: %s {'rssi': -81, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 142, 'moisture': 79}
NEW DATA: %s {'rssi': -83, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 143, 'conductivity': 162}
NEW DATA: %s {'rssi': -82, 'mac': 'C47C8D6D0C0D', 'type': 'HHCCPOT002', 'packet': 144, 'moisture': 79}

How long is this dump? About seven minutes? You right, It seems that the pot behaves in the same way as miFlora (data 1-2 times per minute, no information about the battery). I also see data from the MiFlora sensor (HHCCJCY01). I do not see LYWSD03MMC (but it doesn’t matter, everything is complicated with its support so far).

Pot support will be added in an upcoming 0.4.3 release (today).

kleju00 commented 4 years ago

How long is this dump? About seven minutes?

I thought it was 3-4 min. Ropot sends data about twice as often as Flower care. Look:

image

I also have one CGG1. Thanks again for the quick help.

Magalex2x14 commented 4 years ago

Released

Ropot sends data about twice as often as Flower care

Thank you for your participation! Feel free to reopen issue if needed!

Magalex2x14 commented 4 years ago

LYWSD03MMC discussion here #7

kleju00 commented 4 years ago

I tested the new version and found a problem:

No conductivity entity, instead there is a inactive temperature entity. The humidity is read correctly.

Magalex2x14 commented 4 years ago

Very strange... how much time has passed since the launch of the new version of the component? Please, check MAC address carefully (entity ID) - must be C4 7C 8D 6D 0C 0D

kleju00 commented 4 years ago

image It looks like MAC is right. I updated to the new version as soon as it appeared in HACS.

Magalex2x14 commented 4 years ago

Yes, I think I was a little hurried... Give me a little time, I seem to have found the root of problem...

Magalex2x14 commented 4 years ago

@kleju00 please, reinstall 0.4.2 version through HACS. After you make sure that the correct entities appeared, the wrong one can be deleted through Configuration -> Entities

kleju00 commented 4 years ago

Now I have:

I'm using hassio on rpi3.

Screenshot_20200123-060144 Screenshot_20200123-060125

Magalex2x14 commented 4 years ago

Yes, the problem is deeper than I thought. Sorry, the day was too long yesterday )

kleju00 commented 4 years ago

Do not worry. It's nice that I can help you. When I get home I will give you the firmware version from the pot (complete information).

Magalex2x14 commented 4 years ago

@kleju00 please, reinstall 0.4.2 version through HACS.

kleju00 commented 4 years ago

Everything seems to be working. thx

Firmware version: 1.2.6

Magalex2x14 commented 4 years ago

Thank you. Let's watch a little bit. Just in case )

kleju00 commented 4 years ago

It still works. You can close.