Finally got my LYWSD03MMC sensors (square ones with encryption key).
They can be swapped between Celsius/Fahrenheit on the display from the app!
Procedure I followed:
First, you MUST install HACS “Xiaomi passive BLE monitor sensor platform” to be able to read LYWSD03MMC sensor(s).
The default/built-in one will currently not work with this sensor. After installing, reboot your HA!
Second, prep the Stream-app on your iOS device:
Open Stream -> HTTPS Sniffing -> CA Install. Then you will be directed to browser to download a VPN profile.
Go to General -> Profile -> Stream Generated CA… -> Install the VPN profile.
After installing VPN profile:
Open Stream -> HTTPS Sniffing -> hit trust CA in settings.
General -> About -> Certificate Trust Settings -> tick green on Stream Generated CA…
Third, make sure you are logged in to MiHome (ensure it is logged-out of other devices and region chosen is mainland China) and open Stream.
Then go to Stream-app and hit “Sniff now”, and immediately go to MiHome, pull the plastic-tab to activate sensor, and add the LYWSD03MMC sensor.
Follow the wizard. Wait for the app to read Temperature and Humidity. (Optionally you can get the MAC-address here. Under the sensor -> settings (3 dots in upper right corner) -> “About”. This is also where you can swap between displaying Celsius/Fahrenheit.
Go back to Stream-app and click “Stop Sniffing“.
Now in stream-app go to sniff history and search for the keyword “bltbind”.
You will see a file “POST https://api.io.mi.com/app/device/bltbind”
(If you don’t see that file, go back to step 2 to check whether the CA was trusted or not.)
Click on that file -> Request -> “Preview Form” at bottom, then at the top hit -> Format -> Decode -> now you look for: find “bind_key”, “value”:
After finding the bind_key, then add it to your “- platform: mitemp_bt” Configuration.yaml together with the MAC-address.
The MAC-address can be found in MiHome under the sensor and settings (3 dots in upper right corner), and “About” if you did not get it earlier. You can change between Celsius and Fahrenheit for the display here also.
Repeat this step until all sensors are added.
Fourth, when done adding all sensors, power-off HA, then restart it.
Once you HA is fully back online, go to Configuration -> Entities -> search for “mitemp_bt” and you will see the 2 sensors for each thermostat (one for temp, one for humidity). Be patient, it can take time (less than 10 minutes) for HA to detect them.
LYWSD03MMC broadcasts temperature and humidity once about every 10 minutes and battery level once an hour.
If you get impatient, you can look for the from the terminal:
root@hassio:~# bluetoothctl
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller B8:27:EB:07:AA:AA Discovering: yes
[NEW] Device A4:C1:38:AF:BB:BB LYWSD03MMC
[NEW] Device A4:C1:38:42:CC:CC LYWSD03MMC
[NEW] Device A4:C1:38:42:DD:DD LYWSD03MMC
[NEW] Device A4:C1:38:F1:EE:EE LYWSD03MMC
[NEW] Device A4:C1:38:38:FF:FF LYWSD03MMC
[NEW] Device A4:C1:38:4D:11:11 LYWSD03MMC
[bluetooth]# scan off
Discovery stopped
[bluetooth]# exit
root@hassio:~#
Added class 1 Bluetooth dongle for better reception:
TRENDnet Low Energy Micro Bluetooth 4.0 Class 1 USB 2.0, TBW-106UB
Distance: up to 100Meters/330 Feet.
https://www.amazon.com/gp/product/B002AQSTXM/
Battery indicator will show at the bottom if you click on the sensor.
My config:
sensor:
- platform: mitemp_bt
rounding: True
decimals: 1
active_scan: False
hci_interface:
- 0
- 1
encryptors:
'A4:C1:38:AF:BB:BB': '17CD89A41B9FB86CF760968F1C7C9B0D'
'A4:C1:38:42:CC:CC': '7426CA29015D144F489705CBC625C1C4'
'A4:C1:38:42:DD:DD': '7AB69F8D733EECAB92337D209ACD2B9E'
'A4:C1:38:F1:EE:EE': '2DC3683236481DAA7DA2B2FEE4BFD893'
'A4:C1:38:38:FF:FF': 'C9553E560EE6C36497A864D5E31F085C'
'A4:C1:38:4D:AA:AA': 'B2219D1E99985CC5BE2C3EDDE8D377C0'