-
Notifications
You must be signed in to change notification settings - Fork 117
lywsd03mmc AttributeError passive #203
Comments
Passive needs to be inside the args: in the config. Added this on the wrong level in the config.yaml.example, will change it asap. Also note that in order to do custom firmware custom advertising readout, you will need to set passive to true. Since it will publish the temp/humidity/battery data unencrypted inside of the passive advertisement data. |
@Westenberg ok changed position and pasive to true
|
looks like the logging can be improved when it can't receive the data but I can't see why it doesn't receive the data. Can you try to read the sensor with hcitool lescan or NRFconnect on android/iOS to see if the sensors are correctly flashed and outputting with custom advertisement type. Can you post the scan result line from the device with the service_data? |
|
I'm missing the service_data in the scan results but this could be because of the scan command. What do you get when you run: |
|
I can check/compare it some more this evening but it looks like it is not sending the custom advertising format. Can you set it again with the Telink Flasher. You can see/verify the format of the service data here: https://github.com/atc1441/ATC_MiThermometer#advertising-format-of-the-custom-firmware |
Ok, when go back to home i will check. |
I checked the sensors that I have and they are outputting service data that starts with the MAC address in the right order (not reversed). Let me know when you checked yours. I checked this with the NRFConnect app. |
But gateway:
|
In the screenshot you show the connected tab with all services. In this case connecting is not needed. Just go to the scanner tab, click on the device and then send a screen of the device expanded. Thanks. |
Your data is correct. I managed to reproduce the issue here for 1/4 sensors that I have, which is weird. |
I have 3 not working sensors. |
For the error I will add a check for None. But beside that I just discovered that this is caused by the sensor being too far away from the bluetooth scanner. Moved mine closer and it no longer has null values in MQTT. Can you try it as well. |
No its not a problem 2m 1m 0,5m same: Arguments: (None, None, None) |
Made a PR to first fix the logging and add some logging so we can debug this better: the null results are only happening here when the device can't be found. This can e.g. be because of wrong Mac address set, too short scan duration or device out of reach. In the code the scan_timeout was on 10 sec by default. I changed it to 20 and you can now customise it as well in the config. Check if any cases above for not being able to reach the device are applicable for your situation after updating. If not then share the improved logging output. |
@pidzej did you check the update? |
Yes but no data:
|
What the logging tells is that it is not receiving any data for the sensors in the Bluetooth scan loop. According to your previous NRFconnect screenshot I saw that the sensors are correctly setup so that would mean it is something in the receiving part of your Bluetooth scanner. Not in the sensor and not a bug in the worker code. |
Same issue here:
|
I will look into it asap and check if I can reproduce it. What hardware are you using? |
home-lab server with Debian 10 and CSR8510 A10 (Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)) FW is https://github.com/pvvx/ATC_MiThermometer/raw/master/ATC_Thermometer11.bin P.S. Now ill check new FW (https://github.com/pvvx/ATC_MiThermometer/raw/master/ATC_Thermometer12.bin) Edit: with FW 1.2 same issue
Edit2: MAC address is case sensitive, if we set as lowercase we can get data. But in my case this data is wrong as you can see. I think its a little-endian.
Edit 3: We can set adv format in @pvvx firmware, when it set as atc1441 everything works fine. |
Is it possible to have the worker parse both the "adv" and "mi like" formats for the ATC firmware? Mi like is useful with esphome, but was hoping to have the sensor read with bt-mqtt-gateway as well.
"Mi like" advertising comes from here Thanks! |
There is something wrong for sure with the calculation of the temperature when the temperature goes below zero (not sure about the exact value). I am running passive mode with the ATC firmware from @pvvx, with advertising mode set as atc1441.
So the data with temperature 'ffe4' gets converted to a temp of 6550.800000. The calculation seems wrong:
Compare this with the calculation that is done in this https://github.com/JsBergbau/MiTemperature2 where it works fine:
|
Does this work now properly? |
I can confirm the problem, it still exists. |
Ok wanted to switch from ESP32 to RPi Zero for BLE Tracking, but cant get to work any of my lywsd03mmc flashed with pvvx firmware - tried setting up beacon type to all, but can't get readings from any device. Running with latest Docker image. Always getting
|
The format is expected to change to new "HA_BLE" in newer versions when it becomes available in Home Assistant. |
Describe the bug
When added 2 lywsd03mmc getting error when start deamon
lywsd03mmc running custom firmware and advertising type set to custom
Config
Debug gateway logs
run gateway.py with -d switch and paste formatted output log
Server (please complete the following information):
The text was updated successfully, but these errors were encountered: