Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LYWSDCGQ/01ZM Unknown Advertisement #680

Closed
cuppa-joe opened this issue Jan 31, 2022 · 7 comments
Closed

LYWSDCGQ/01ZM Unknown Advertisement #680

cuppa-joe opened this issue Jan 31, 2022 · 7 comments

Comments

@cuppa-joe
Copy link

I am having an issue where packets from a LYWSDCGQ are unknown. The sensor is correctly seen and decoded in ESPHome, and the packet is forwarded correctly to Home Assistant. A LYWSD02 and a LYWSD03MMC (with custom firmware) both work fine.

ESPHome Log:
[09:53:46][D][xiaomi_ble:311]: Got Xiaomi LYWSDCGQ (4C:65:A8:DC:F0:FF): [09:53:46][D][xiaomi_ble:314]: Temperature: 21.0°C [09:53:46][D][xiaomi_ble:317]: Humidity: 38.4% [09:53:46][D][sensor:125]: 'lite DCF0FF Temperature': Sending state 21.00000 °C with 1 decimals of accuracy [09:53:46][D][sensor:125]: 'lite DCF0FF Humidity': Sending state 38.40000 % with 1 decimals of accuracy [09:53:46][D][ble_gateway:063]: [4C:65:A8:DC:F0:FF] Packet 043E3F02010000FFF0DCA8654C33020106151695FE5020AA01E3FFF0DCA8654C0D1004D200800109094D4A5F48545F563105030F180A180916FFFFEADEFE817E90B6 [09:53:51][D][xiaomi_ble:311]: Got Xiaomi LYWSD02 (E7:2E:00:E1:6C:E3): [09:53:51][D][xiaomi_ble:314]: Temperature: 16.3°C [09:53:51][D][sensor:125]: 'lite E16CE3 Temperature': Sending state 16.30000 °C with 1 decimals of accuracy [09:54:16][D][xiaomi_ble:311]: Got Xiaomi LYWSDCGQ (4C:65:A8:DC:F0:FF): [09:54:16][D][xiaomi_ble:314]: Temperature: 21.0°C [09:54:16][D][xiaomi_ble:317]: Humidity: 38.3% [09:54:16][D][sensor:125]: 'lite DCF0FF Temperature': Sending state 21.00000 °C with 1 decimals of accuracy [09:54:16][D][sensor:125]: 'lite DCF0FF Humidity': Sending state 38.30000 % with 1 decimals of accuracy [09:54:16][D][ble_gateway:063]: [4C:65:A8:DC:F0:FF] Packet 043E3F02010000FFF0DCA8654C33020106151695FE5020AA01F2FFF0DCA8654C0D1004D2007F0109094D4A5F48545F563105030F180A180916FFFFEADEFE817E90B4

Home Assistant Log:
2022-01-31 09:53:46 INFO (MainThread) [custom_components.ble_monitor.ble_parser] Unknown advertisement received: 043e3f02010000fff0dca8654c33020106151695fe5020aa01e3fff0dca8654c0d1004d200800109094d4a5f48545f563105030f180a180916ffffeadefe817e90b6 2022-01-31 09:54:16 INFO (MainThread) [custom_components.ble_monitor.ble_parser] Unknown advertisement received: 043e3f02010000fff0dca8654c33020106151695fe5020aa01f2fff0dca8654c0d1004d2007f0109094d4a5f48545f563105030f180a180916ffffeadefe817e90b4

@Ernst79
Copy link
Collaborator

Ernst79 commented Jan 31, 2022

The problem is that this advertisement contains two data packets of the service_data type (indicated with 16 on the 2nd byte)

  1. 151695fe5020aa01f2fff0dca8654c0d1004d2007f01
  2. 0916ffffeadefe817e90

The second is overwriting the first, while we need to use the first. I can adjust the parser for this, we had the same issue for the Manufacturer Specific Data (indicated with ff in the second byte).

@myhomeiot Just a check for you, is it possible that BLE gateway is combining two advertisements, or is this not possible? I only started to receive issues about multiple data packets in one advertisement from people that use BLE gateway. This might be just a coincidence, just checking.

@myhomeiot
Copy link
Collaborator

@Ernst79 BLE gateway send the data as is. The advertisements packet data was received by esp32_ble_tracker ESPHome components, inside this component it's works with BLE using Espressif SDK functions. So it's possible that SDK functions combine something inside, but we can't do anything with it :(

@myhomeiot
Copy link
Collaborator

@Ernst79 As I can see in ESPHome LYWSDCGQ component, it's has loop for service_data so it's expect one or more of them. The component skip service data if it's doesn't have a value or it's duplicate.

@Ernst79
Copy link
Collaborator

Ernst79 commented Jan 31, 2022

Ok, thanks. I will fix this asap.

@Ernst79
Copy link
Collaborator

Ernst79 commented Feb 1, 2022

Fixed in 7.4.1-beta. Let me know if it works

@Ernst79 Ernst79 added the fixed in beta This issue is fixed in the current beta release label Feb 1, 2022
@cuppa-joe
Copy link
Author

Working here. Thank you!

@Ernst79 Ernst79 removed the fixed in beta This issue is fixed in the current beta release label Feb 2, 2022
@Ernst79
Copy link
Collaborator

Ernst79 commented Feb 2, 2022

Fixed in 7.5.0

@Ernst79 Ernst79 closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants