I recently purchased one of these very cheap displays.
I hoped to pick up the readings in my Home Assistant. After some digging, I found that someone had managed to interface a Raspberry PI to it. From there it was plain sailing.
You can find my code and instructions on GitHub here https://github.com/AnthonyKNorman/Xiaomi_BLE_Temperature_Display_for_HA
Hello,
but how to use in Hassio. there is not
systemd so you cant start a service like:
sudo systemctl enable blemqtt
I run it on a separate Raspberry Pi Zero W.
I don’t see support for this model in openmqttgateway? Can you provide a link?
This is great - many thanks. It worked first time.
If anyone is trying to use it with Openhab, here are the entries from my .items file that use the MQTT interface.
Number Utility_Room_TempHumBLE_Sensor_Temperature "Utility Room BLE_Sensor:Temperature [%.1f C]" <temperature> (gIndoorTemps,gTemp,Temperature,gTemperature,gHistory) [ "Current Temperature" ]
{mqtt="<[mysensorsMQTT:blemqtt/sensor01:state:JSONPATH($.temperature)]" }
Number Utility_Room_TempHumBLE_Sensor_Humidity "Utility Room BLE_Sensor:Humidity [%.1f C]" <humidity> (gUtilityRoom,gIndoorHumidity,Humidity,gHistory) [ "Current Humidity" ]
{mqtt="<[mysensorsMQTT:blemqtt/sensor01:state:JSONPATH($.humidity)]" }
Any chance of extending the script to support multiple sensors?..
I wish it can be directly integrated with home assistant core integrations as BLE present on Raspberry PI 3B+ and above.
It’s integrated with HACS Xiaomi BLE integration. Just read docs for it.
I have now amended the scripts to support multiple sensors.
Great solution, but how to connect to mqtt with user and password?
If you have a look in the closed issues on github this has already been resolved. At some point I will add it to the parameters.
Thanks! I always forgetting about closed issues
Original script was modified for less energy usage, will you rewrite your code?
Latest version carries this modification.
Is it possible to run it on the same device where i have HA? or I need to buy other RPi?
I have only run this on a separate Raspberry Pi zero w. They are quite cheap. I have a prototype running using an ESP32 as the hub. This will make it very cheap. I will be posting this soon!
Tahnk you very much for your answer. I asked bcs right now I jave got only one RPi.
Running this chip on ESP32 is the best idea ( the cheapest and the lowest power consumption solution), It will be possible launch more than one sensor?
Yes. It supports up to twenty sensors.
I have posted about my esp32 code now https://github.com/AnthonyKNorman/Xiaomi_LYWSD03MMC_for_HA
How to connect to mqtt with user and password ?
The script has only the server address.