Xiaomi ble temperature and humidity sensor hassio

13.11.2020 By Kazikora

Recent inmates

In order to maintain a comfortable environment, we need to know what happens in our house. In short, we need sensors. Xiaomi has many different ones, but most of all I liked the square thermometer on electronic ink. But CR batteries last for several years.

There is another version with bluetooth, but it is a little less elegant — a kind of thick pancake. It went, and finally arrived. In the MiHome application, the sensor was added without problems I have an English interface everywhere, with the Russian version of MiHome, they say, there were difficulties in translation.

But with the integration into the Home Assistant there were difficulties.

Xiaomi Smart Temperature & Humidity Sensor Review

The existing component for the temperature sensor did not want to take any data from the device and complained about the wrong data format. Well, there is nothing to do, we get a shovel and start digging. My first thought was to familiarize myself with the device of the BLE protocol, but after estimating the size of the documentation, it was decided to switch to the national tyk method.

The difference in the naming format of the model is somewhat alarming. Then you need to somehow read, and what data we can have at all.

xiaomi ble temperature and humidity sensor hassio

Opened the mitemp library sources, which is used in Home Assistant to get data from the old sensor. There I found that the library used blewrap, which, in turn, is a wrapper over two Python libraries to work with BLE. So many layers to me to anything, we will use bluepy. There is documentation, there is not a lot of it and not a little, we read and write a script that goes through all the data fields that are on the device. In general, everything is simple — the BLE device provides a set of services, each of which consists of a set of characteristics.

Each characteristic can be of one of 8 types, for one characteristic it is possible to specify several types simultaneously. So I considered all the characteristics for both sensors, looked at them and realized that devices from completely different manufacturers are being sold under the brand Xiaomi.

The structure of services and characteristics of these two sensors are also completely different, and the list of characteristics of the new sensor is twice as long. It became clear that you need to write your own library to integrate with the sensor no, of course I google first, maybe there is something useful at the request of LYWSD02, but I did not give anything sensible to Google.

Attempts to do something with my hands did not bring any result, the first line of despair was reached, but at that moment I I read articles about crafts based on chips from Nordic Semiconductors and put the nRF Connect program on a smartphone.

With it, I was able to subscribe to all the services provided by the device, saved the logs of the answers and began to try to understand what was in them. A feature of the old sensor was that the data on temperature and humidity came in the form of a UTF string, while the new one gave everything in binary form. To receive data from the sensor, you need to send a subscription request.

In the mitemp library for this, two bytes were sent to the characteristic, but it is not clear where to get it. Then I looked at how the data structure for the old sensor in nRF Connect looks and noticed that the correct address was specified for the characteristic with the data as a kind of descriptor.

Then I began to read the documentation for bluepy again and I realized that the address of the descriptor can be easily obtained from the object characteristics. It remains only to write a class with a callback method, which will receive data from the notification.

The first request sent a large data wrapper immediately, and then it stuck. In this case, the first byte was a monotonically increasing number.GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account. Problem-relevant configuration.

Xiaomi Mi Smart Home Temperature / Humidity Sensor

Someone could? Jakobsons i've got 2 sensors one of them works the other one doesn't. Not sure why. I have the same problem with 0.

Same isssue here. Sensors work for approximately 2 hours. If I reeboot hassio, they start working again for some time. Same issue, version 0. I just reinstalled using raspbian-buster-lite and the updating everything.

On previous installation using the same raspbian image but done at the beginning of august everything was working fine. Some times works for a couple of days, some others just a few hours. It's not a permanent solution. Check "dmesg", "dmesg grep error" etc. This issue is confusing and I did read through it. What's the actual verdict? Does the current HA version for Pi work with the sensor without hacks? The folks who posted the last messages Jan 5 onwards seem to be discussing about config no longer supported Same problem here.

A tried with an external bluetooth dongle.Not sure if something needs adjusting in the bindings or things, but any assistance would be greatly received. Thank you in advance for any responses and if there is any additional information you require, please do not hesitate to contact me.

Did you see it? I have also waited and left overnight and longer with no change. I do not create a file of things. I add things from the inbox and create a file of items and a rule file.

Motion sensor after restart receives batter level readings but doesupdate motion status and mi-switch does not receive commands. Which errors appear in Tail? I deleted all the Xiaomi things I initially created using the Inbox and created them manually using. I found this link helpful with regards to creating the. I am not sure I can put my finger on the problem here. I have had the sensor showing up with temperature, but seem to have issues more often than not.

If I save and apply the. The sensor is showing up on the Control screen, but only the battery percentage still no temperature or humidity. Did you already tried to restart openHAB?

I noticed that after changing lots of things after each other, it gets messed up. A restart always helps. Oddly, I left the things file as detailed above overnight and when I checked it in the morning, the temperature is showing up. I did leave it for some time last night before I sent my last post and also tried rebooting. I expect my syntax is correct, but as you suggested, when making a lot of changes it might need some time to sort itself out.

Still not sure about the errors in the log files though. So, my advice for anyone having the same issue is that the syntax above works, but it would pay to reboot and wait before trying something else. Previously following instructions I had udp port opened on myhab2 servers, but in this configuration sensers were updated only once after restart of openhab2.

I guess for most of people this is obvious, thought some have to find it hard way. For fixing the thing config, see my post Xiaomi Binding 2. Kind regards Nick. Sometimes you just have to wait. Yep, the link Olymp provided is the one I used to set it up.

xiaomi ble temperature and humidity sensor hassio

I have the same problem. I created bridge and motion sensors, temperature sensors and plug got discovered. I tried both 2. Ah ha! Your first post helped me Josep. My temperature sensors are now showing up with values as expected.Well in short it tells you the room temperature and the humidity.

The Xiaomi Smart Temperature and Humidity Sensor is smart in that it has Bluetooth, but what other strings does it have to its bow? Xiaomi makes another similar device with an E-Ink screen and that screen is stunning.

This in comparison makes me sad. Clearly Xiaomi has some schizophrenia as this device has the Smart provided by Bluetooth. A fun little adventure! You use the Xiaomi Mi Home app and after a couple deleting and re-pairing loops, the lamp began to see the thing and is now accessible over the internet. It takes 1 AAA battery and it would seem to last forever.

I was worried Bluetooth would eat more than Zigbee but maybe not. One thing that is nice is that it comes with a magnetic attachment with a little sort of hook meaning you can attach the odd hook thing with the attached sticky pad and then pull the actual device off as you wish. On its own, it tells you the temperature and the humidity.

With a Bluetooth gateway connected it becomes accessible to online Mi Home app and then you can set up controls. For example, you could set up the AC unit to turn on if the ambient temp hits 25 degrees, thus making it part of a more intriguing smart home setup.

So you set up a heater, AC, humidifier and a dehumidifier and you could have yourself a seriously climate-controlled room. I really wish the E-Ink screen one had the smart aspect too. However, the fact this Xiaomi device uses only Bluetooth as a gateway and not Zigbee means existing gateway owners may like me need to buy something that has that functionality thus increasing the total cost of the solution. I have a Zigbee based sensor which has no screen and it worked effortlessly and instantly.

The Xiaomi Smart Temperature and Humidity sensor here sits slap bang in the middle. It works, it looks reasonably fine and is not very expensive. That said, once I am back in the UK there is a very good chance I will buy one of these for every room in the house and maybe one for the fridge too as it does serve the functionality I require from it even if it is as sexy as a dulled spoon.

Black armory armor

Tags IoT smart home xiaomi. This site uses Akismet to reduce spam. Learn how your comment data is processed. Value 8.

xiaomi ble temperature and humidity sensor hassio

Buy on Amazon UK. Leave a Reply Cancel reply. This website uses cookies to improve your experience. Do you wish to allow cookies? Accept Reject Read More. Necessary Necessary.This is a spin off from the Domoticz Zigbee articleto build and integrate your Zigbee Gateway into Home Assistant requires a slightly different approach, but some of the steps are similar.

Since version 0. Actually like the native Z-wave implementation. So you can now easily manage your Zigbee network and perform basic things like: Permit and Remove operations, configure nodes etc. But later this year more features will be added. Lots of folks already have some smart hardware from brands like Hue, Ikea or Xiaomi. And every brand has its own separate bridge or gateway.

There are some dongles available that can communicate with several brands, but the downside of some of them is that they are not really open-sourceor not that cheap or not plug and play. We think the native implementation in Home Assistant is going to change this. Because the feature is in an early stage, still a lot of work needs to be done. But that Zigbee is growing is a fact, every platform is busy with it and the sticks are often low on stock because of the growing popularity.

You probably heard of Zigbee2mqtt. Zigbee2mqtt takes another approach. That means that it is not running in the native Home Assistant Zigbee implementation yet, but that is not a problem because the community of zigbee2mqtt, the documentation and the add-on are really good. This project contains very good documentation and has great potential. In a few steps, you are able to get rid of the popular Xiaomi gateway that sends your data to China.

With low cost hardware, you can create an open source gateway that is usable for systems like Domoticz of Home Assistant. This is also a downside, because there needs to be a seperate MQTT broker running. But maybe later this year you can use your flashed gateway and use it with the native implementation. Who knows. To create your own Zigbee Gateway There are multiple options; different types of hardware, flashing modes and besides a Raspberry Pi, you can run the software in a separate Docker Container.

Our favorite method: Flashing the hardware on windows and running the software on a Raspberry PI with Hassio on it. And for Hassio there is an add on for it, so when you are looking for a easy way, this is it!

If you are in need of other ways you can read the information on the wiki of the zigbee2mqtt project. You only need the CC debugger and the downloader cable once to flash the firmware on the USB sniffer so it can operate as a Zigbee gateway. But its handy to keep so you can create more gateways in the future. Or you can buy it together with your friends and share the debugger and downloader cable to save some money. There are several ways to flash the sniffer. This is described very well on the getting started page of the zigbee2mqtt wiki.

We bundled the prerequisites for Windows with: Flasher software, driver and firmware in 1 zip. Download HERE. So when I searched on thingiverse I found a nice design link to 3d model that I printed. It can updated by hassio. When new things addes in the edge version and the are tested well, it will be included in stable. You need to setup a mqtt server like mosquitto of use the buildt-in mqtt option. I installed mosquitto from the hass.GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Work fast with our official CLI. Learn more. If nothing happens, download GitHub Desktop and try again. If nothing happens, download Xcode and try again. If nothing happens, download the GitHub extension for Visual Studio and try again. Note Raspbery Pi 4 has a very limited bluetooth range. PI Zero W gives much longer range. This is more privacy friendly since no one can sniff your temperature readings.

On the other side this means you have to establish a bluetooth connection with the device to get the data. When you're connected no other connection is accepted, meaning if you hold the connection no other can readout your temperature and humidity.

You need Python3 3. If you don't have Python 3. If you really need this script, please open and issue and I'll post a new bugfree version. For example Raspbian Stretch has only Python 3. I use this compiled version directly without install.

If you do, too, you have to change the first line in the script, pointing to your compiled Python version. Note: When using rounding option you could see 0. Reading the battery level with the standard Bluetooth Low Energy characteristics doesn't work.

But often before that device just shuts down before it can report another battery level. With every measurement the Aqara sensor also transmits the battery voltage. This voltage is transformed into a battery level 3. The --count option is intended to save even more power. So far it is not proven, that only connecting at some interval will actually save power.A room thermometer is usually available in each house, either in digital or analog format.

Xiaomi Mijia Bluetooth - Датчик температуры и влажности с дисплеем

So, a temperature and humidity sensor is somewhat essential in a Xiaomi Smart Home. Measuring the temperature and humidity throughout the house and the individual rooms will help you adjust the heat sources in winter and cold sources in the summer so you get the desired results.

India ki sabse badi it company

For about a month now, I have this particular sensor in my house and below you will see my impressions and how it can fit in your own house. On the back, there is already a sticker with a strong adhesive sticker that allows you to place it on many surfaces without worrying about falling off. Also, on the back, you will find a notch where you can remove the rear cover using a coin eg 10 euro cents to replace the already installed CR 3V lithium battery.

On the front, there is a graphic icon of a thermometer indicating the purpose of this device. Just below there is a tiny slot with a led light that lights up properly when you connect it to the Xiaomi Gateway.

Visio automatic network diagram

At the top, there is a small button that will help you connect the sensor to the Xiaomi Gateway. Finally, at the bottom of the sensor, there are 3 small slots used to gather the temperature and humidity measurements of the room. The process is quite simple. In fact, you will be prompted to hold the button at the top for a few seconds, and once the light on the front lights up, then the pairing of the sensor to the Gateway will be successfully completed.

Just keep in mind that you should select China Homeland as a region of use to display the sensor in the list. Since the device does not have a display to show the temperature and humidity of the room, all the relevant information is displayed in the Mi Home app. As shown in the picture below from my iPad, with a simple look you can see the current temperature and humidity that the sensor receives. In fact, these values can be displayed both on the home screen of Mi Home app as well as on the corresponding widgets so you do not have to open the app.

Clicking on one of the two values in the previous image shows the sensor log history that you can divide by day, week and month.

How I took data from the BLE-thermometer from Xiaomi / Habr

A quite useful feature to view the temperature and humidity changes of the area you are interested in. In addition, through the Mi Home app, you can set up some automation using Scenes. Unfortunately, setting the Scenes is currently only in Chinese, so you should use the Google Translate app to translate it.

For example, you can set to receive a push notification to your mobile, tablet, or Gateway when the temperature or humidity has a value you specified. In fact, if you use a third party Home Automation software such as Home Assistant or Domoticz, you can further extend your home automation. For the time being, I have not used it yet this way. Xiaomi also reports that there is a difference of 0. But is the deviation so small? After several weeks of metrics in my house, what I would say is that it somewhat true.

Of course, accurate measurements will depend directly on where you place the sensor. You will need to avoid placing it on metal surfaces, near a radiator or an air-condition.

Also, the height placement of the sensor plays also a role in the measurements. Its metrics left me satisfied while its deviation as I mentioned above is very small.