-
Notifications
You must be signed in to change notification settings - Fork 15
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
LYWSD03MMC only returning battery (sometimes) #32
Comments
For me it's only battery value |
The issue i discovered is that this sensor transmits encrypted data. Maybe only if you connect to it directly it transmits unencrypted data but still that's annoying and tedious to do. I resolved by flashing the modified firmware from this repo and then installing the ble scanner featured in #12 . |
Hi Michele, if you could post your Node Red function that would be very useful! |
Same problem. I managed to read the data without changing the firmware using the following shell command taken from
|
I'm using node-red-contrib-ble-scan from @sjroe |
Thanks a lot! Worked for me) |
I've chosen the "Custom" type advertisment. Try opening up the payload and see if the service data look something like this: From what I see int the ATC Thermometer Documentation, The bytes used by temperature and humidity and so on are theese: My thermometer howevers doesn't send the first few bytes or so and thus in the function node i read the data from byte 6 onwards. Maybe that's the problem you are having. So i suggest to open the payload and see the service data. My code works with: If the temperature on the display is less than 25.5°C and you don't see the full number in the 7th byte, there is a problem with the advertisment data. Try putting a picture of the service data |
From what i see, that isn't a ATC Custom broadcast message. You can see it by the MAC address which is sent backwards from byte 5 to byte 10. Are you sure you flashed the firmware correctly and/or enabled Custom type broadcasting? When the battery is re-inserted, the sensor shows "Atc" and flashed the last 3 bytes of the MAC address in the humidity section, so in your case it will show f3, then 7b and then 0a. By default the firmware also flashes the battery percentage every 5 seconds or so. |
Thanks for your help! Ive set the Advertisement now to atc.... Now it works perfekt thank you. |
Nice to hear that! |
Hello, the code don't work if the temperature goes below 0 degree celsius. The temperature then is a strange number (6552) |
I've never tried and honestly never thought about that, because in my scenario that never happens. Maybe trying to use a dedicated function to parse a 16 bit integer could help, but i can't test it. |
Thank you. Now it works. With this dedicatet function: |
Thanks for this, @MicheleSilla810, I've been tearing my hair out trying to get it working... My sensor too only reported the battery (as 109) and about every second/third attempt reports an error. I implemented your solution but I am getting a weird temp. value:
The display itself shows 21.6 C so seems the sensor is working... Any clue? |
hi! |
When i try to retrieve data from the sensor, the first time it fails in about 5 seconds, the "requesting" status on the node has a green dot.
Then, the little bluetooth indicator on the sensor lights up and when trying to get data again, this time the "requesting" pill has a yellow color and it lasts for about 20 seconds, after which the bluetooth indicator on the sensor turns off and the node returns only the battery status, nothing more
Do i need to do something with the sensor? Do I have to connect it in some way to the pi before running the node?
I'm using a Pi 3A+, maybe that's the problem? I also just tried on the Pi 4 B and didn't work.
The text was updated successfully, but these errors were encountered: