Daikin Madoka BRC1H bluetooth custom component

This could be due either by some packet loss on the BLE link or rapid subsequent message exchange.

Could you please enable the debug log level in ESPHome and send me logs?

On the device, in the bluetooth pairing settings, you can unlink the currently paired device. This should leave place for a new connection.

Installing the lates version of ESPhomes I received the bellow message

INFO ESPHome 2025.10.0
INFO Reading configuration /config/esphome/malososensors2.yaml…
ERROR Unable to import component esp32_ble_tracker:
Traceback (most recent call last):
File “/esphome/esphome/loader.py”, line 199, in _lookup_module
module = importlib.import_module(f"esphome.components.{domain}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/importlib/init.py”, line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1387, in _gcd_import
File “”, line 1360, in _find_and_load
File “”, line 1331, in _find_and_load_unlocked
File “”, line 935, in _load_unlocked
File “”, line 999, in exec_module
File “”, line 488, in _call_with_frames_removed
File “/esphome/esphome/components/esp32_ble_tracker/init.py”, line 9, in
from esphome.components.esp32_ble import (
ImportError: cannot import name ‘IDF_MAX_CONNECTIONS’ from ‘esphome.components.esp32_ble’ (/data/external_components/391ddc4b/esphome/components/esp32_ble/init.py)
Failed config

esp32_ble_tracker: [source /config/esphome/malososensors2.yaml:40]

Component not found: esp32_ble_tracker.
scan_parameters:
interval: 5s
window: 5s
active: True

What I need to do?

Hi, the same issue there.
@Petapton do you have any idea about that?
Could be possible to fix?

thank you.
Ignazio

Same issue here.

I managed to flash the firmware by rolling back ESPHome to v2025.9.2

Regards.

It seems the PR for esp32_ble was accepted into the main repository, so it doesn’t need to be additionally loaded anymore.

That means it now just became

external_components:
  - source: github://Petapton/esphome@madoka
    components: [ madoka ]

(so without esp32_ble )

3 Likes

Thanks a lot.
It worked :slight_smile:
Ignazio

If you see that using BLE complicate and not very stable, you can check solution here: Daikin P1P2 comms and adding Wifi + Voice control to a 20year old ducted Air Conditioner - #22 by dzungpv

The component has been renamed, use this now:

external_components:
  - source: github://Petapton/esphome@madoka
    components: [ daikin_madoka ]

Make sure to rename the platform of the climate as well:

climate:
  - platform: daikin_madoka

For all those trying to make this work locally without ESP Proxy, it’s a mess, but I’ve finally got it to work on 2025.11.2, need to either do fork, or something to make it more stable and user friendly but in a nutshell here are the steps:

  1. remove the custom component
  2. using ssh in a temp folder:
git clone https://github.com/mduran80/daikin_madoka.git
cd daikin_madoka
git branch -D pr60  # ignore error if it says 'not found'
git fetch origin pull/60/head:pr60
git checkout main
git merge pr60
git checkout pr60 -- custom_components/daikin_madoka/__init__.py custom_components/daikin_madoka/climate.py
git add custom_components/daikin_madoka/__init__.py custom_components/daikin_madoka/climate.py
git commit

Once we have the commit build locally we use this particular local commit as custom component:

mv custom_components/daikin_madoka /config/custom_components/daikin_madoka/
cd /config/custom_components/daikin_madoka/
nano manifest.json

remove requirements (otherwise it will get overridden every time ha restarts):

{
  "domain": "daikin_madoka",
  "name": "Daikin Madoka",
  "config_flow": true,
  "documentation": "https://github.com/atanarro/daikin_madoka",
  "issue_tracker": "https://github.com/atanarro/daikin_madoka/issues",
  "requirements": [],
  "codeowners": ["@atanarro"],
  "iot_class": "local_polling",
  "version": "1.0.4",
  "integration_type": "device"
}

now we manually install and pact pymadoka:

docker exec -it homeassistant /bin/bash
pip install pymadoka
pymadoka --version

This is when you are most likely to get and error, something like:
ImportError: cannot import name ‘discover’ from ‘bleak’ (/usr/local/lib/python3.13/site-packages/bleak/init.py)

If we do we need to patch this

cd /usr/local/lib/python3.13/site-packages/pymadoka
sed -i 's/discover(/BleakScanner.discover(/g' connection.py
sed -i 's/from bleak import BleakClient,BleakScanner,discover/from bleak import BleakClient, BleakScanner/' connection.py
pymadoka --version
#If the version is displayed correctly we are done
exit
ha core restart

Once the ha core is restarted proceed to add custom integration, you should not get the error any more.

Hey after a lot of trouble i finaly came accross your post.

So firstly thanks for the patch and fyi i followed the steps but updated the manifest to :

{
  "domain": "daikin_madoka",
  "name": "Daikin Madoka",
  "config_flow": true,
  "documentation": "https://github.com/atanarro/daikin_madoka",
  "issue_tracker": "https://github.com/atanarro/daikin_madoka/issues",
  "requirements": [
    "git+https://github.com/maraujop/pymadoka.git@patch-1"
  ],
  "codeowners": ["@atanarro"],
  "iot_class": "local_polling",
  "version": "1.0.4",
  "integration_type": "device"
}

and skipping the rest of the process seemed to be sufficient in my case.

1 Like

Hi!
I’m having the same problems when I try to update. I have it installed directly via Bluetooth on my miniPC. Do I just need to modify the manifest?
I don’t really understand the process or what the problem is.
Could you explain it? Thank you so much in advance!