Page 1 of 1

Xiaomi Mi Temperature and Humidity Monitor 2

Posted: Monday 26 October 2020 23:02
by Attis92
Hi All,

I'm new to this forum!
I just want to share with you a useful script for Xiaomi Mi Temperature and Humidity Monitor 2 sensor!
https://github.com/erdose/xiaomi-mi-lywsd03mmc
It is my first Github repository, so let me know if you have any feedback! :)

Re: Xiaomi Mi Temperature and Humidity Monitor 2

Posted: Friday 30 October 2020 11:14
by ruramos
Hi,
What firmware you use on Xiaomi Mi Temperature and Humidity Monitor ?

Re: Xiaomi Mi Temperature and Humidity Monitor 2

Posted: Thursday 31 December 2020 9:53
by rjblake
@Attis92 - many thanks. Am trying it out on a few devices. A few notes as follows (for others who might run into issue):
1. Requires Python 3.6 or higher
2. May need to edit the first line "#!/usr/bin/env python3" depending on Python setup for cron to work
3. Does not work with ATC firmware (from Aaron Christophel) https://github.com/atc1441/ATC_MiThermometer. Note that work is ongoing to improve power consumption and BLE transmission power, etc. so in long run this may be a better firmware than the stock one from Xiaomi

Re: Xiaomi Mi Temperature and Humidity Monitor 2

Posted: Wednesday 13 October 2021 11:33
by Milan
@Attis92 - super script. It's running ok. I tested two devices. But I had to add this library before install bluepy:
sudo apt-get install python3-pip libglib2.0-dev.
And I added rights to run py script and write to the folder.
I bought Xiaomi gateway v3, but unfortunately it's not compatible with Domoticz. And this solution is perfect.
Thanks.

Re: Xiaomi Mi Temperature and Humidity Monitor 2

Posted: Sunday 06 August 2023 0:16
by Lacman
Hi Attis92,

The python code seems to break for some reason, the log file stops showing anything after the password:
2023-08-06 00:07:59 INFO ***************************************
2023-08-06 00:07:59 INFO Start script...
2023-08-06 00:07:59 INFO Input parameters:
Domoticz Server IP: 127 .0 .0 .1
Domoticz Server Port: 8080
Domoticz Server User: ****
Domoticz Server Password: ****

Did everything according to your instructions on the github page, and the tweaks mentioned here.
I can reach the Xiaomi BLE device, can read its data, also I can modify the values in Domoticz by the format what the script should spit out and use in the end.
I am not that pro to debug python scripts such like this one.

Looking forward for your response,
Lacman

Re: Xiaomi Mi Temperature and Humidity Monitor 2

Posted: Wednesday 23 August 2023 21:45
by Havym
Since the update of domoticz i'm having problems updating the sensors. I tried with help from someone to fill my credentials and even call the script from root.

The error:

Code: Select all

Traceback (most recent call last):
  File "/home/pi/xiaomi-mi-lywsd03mmc/xiaomiBleLywsd03mmc.py", line 2, in <module>
    import config
  File "/home/pi/xiaomi-mi-lywsd03mmc/config.py", line 14
    TEMPERATURE_PREC = 2
                     ^
SyntaxError: invalid syntax