Platform Home Assistant "Xiaomi BLE Temperature and Humidity sensor"

2 minutes of reading
Proconductor: Home Assistant Community
Availability: included in thepersonale HUB Home Assistant
Category: software
Type: platform Home Assistant
Family: component "Sensor” Home Assistant
Implementation difficulties: low

The "Xiaomi BLE Temperature and Humidity sensor" platform it is useful to integrate to profirst personal home automation based on Home Assistant i temperature / humidity sensors Xiaomi Mijia LCD Bluetooth.

This integration allows you to create one or more entity of type "Sensor”- as many as there are sensors to integrate - that is many virtual thermometers / hygrometers how many sensors are available in the environment to be controlled. Furthermore, the integration allows the generation of an entity that provides the reading of the charge level of the battery that powers the sensor.

The platform uses the proProtocol Bluetotooth LE to dialogue with the sensor (s): it is therefore necessary that the hardware it hosts Home Assistant is equipped with a bluetooth antenna (no proproblem, for example, with Raspberry Pi 3) and that it is within reach of a radio signal. Unfortunately, this integration uses the library btlewrap, which is not available on Windows/Mac, therefore the requests Home Assistant based on these systems cannot benefit from such integration. But it exists - perhaps - an alternative.

Configuration

To create entity "Sensor”(Climate) via this platform the block to be inserted at the configuration "configuration.yaml" di Home Assistant it is basically similar to the following:

# Esempio di configurazione
sensor:
  - platform: mitemp_bt
    mac: 'xx:xx:xx:xx:xx:xx'
    name: Stanza da letto
    force_update: false
    median: 3
    monitored_conditions:
      - temperature
      - humidity
      - battery

Where the procustomization property I'm:

platform(string, mandatory) Must necessarily be set to "mitemp_bt"
mac(string, mandatory) Indicates the MAC Bluetooth address of the sensor
name(string, optional) Indicates the name prefix of the entity that will be generated
force_udapte(binary, optional) Indicates a Home Assistant whether to force the highernameof the received data even without explicit sending by the sensor
median(integer, optional) Sometimes the readings of this sensor detect im fluctuationsprovvise. This parameter allows to put on average a number (indicated) of last readings in order to appflatten these fluctuations. In the absence of fluctuation, set it to 1.
monitored_conditions(list, mandatory) Indicates which parameters to integrate. May include temperature, humidity e battery. Each value determines the creation of a corresponding sensor on Home Assistant.
timeout(integer, optional) Number of seconds timeout for each survey. Default: 10
retries(integer, optional) Number of attempts in the absence of connection before considering the sensor inoperative. Default: 2
cache_value(integer, opzinale) Number of seconds for which Home Assistant retains the cache value in the event of sensor failure. Default: 300
adapter(string, optional) Indicates which Bluetooth adapter is present on the system. Default: hci0.

Implementation

on inDomus there is a guide appdedicated to implementation of this platform.


Home Assistant Official LogoATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Home Assistant, for any doubt, question, information on the specific merit of these components.


Please comment below