Daikin Madoka BRC1H bluetooth custom component

I have successfully got this working with ESPHome, as described above.

Thanks to the developers :+1:.

Might I suggest a new thread, or a community guide about this installation as I only managed to find it half way down a very long thread about a different installation method, after much reading and confusion.

1 Like

Shoot …forgot all about it…still need it?
(or maybe someone else can post their yaml?:thinking:)

Could you possibly make a manual, I’m currently despairing with my RPI4, I haven’t worked with ESP Home yet :slight_smile:

I’ll have a go at this tomorrow.

1 Like

I have the following problem. I was able to pair my two Bluetooth controls but after some time the status was not available. Can I keep the connection with esp32 active?

Could you share it please ?

I’m ESP newbie and also looking for a config to start with.

Should be something like this
I took out everything related to my light switch (i hope)

substitutions:
  node_name: "daikin-ac"
  node_id: daikin_ac
  friendly_node_name: "Daikin AC"

esphome:
  name: ${node_name}
  friendly_name: Bluetooth Daikin
  min_version: 2025.2.1
  name_add_mac_suffix: False

#Note that my esp32 board (shelly-1-plus) is defined as esp32doit-devkit-v1, so you might need to change that if using some other board.
esp32:
  board: esp32doit-devkit-v1
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_FREERTOS_UNICORE: y
      CONFIG_ESP32_DEFAULT_CPU_FREQ_160: y
      CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ: "160"

# WiFi connection, correct these
# with values for your WiFi.
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.1.31
    gateway: 192.168.1.1
    subnet: 255.255.255.0

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ${node_name} FB
    password: !secret wifi_password

# Enable Home Assistant API
api:
  encryption:
    key: !secret api_encryption
  services:
    - service: passkey_reply
      variables:
        passkey: int
      then:
        - logger.log: "Authenticating with passkey"
        - ble_client.passkey_reply:
            id: cmanager_ac
            passkey: !lambda return passkey;
    - service: numeric_comparison_reply
      variables:
        accept: bool
      then:
        - logger.log: "Authenticating with numeric comparison"
        - ble_client.numeric_comparison_reply:
            id: cmanager_ac
            accept: !lambda return accept;
  
# Enable over-the-air updates.
ota:
  - platform: esphome
    password: !secret ota_password

# Enable logging.
logger:

#Load external sources
external_components:
  - source: github://Petapton/esphome@madoka
    components: [ madoka, esp32_ble ]

esp32_ble:
  io_capability: keyboard_display

esp32_ble_tracker:

#Use the MAC address of your Daikin BLE here
ble_client:
  - mac_address: AC:58:1C:B6:71:88
    id: my_ac
    on_passkey_request:
      then:
        - logger.log: "Enter the passkey displayed on your BLE device"
        - logger.log: " Go to https://my.home-assistant.io/redirect/developer_services/ and select passkey_reply"
    on_passkey_notification:
      then:
        - logger.log:
            format: "Enter this passkey on your BLE device: %06d"
            args: [ passkey ]
    on_numeric_comparison_request:
      then:
        - logger.log:
            format: "Compare this passkey with the one on your BLE device: %06d"
            args: [ passkey ]
        - logger.log: " Go to https://my.home-assistant.io/redirect/developer_services/ and select numeric_comparison_reply"
    on_connect:
      then:
        - logger.log: "Connected"

climate:
  - platform: madoka
    name: "My AC"
    ble_client_id: my_ac
    update_interval: 15s

# Text sensors with general information.
text_sensor:
  - platform: version
    name: ${friendly_node_name} ESPHome Version
    id: ${node_id}_esphome_version    
  - platform: wifi_info
    ip_address:
      name: "${friendly_node_name} IP Address"
      id: ${node_id}_ip_address
      icon: mdi:ip-network
    ssid:
      name: "${node_id} Wi-Fi SSID"
    bssid:
      name: "${node_id} Wi-Fi BSSID"

# Sensors with general information.
sensor:
  - platform: ble_client
    type: rssi
    ble_client_id: my_ac
    name: "My AC"
  # Uptime sensor.
  - platform: uptime
    name: ${node_id} Uptime Sensor
  # WiFi Signal sensor.
  - platform: wifi_signal
    name: ${node_id} WiFi Signal
    update_interval: 60s

switch:
  - platform: restart
    name: ${friendly_node_name} Restart
    id: ${node_id}_restart
    icon: "mdi:restart"
  - platform: shutdown
    name: ${friendly_node_name} Shutdown
    id: ${node_id}_shutdown
  - platform: safe_mode
    name: ${friendly_node_name} Restart (Safe Mode)"
    id: ${node_id}_safe_mode
  

Not sure I can help with that, having only just got it going, I’ve not had any problems yet.

I would check you phone is not trying to connect.

I would add an uptime sensor to your ESP, to see if its rebooting

text_sensor:
  - platform: uptime
    name: Uptime

I would connect just one AC unit, see if it works then.

Can you possibly make an instruction how you have implemented this with EspHome. I have no experience here.

I made a community guide here:
https://community.home-assistant.io/t/daikin-madoka-brc1h-bluetooth-with-esphome-via-btproxy/

Please edit and correct where necessary.

2 Likes

Little update here.

Two AC units connected and stable, but I have seen a problem: although order transmission (setting mode, speed, temp) works fast and flawlessly, all the time one of my HA components Will not update and Will be kept outdated: for example, if the initial temperature was set in 25⁰, it Will show that config all the time even if I change It to another value (same applies to modes). The other unit Will be updated.

Looking at the log in ESPHome, I see that updated keep coming in, but packages and values start overflowing the buffer. I Will try every unit separately to confirm this is the issue and not a problem with the Ac unit.

Any tip or clue here?

I have figured it out :slight_smile: Using the same YAML file, I decided to run this setup, and it allowed me to connect three devices at the same time! Even more, I used another ESP to connect three additional devices. The only problem I am experiencing is that sometimes the control signal is sent a little late; I don’t know why.

Do you know how I can get the room temperature information as a sensor value?

this is my yaml file if anyone interested

esphome:
  name: it-esp32-bluetooth
  friendly_name: IT ESP32 Bluetooth

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

ota:
  - platform: esphome
    password: "b1899ac5932245014246696eb0e4d3b4"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "It-Esp32-Bluetooth"
    password: "dY3KbP5Y7X7F"

captive_portal:

api:
  encryption:
    key: "TYCQh2TQT//N+/Bz8z9IupKrK+2F6hngD6OU8xFZgng="

  services:
    - service: passkey_reply
      variables:
        passkey: int
      then:
        - logger.log: "Authenticating with passkey"
        - ble_client.passkey_reply:
            id: it_ac_1
            passkey: !lambda return passkey;
        - ble_client.passkey_reply:
            id: it_ac_2
            passkey: !lambda return passkey;
        - ble_client.passkey_reply:
            id: it_ac_3
            passkey: !lambda return passkey;
    - service: numeric_comparison_reply
      variables:
        accept: bool
      then:
        - logger.log: "Authenticating with numeric comparison"
        - ble_client.numeric_comparison_reply:
            id: it_ac_1
            accept: !lambda return accept;
        - ble_client.numeric_comparison_reply:
            id: it_ac_2
            accept: !lambda return accept;
        - ble_client.numeric_comparison_reply:
            id: it_ac_3
            accept: !lambda return accept;

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

esp32_ble:
  io_capability: keyboard_display

esp32_ble_tracker:
  max_connections: 3

ble_client:
  - mac_address: B8:C0:65:15:45:B8
    id: it_ac_1
    on_passkey_request:
      then:
        - logger.log: "Enter the passkey displayed on your BLE device (Device 1)"
        - logger.log: "Go to https://my.home-assistant.io/redirect/developer_services/ and select passkey_reply"
    on_passkey_notification:
      then:
        - logger.log:
            format: "Enter this passkey on your BLE device (Device 1): %06d"
            args: [ passkey ]
    on_numeric_comparison_request:
      then:
        - logger.log:
            format: "Compare this passkey with the one on your BLE device (Device 1): %06d"
            args: [ passkey ]
        - logger.log: "Go to https://my.home-assistant.io/redirect/developer_services/ and select numeric_comparison_reply"
    on_connect:
      then:
        - logger.log: "Connected to Device 1"

  - mac_address: B8:C0:65:15:36:80
    id: it_ac_2
    on_passkey_request:
      then:
        - logger.log: "Enter the passkey displayed on your BLE device (Device 2)"
        - logger.log: "Go to https://my.home-assistant.io/redirect/developer_services/ and select passkey_reply"
    on_passkey_notification:
      then:
        - logger.log:
            format: "Enter this passkey on your BLE device (Device 2): %06d"
            args: [ passkey ]
    on_numeric_comparison_request:
      then:
        - logger.log:
            format: "Compare this passkey with the one on your BLE device (Device 2): %06d"
            args: [ passkey ]
        - logger.log: "Go to https://my.home-assistant.io/redirect/developer_services/ and select numeric_comparison_reply"
    on_connect:
      then:
        - logger.log: "Connected to Device 2"

  - mac_address: B8:C0:65:B0:FF:87
    id: it_ac_3
    on_passkey_request:
      then:
        - logger.log: "Enter the passkey displayed on your BLE device (Device 3)"
        - logger.log: "Go to https://my.home-assistant.io/redirect/developer_services/ and select passkey_reply"
    on_passkey_notification:
      then:
        - logger.log:
            format: "Enter this passkey on your BLE device (Device 3): %06d"
            args: [ passkey ]
    on_numeric_comparison_request:
      then:
        - logger.log:
            format: "Compare this passkey with the one on your BLE device (Device 3): %06d"
            args: [ passkey ]
        - logger.log: "Go to https://my.home-assistant.io/redirect/developer_services/ and select numeric_comparison_reply"
    on_connect:
      then:
        - logger.log: "Connected to Device 3"

climate:
  - platform: madoka
    name: "1st Madoka Device"
    ble_client_id: it_ac_1
    update_interval: 15s

  - platform: madoka
    name: "2nd Madoka Device"
    ble_client_id: it_ac_2
    update_interval: 15s

  - platform: madoka
    name: "3rd Madoka Device"
    ble_client_id: it_ac_3
    update_interval: 15s

sensor:
  - platform: ble_client
    type: rssi
    ble_client_id: it_ac_1
    name: "1st Madoka Sensor"

  - platform: ble_client
    type: rssi
    ble_client_id: it_ac_2
    name: "2nd Madoka Sensor"

  - platform: ble_client
    type: rssi
    ble_client_id: it_ac_3
    name: "3rd Madoka Sensor"

Hi,

I’m trying to set up the Daikin Madoka integration but am encountering an error during the configuration flow. The integration folder and required dependency have been installed successfully, but I cannot complete the setup.

Describe the bug:

When I go to Settings > Devices & services > Add integration and search for ā€œDaikin Madoka,ā€ clicking on the integration results in the following error message:

Error
Config flow could not be loaded: {ā€œmessageā€:ā€œInvalid handler specifiedā€}

To Reproduce:

Installed the custom component by placing the daikin_madoka folder in /config/custom_components.

successfully paired the Madoka controller to my Home Assistant instance’s built-in Bluetooth adapter.

Installed the pymadoka dependency manually using the SSH & Web Terminal add-on with the following command:
pip install pymadoka==0.2.12 --target /config/custom_components/daikin_madoka/

Restarted Home Assistant.

Went to Settings > Devices & services > Add integration and attempted to add the Daikin Madoka integration.

Expected behavior:

The configuration flow should load, allowing me to enter the necessary details to set up the Madoka controller.

System Information:

Installation Method: Home Assistant OS

Home Assistant Core: 2025.8.0

Home Assistant Supervisor: 2025.07.3

Home Assistant Operating System: 16.0

Frontend: 20250806.0

Additional context:

I have tried several troubleshooting steps, including:

Verifying the folder name (daikin_madoka) and file structure in custom_components.

Confirming the presence of the init.py file.

I tried the steps here for modern #60 also.

Recursively setting file permissions with chmod -R 777 /config/custom_components/daikin_madoka.

Attempting to install the pymadoka dependency via the ha core shell (which did not work on my system). The pip command in the SSH & Web Terminal add-on was the only successful way to install it.

Re-downloading the entire integration from the GitHub repository to ensure file integrity.

The issue persists after all these attempts.

Any help would be appreciated

Has an error when adding Integration


Hi all, @Petapton,

Is this module / integration still available @ GitHub? When opening my existing esphome device configuration I am getting this error on ā€œmadokaā€ external component:

Could not find init.py file for component madoka. Please check the component is defined by this source

Thanks!

helps ? :thinking:

Trying to setup this integration in HA (not using a proxy) and get the following error when loading the configuration wizard:
Config flow could not be loaded: {ā€œmessageā€:ā€œInvalid handler specifiedā€}

Any help would be appreciated!

I notice quite a lot of this errors in my logs. Seems like the integration is somehow overloading the network. Anyone nituced this? Is there any way to log what the integration is doing to figure out what is causing the overload? The errors go away for a while when I restart de ESP hosting the device @mduran80

2025-09-21 05:00:12.427 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:12.427 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:12.427 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:12.431 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:12.441 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:13.351 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:13.359 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:13.367 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:13.376 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:13.387 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:13.450 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:13.450 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.
2025-09-21 05:00:13.451 ERROR (MainThread) [homeassistant.components.esphome.manager] ESPHome Web 2f766c: [E][madoka:227]: Another packet with the same std::vector<uint8_t> ID is already in the buffer.

I guess these log messages are from the esphome component for Madoka made by @Petapton. I remember similar messages on my attempt to create automations to control mode and temperature from my multiple Madoka remotes from a single virtual thermostat in HA. I’m using a pair of ESP32 to control four Madoka remotes (two each). It works well for monitoring and to give few commands (on/off, single change mode, rare temperature adjustings) but sometimes I noted some wrong mode state (e.g. auto on the remote but dehumidifer on HA).
I guess the component should be made more robust.

Hi All,

I was getting this a year ago, but stopped using it for to no VAM support.

But I am trying to login to my Madoka again via the official app on my phone… it can see the 2 units, but it always fails to connect.

Is it possible the old and not running anymore ESP could have somehow locked the connections?

Notes:
I have tried connecting on multiple android phones
I have tried unplugging the madoka for over 1 minute