MCCGQ02HL (Xiaomi Mijia Window Door Sensor 2)

hi there,
recently (by mistake) I bought bluethooth sensor MCCGQ02HL (Xiaomi Mijia Window Door Sensor 2) and try to integrate with HA using HACS/Passive BLE monitor integration (Xiaomi Mijia BLE MiBeacon monitor) … is it possible to do it not having a MI gateway ,
can you please advice me how this sensor could be describe in configuration.yaml ?
I just started this jurney and tried to dig into different topic but not found anything simmilar to this …

Same here, wrong purchase. For now ended up buying the right door sensor, I hope this will also be supported later.

Actually i manage to configure it and sensors are working as expected but IT is not doable without android phone and MOD version of MiHOMe app.

So no issue with that

How did you extract the bind key?

I downloaded this app: https://www.kapiba.ru/2017/11/mi-home.html but I only found the token, not the bind key.

Edit: I found it, you need to create a logs folder under /vevs and then pair the sensor with the application. The key will be in misc/pairings.txt

:slight_smile: yes, hope it will work for you too.

How you connected this sensor?can you provide more info, step by step?

I am also interested in how you solved this. I have ordered the Zigbee variants from Ali Express and received these instead… Quite frustrating.

You can use ESPHome (with an ESP32) as a gateway, works perfect!

Can you share the config you use in ESPHome for this sensor. ( MCCGQ02HL)
Thanks

Sure, first some homework :wink: :

For now you have to use a custom component:

There is a PR for integration in esphome core, but it looks like it’s stale:

My code (I’m using include files, that’s where the ${} come from):

esp32_ble_tracker:
 
external_components:
  - source: github://dentra/esphome-components
#    refresh: 1min

binary_sensor:
  - platform: miot_mccgq02hl
    mac_address: ${MCCGQ02HL_1_mac}
    # String, (Optional), device bind key. Will use "xiaomi_account" from "miot" if absent to automaticaly get the bindkey.
    bindkey: ${MCCGQ02HL_1_bindkey}
    # String, (Optional), the name of binary sensor
    name: ${MCCGQ02HL_1_name}
    battery_level:
      name: ${MCCGQ02HL_1_name} Bat

sensor:
# RSSI based on MAC address
- platform: ble_rssi
  mac_address: ${MCCGQ02HL_1_mac}
  name: ${MCCGQ02HL_1_name} BLE RSSI
  entity_category: "diagnostic"
2 Likes

Following your guide I integrate the MCCGQ02HL sensor .
All works well except the battery_level.
Any suggestion how to fix it?
Thank you.

Hello, I followed the guide and I managed to integrate this sensor into the ha. Now I have realized that:
1- If I restart HA the sensor always detects the window closed even if it is open … practically it is as if it were reset and could not read the current state again.
2- The bluetooth signal is shown only when the sensor status changes … it stays on for a few minutes and then returns to “unknown”
Is there any way to fix this situation?

Thank you

1 Like

Just an update,
to fix the battery_level not showing up … you need to update the sensor firmware in Xiaomi app.

Anyone knows how to obtain the bindkey without an android phone?:confused:

Yes, you can do it GitHub - PiotrMachowski/Xiaomi-cloud-tokens-extractor: This tool/script retrieves tokens for all devices connected to Xiaomi cloud and encryption keys for BLE devices. after you have added your device to xiaomi home app (I guess there should be an iPhone app as well). Use Chinese server/region.

Hello, I am trying to integrate the xiaomi MCCGQ02HL door and window sensor to esphome, and when compiling it gives me the following error, do you know what I could be doing wrong?

Linking /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/firmware.elf
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection17send_sensor_stateEPNS_6sensor6SensorEf+0x8): undefined reference to esphome::sensor::Sensor::has_state() const' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection23send_binary_sensor_infoEPNS_13binary_sensor12BinarySensorE+0xc): undefined reference to esphome::binary_sensor::BinarySensor::get_device_classabi:cxx11
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection16send_sensor_infoEPNS_6sensor6SensorE+0x8): undefined reference to esphome::sensor::Sensor::get_unit_of_measurement[abi:cxx11]()' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection16send_sensor_infoEPNS_6sensor6SensorE+0xc): undefined reference to esphome::sensor::Sensor::get_accuracy_decimals()’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection16send_sensor_infoEPNS_6sensor6SensorE+0x10): undefined reference to esphome::sensor::Sensor::get_device_class[abi:cxx11]()' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection16send_sensor_infoEPNS_6sensor6SensorE+0x14): undefined reference to esphome::sensor::Sensor::get_state_class()’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o: in function esphome::api::APIConnection::send_sensor_state(esphome::sensor::Sensor*, float)': /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/components/api/api_connection.cpp:414: undefined reference to esphome::sensor::Sensor::has_state() const’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o: in function std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()': /data/cache/platformio/packages/[email protected]+2021r2-patch3/xtensa-esp32-elf/include/c++/8.4.0/bits/basic_string.h:657: undefined reference to esphome::binary_sensor::BinarySensor::get_device_classabi:cxx11
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o: in function std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': /data/cache/platformio/packages/[email protected]+2021r2-patch3/xtensa-esp32-elf/include/c++/8.4.0/bits/basic_string.h:1366: undefined reference to esphome::sensor::Sensor::get_unit_of_measurementabi:cxx11
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/components/api/api_connection.o: in function esphome::api::APIConnection::send_sensor_info(esphome::sensor::Sensor*)': /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/components/api/api_connection.cpp:426: undefined reference to esphome::sensor::Sensor::get_accuracy_decimals()’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/components/api/api_connection.cpp:427: undefined reference to esphome::sensor::Sensor::get_device_class[abi:cxx11]()' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/components/api/api_connection.cpp:429: undefined reference to esphome::sensor::Sensor::get_state_class()’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x88): undefined reference to vtable for esphome::miot_mccgq02hl::MiotMCCGQ02HL' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x8c): undefined reference to vtable for esphome::miot_mccgq02hl::MiotMCCGQ02HL’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x90): undefined reference to vtable for esphome::miot_mccgq02hl::MiotMCCGQ02HL' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x9c): undefined reference to vtable for esphome::ble_rssi::BLERSSISensor’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0xa0): undefined reference to vtable for esphome::ble_rssi::BLERSSISensor' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0xa4): undefined reference to vtable for esphome::ble_rssi::BLERSSISensor’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0xc8): undefined reference to vtable for esphome::miot::MiBeaconTracker' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0xcc): undefined reference to vtable for esphome::miot::MiBeaconTracker’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x10c): undefined reference to esphome::binary_sensor::BinarySensor::BinarySensor()' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x110): undefined reference to esphome::sensor::Sensor::Sensor()’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x11c): undefined reference to esphome::sensor::Sensor::set_device_class(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x120): undefined reference to esphome::sensor::Sensor::set_state_class(esphome::sensor::StateClass)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x124): undefined reference to esphome::sensor::Sensor::set_unit_of_measurement(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x128): undefined reference to esphome::sensor::Sensor::set_accuracy_decimals(signed char)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x12c): undefined reference to esphome::sensor::Sensor::Sensor()' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.literal._Z5setupv+0x130): undefined reference to esphome::binary_sensor::BinarySensor::set_device_class(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function esphome::esp32_ble_tracker::ESP32BLETracker::set_scan_window(unsigned int)': /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h:198: undefined reference to esphome::binary_sensor::BinarySensor::BinarySensor()’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function setup()': /config/esphome/.esphome/build/proxy-ble-entrada/src/main.cpp:195: undefined reference to esphome::sensor::Sensor::Sensor()’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /config/esphome/.esphome/build/proxy-ble-entrada/src/main.cpp:211: undefined reference to esphome::sensor::Sensor::set_device_class(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function esphome::esp32_ble_tracker::ESPBTDeviceListener::ESPBTDeviceListener()’:
/config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h:137: undefined reference to esphome::sensor::Sensor::set_state_class(esphome::sensor::StateClass)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function esphome::ble_rssi::BLERSSISensor::BLERSSISensor()’:
/config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/components/ble_rssi/ble_rssi_sensor.h:12: undefined reference to esphome::sensor::Sensor::set_unit_of_measurement(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/components/ble_rssi/ble_rssi_sensor.h:12: undefined reference to esphome::sensor::Sensor::set_accuracy_decimals(signed char)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function esphome::ble_rssi::BLERSSISensor* esphome::Application::register_component<esphome::ble_rssi::BLERSSISensor>(esphome::ble_rssi::BLERSSISensor*)': /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/core/application.h:124: undefined reference to esphome::sensor::Sensor::Sensor()’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function esphome::Component::set_component_source(char const*)': /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/core/component.h:146: undefined reference to esphome::sensor::Sensor::set_device_class(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function setup()': /config/esphome/.esphome/build/proxy-ble-entrada/src/main.cpp:232: undefined reference to esphome::sensor::Sensor::set_state_class(esphome::sensor::StateClass)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /config/esphome/.esphome/build/proxy-ble-entrada/src/main.cpp:236: undefined reference to esphome::sensor::Sensor::set_unit_of_measurement(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function std::vector<esphome::miot::MiotListener*, std::allocatoresphome::miot::MiotListener* >::push_back(esphome::miot::MiotListener* const&)’:
/data/cache/platformio/packages/[email protected]+2021r2-patch3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_vector.h:1076: undefined reference to esphome::sensor::Sensor::set_accuracy_decimals(signed char)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o: in function std::__cxx11::basic_string<char, std::char_traits, std::allocator >::~basic_string()’:
/data/cache/platformio/packages/[email protected]+2021r2-patch3/xtensa-esp32-elf/include/c++/8.4.0/bits/basic_string.h:657: undefined reference to esphome::binary_sensor::BinarySensor::set_device_class(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/main.o:(.rodata._ZTVN7esphome4miot13MiotComponentE[vtable for esphome::miot::MiotComponent]+0x48): undefined reference to esphome::miot::MiotListener::process_mibeacon(esphome::miot::MiBeacon const&)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/core/controller.o:(.literal._ZN7esphome10Controller16setup_controllerEb+0x10): undefined reference to esphome::binary_sensor::BinarySensor::add_on_state_callback(std::function<void (bool)>&&)' /data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/core/controller.o:(.literal._ZN7esphome10Controller16setup_controllerEb+0x14): undefined reference to esphome::sensor::Sensor::add_on_state_callback(std::function<void (float)>&&)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/src/esphome/core/controller.o: in function esphome::Controller::setup_controller(bool)': /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/core/controller.cpp:11: undefined reference to esphome::binary_sensor::BinarySensor::add_on_state_callback(std::function<void (bool)>&&)’
/data/cache/platformio/packages/[email protected]+2021r2-patch3/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: /config/esphome/.esphome/build/proxy-ble-entrada/src/esphome/core/controller.cpp:29: undefined reference to `esphome::sensor::Sensor::add_on_state_callback(std::function<void (float)>&&)’
collect2: error: ld returned 1 exit status
*** [/data/proxy-ble-entrada/.pioenvs/proxy-ble-entrada/firmware.elf] Error 1
========================= [FAILED] Took 109.24 seconds =========================

Did you ever get this fixed? I’ve got the same problem.