2019-10-16 13:30:31 +02:00
|
|
|
Xiaomi HHCCJCY01 BLE Sensor
|
|
|
|
===========================
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2018-11-14 22:12:27 +01:00
|
|
|
.. seo::
|
2019-10-16 13:30:31 +02:00
|
|
|
:description: Instructions for setting up Xiaomi Mi Flora HHCCJCY01 bluetooth-based plant monitors in ESPHome.
|
|
|
|
:image: xiaomi_hhccjcy01.jpg
|
|
|
|
:keywords: Xiaomi, Mi Flora, BLE, Bluetooth, HHCCJCY01
|
2018-11-14 22:12:27 +01:00
|
|
|
|
2019-10-16 13:30:31 +02:00
|
|
|
The ``xiaomi_hhccjcy01`` sensor platform lets you track the output of Xiaomi HHCCJCY01 Bluetooth Low Energy
|
2019-02-07 13:54:45 +01:00
|
|
|
devices using the :doc:`/components/esp32_ble_tracker`. This component will track the
|
2019-10-16 13:30:31 +02:00
|
|
|
temperature, humidity and optionally the battery level of the HHCCJCY01 device every time the sensor
|
2019-02-16 23:25:23 +01:00
|
|
|
sends out a BLE broadcast. Note that contrary to other implementations, ESPHome can track as many
|
2019-10-16 13:30:31 +02:00
|
|
|
HHCCJCY01 devices at once as you want.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
esp32_ble_tracker:
|
|
|
|
|
|
|
|
sensor:
|
2019-10-16 13:30:31 +02:00
|
|
|
- platform: xiaomi_hhccjcy01
|
2019-05-29 13:16:12 +02:00
|
|
|
mac_address: '94:2B:FF:5C:91:61'
|
2018-08-22 22:05:28 +02:00
|
|
|
temperature:
|
2019-10-16 13:30:31 +02:00
|
|
|
name: "Xiaomi HHCCJCY01 Temperature"
|
2018-08-22 22:05:28 +02:00
|
|
|
moisture:
|
2019-10-16 13:30:31 +02:00
|
|
|
name: "Xiaomi HHCCJCY01 Moisture"
|
2018-08-22 22:05:28 +02:00
|
|
|
illuminance:
|
2019-10-16 13:30:31 +02:00
|
|
|
name: "Xiaomi HHCCJCY01 Illuminance"
|
2018-08-22 22:05:28 +02:00
|
|
|
conductivity:
|
2019-10-16 13:30:31 +02:00
|
|
|
name: "Xiaomi HHCCJCY01 Soil Conductivity"
|
2018-08-22 22:05:28 +02:00
|
|
|
battery_level:
|
2019-10-16 13:30:31 +02:00
|
|
|
name: "Xiaomi HHCCJCY01 Battery Level"
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
Configuration variables:
|
2018-08-24 22:44:01 +02:00
|
|
|
------------------------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2019-10-16 13:30:31 +02:00
|
|
|
- **mac_address** (**Required**, MAC Address): The MAC address of the Xiaomi HHCCJCY01 device.
|
2018-08-22 22:05:28 +02:00
|
|
|
- **temperature** (*Optional*): The information for the temperature sensor.
|
|
|
|
|
|
|
|
- **name** (**Required**, string): The name for the temperature sensor.
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
2019-02-17 12:28:17 +01:00
|
|
|
- All other options from :ref:`Sensor <config-sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
- **moisture** (*Optional*): The information for the moisture sensor
|
|
|
|
|
|
|
|
- **name** (**Required**, string): The name for the moisture sensor.
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
2019-02-17 12:28:17 +01:00
|
|
|
- All other options from :ref:`Sensor <config-sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
- **illuminance** (*Optional*): The information for the illuminance sensor
|
|
|
|
|
|
|
|
- **name** (**Required**, string): The name for the illuminance sensor.
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
2019-02-17 12:28:17 +01:00
|
|
|
- All other options from :ref:`Sensor <config-sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
- **conductivity** (*Optional*): The information for the soil conductivity sensor
|
|
|
|
|
|
|
|
- **name** (**Required**, string): The name for the soil conductivity sensor.
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
2019-02-17 12:28:17 +01:00
|
|
|
- All other options from :ref:`Sensor <config-sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
- **battery_level** (*Optional*): The information for the battery level sensor
|
|
|
|
|
2019-05-24 16:19:26 +02:00
|
|
|
- **name** (**Required**, string): The name for the battery sensor.
|
2018-08-22 22:05:28 +02:00
|
|
|
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
2019-02-17 12:28:17 +01:00
|
|
|
- All other options from :ref:`Sensor <config-sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2019-04-16 18:09:25 +02:00
|
|
|
.. note::
|
|
|
|
|
2019-10-16 13:30:31 +02:00
|
|
|
This integration requires the device to have a recent firmware version, see
|
2019-05-01 17:53:17 +02:00
|
|
|
https://github.com/esphome/issues/issues/260#issuecomment-487684720 for more info.
|
|
|
|
|
2019-04-16 18:09:25 +02:00
|
|
|
The ``battery_level`` does not appear to work with some firmware versions of the device (the other sensors
|
2019-04-16 18:10:00 +02:00
|
|
|
do work though). See https://github.com/esphome/issues/issues/107 for more information.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
Setting Up Devices
|
2018-08-24 22:44:01 +02:00
|
|
|
------------------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2019-10-16 13:30:31 +02:00
|
|
|
Before you can even scan for the sensor, you need to activate it using the Flower Care app. Set it up there and you'll be able to discover it.
|
2019-01-06 19:01:47 +01:00
|
|
|
|
2019-10-16 13:30:31 +02:00
|
|
|
To set up Xiaomi HHCCJCY01 devices you first need to find their MAC Address so that ESPHome can
|
|
|
|
identify them. So first, create a simple configuration without any ``xiaomi_hhccjcy01`` entries like so:
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
esp32_ble_tracker:
|
|
|
|
|
2019-10-16 13:30:31 +02:00
|
|
|
After uploading the ESP32 will immediately try to scan for BLE devices such as the Xiaomi HHCCJCY01. When
|
2018-08-22 22:05:28 +02:00
|
|
|
it detects these sensors, it will automatically parse the BLE message print a message like this one:
|
|
|
|
|
|
|
|
.. code::
|
|
|
|
|
2019-10-16 13:30:31 +02:00
|
|
|
Got Xiaomi HHCCJCY01 94:2B:FF:5C:91:61 Got temperature=23.4°C
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
Note that it can sometimes take some time for the first BLE broadcast to be received.
|
|
|
|
|
2019-10-16 13:30:31 +02:00
|
|
|
Then just copy the address (``94:2B:FF:5C:91:61``) into a new ``sensor.xiaomi_hhccjcy01`` platform entry like
|
2018-08-22 22:05:28 +02:00
|
|
|
in the configuration example at the top.
|
|
|
|
|
2019-06-04 13:12:16 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
The ESPHome Xiaomi integration listens passively to packets the xiaomi device sends by itself.
|
|
|
|
ESPHome therefore has no impact on the battery life of the device.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
See Also
|
2018-08-24 22:44:01 +02:00
|
|
|
--------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
- :doc:`/components/esp32_ble_tracker`
|
2019-10-16 13:30:31 +02:00
|
|
|
- :doc:`/components/sensor/xiaomi_lywsdcgq`
|
2019-02-07 13:54:45 +01:00
|
|
|
- :doc:`/components/sensor/index`
|
2019-10-16 13:30:31 +02:00
|
|
|
- :apiref:`xiaomi_hhccjcy01/xiaomi_hhccjcy01.h`
|
2018-08-24 22:44:01 +02:00
|
|
|
- `OpenMQTTGateway <https://github.com/1technophile/OpenMQTTGateway>`__ by `@1technophile <https://github.com/1technophile>`__
|
2019-02-07 13:54:45 +01:00
|
|
|
- :ghedit:`Edit`
|