Daikin Madoka BRC1H bluetooth with ESPHome vía BTProxy

The code was created by @Petapton, so many thanks to them.

This guide is for connecting to your Daikin Madoka HVAC via a ESPHome device and Bluetooth Proxy, if you’re planning to connect directly to your Home Assistant computer there is as custom component Daikin Madoka BRC1H bluetooth custom component

First you need an ESP device and the ESPHome add in.

I’ve used ESP32 C3 super mini in my installation, many other devices are available, it will need to be on your WiFi network and within Bluetooth range of your HVAC controller.

On your currently connected device, phone tablet etc. note down the MAC address of the HVAC, you’ll need it later.

The Daikin Madoka HVAC can only connect to 1 device, so delete the current Bluetooth connection, and forget the connection on phone/connected device.

In the ESPHome Builder, create a new device, use the wizard to connect to your WiFi and initial setup.

Add the following code, substituting your own details, MAC address and friendly name.

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

api:
  encryption:
    key: <your api_encryption created when you create a new ESPHome device>
  services:
    - service: passkey_reply
      variables:
        passkey: int
      then:
        - logger.log: "Authenticating with passkey"
        - ble_client.passkey_reply:
            id: madoka_climate
            passkey: !lambda return passkey;
    - service: numeric_comparison_reply
      variables:
        accept: bool
      then:
        - logger.log: "Authenticating with numeric comparison"
        - ble_client.numeric_comparison_reply:
            id: madoka_climate
            accept: !lambda return accept;

esp32_ble_tracker:
  max_connections: 4  #can only be changed from 3 if using esp-idf framework.

esp32_ble:
  io_capability: display_yes_no

ble_client:
  - mac_address: <HVAC MAC ADDR>
    id: madoka_climate

climate:
  - platform: madoka
    name: "Your friendly name"
    ble_client_id: madoka_climate
    update_interval: 15s

bluetooth_proxy:
  active: true

I add the following bits of code to my ESP devices, they give me the device uptime and a nice web page to visit.

web_server:
  port: 80

text_sensor:
  - platform: uptime
    name: Uptime

I also recommend using the esp-idf framework.

  framework:
    type: esp-idf

Save and upload your code to your ESP device.

Once it’s all up and running you will need to visit your Daikin control panel and accept the Bluetooth connection.

PS: You can verify your bluetooth passkey under developer tools:


Or type your passkey manually:

You should now have a new device in your Home assistant, and you can add the thermostat card to your dashboards


Note: You can use any esphome with BLE, so it will also work with f.e. a shelly (while still controlling the light)

3 Likes

I did it exactly as described in the instructions, but unfortunately the controller cannot be paired. I’ll take a look at the logs tomorrow

Hi! How could you get the single temperature thermostat? In my case I can only get a dual temperature thermostat all time (the Cold/Hot min-max temp). Which is the version of the custom_component you are using?

When the BLE is activated, the daikin display should show a passkey.
This passkey/numeric_comparison should show in the logs as well as under the developer tools.
Look for -device-name-.numeric_comparison_reply

Can someone check the upper Yaml. Already have problems with the max_connections: 4. apparently there are only 3 possible. I see my controllers in bluetooth monitoring but they do not connect to my esp32

I think it defaults to 3, and can only be adjusted if using the esp-idf framework, if changing it you cannot update over WiFi

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

You could also (I think anyway) drop the bluetooth proxy bit if you are not using it.

bluetooth_proxy:
  active: true

What type of framework did you use? I’ll test it tonight.
Yesterday I got the following messages.
[0] [xx:xx:xx:xx:xx:Xx] Disconnect requested, but already idle.
Additionally I get
[19:29:44][D][madoka:200]: Got update request…
[19:29:44][D][madoka:202]: …but device is disconnected

What does that mean? Daikin is not coupled with anything.

I almost always use esp-idf

I’ve followed your guide and I think overall I managed to flash ESPhome firmware but I dont think it is able to control Daikin unit (I have BRC1H52W module).

I believe I managed to pair ESP device with Daikin unit, altho it’s difficult to say.
The bluetooth screen shows its connected but its completely unresponsive.

It doesnt allow me to terminate connection and re-pair, it almost feels like I pressed too many buttons and its just stuck with a queue of commands.

Sometimes it unblocks and terminates connection and I almost immediately see a passkey request which I accept.

Sometimes it stays connected for 30mins just to close bluetooth connection after.

I seriously feel there is some kind of command queue and the more buttons I press the slower it becomes.

I was able to successfully integrate my two controllers into Home Assistant today, thanks to your help. It helped me to set the max connections to 4 and use esp idf. The connection is now stable for about an hour. I will give feedback about disconnections or other problems.

Hi Guys

How do you exactly pair Madoka display with ESPHome ?

Is all I need to confirm the code on Madoka display ?

Or do I need to fill out passkey and press confirm in HA as well ?

I can’t reliable make integration to work.

I’m using HA to set COOL mode, I see in the logs in Web server of ESPHome it sends COOL request

11:33:37	[D]	[climate:011]	'Madoka Climate' - Setting
11:33:37	[D]	[climate:015]	  Mode: COOL
11:33:37	[D]	[madoka:079]	status: 1, mode: 3
11:33:38	[D]	[madoka:200]	Got update request...
11:33:38	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:33:38	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:33:38	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:33:38	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:33:38	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:33:38	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:33:38	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT

HA integration momentary changes to COOL when I select it, but shortly after falls back to OFF.

Same with other modes, e.g. HEAT

11:35:37	[D]	[climate:011]	'Madoka Climate' - Setting
11:35:37	[D]	[climate:015]	  Mode: HEAT
11:35:37	[D]	[madoka:079]	status: 1, mode: 4
11:35:38	[D]	[madoka:200]	Got update request...
11:35:38	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:35:39	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:35:39	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:35:39	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:35:39	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:35:39	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT
11:35:39	[D]	[esp32_ble_client:193]	[0] [20:9E:79:21:3B:AE] ESP_GATTC_WRITE_CHAR_EVT

Any ideas how to make it work ?

Yes, that’s all I did.

I’m stumped, sorry, I did see something similar when I set mine to dry, it switch off after a few seconds.

Maybe your proxy is capable of transmitting data, but has issues receiving?

Hence my question, what is your signal strenght?

Maybe place your bluetooth a little closer just to make sure?

I managed to make it work without any problem using an ESP32 C6 as BT Proxy.

I made some automations, and I can change the operating mode. However I can’t change the temperature or the fan speed. It seems those actions aren’t available for the HAVC device. Any help?