HA Custom Integration to control BLE ADV Ceiling Fans / Lamps

Hello,
thanks for the nice Integration! It was the first time I used a ESP32 and it works quite well.
Now my question: How do I manage to control the brightness in HA ?
I can turn the lamp on and off in HA by my Dashboard. When I click on the link I get the full control for color and brightness etc.

My aim is to turn the light on by HA automation with low brightness and bring it to a certain level over a couple of seconds. But where can I adjust these settings ?

Thanks in advance for your help

Hello @git-4-greg,

Welcome to the Home Assistant community!

The integration creates standard light (and fan) entities that can be controlled in an automation using light.turn_on and light.turn_off actions.

The parameters I recommend to use are brightness_pct in range [0-100] and color_temp_kelvin in range [2000-6535].

There is also a parameter transition to handle a more or less smooth transition but I am no sure it would work and I do not recommend to use it anyway as it requires the Device to be able to cope with a lot of commands in a very short time, which is usually not the case of those BLE ADV controlled devices (technical limitation of the protocol).

Hope it helps!

Hello @Aiit-it,

Welcome to the Home Assistant Community!

The integration is not using any IP Address / URLs so I wonder in which scope you would end with a DNS error: may you clarify what was the action you have done to get this error?

Thanks!

Just dropping a comment here to send my complinets and thanks! I have a light that works with Fan Light Pro and your integration gives me MORE granular control than the app itself! Mwah! Thanks for the amazing work!!

Hi all!
New here!!

I'm trying to integrate a ceiling light (Mantra Coin) into HA using BLE ADV.
I'm using the mAntra lighting Android app method.
After discovery, ‘mantra_v1 - 0x95BD’ is enabled in HA. I can create the integration, but the light doesn't respond.
I’ve also tried using the “pairing” method with all the options, and none of them have worked.
Could it be that the chip or firmware version is different from what mantra_v1 supports?

Log

{
  "home_assistant": {
    "arch": "aarch64",
    "dev": false,
    "docker": true,
    "hassio": true,
    "installation_type": "Home Assistant OS",
    "os_name": "Linux",
    "os_version": "6.12.85-haos",
    "python_version": "3.14.5",
    "timezone": "Europe/Madrid",
    "version": "2026.6.3",
    "virtualenv": false,
    "container_arch": "aarch64",
    "supervisor": "2026.06.1",
    "host_os": "Home Assistant OS 17.3",
    "docker_version": "29.3.1",
    "chassis": "embedded",
    "run_as_root": true
  },
  "manifest": {
    "domain": "ble_adv",
    "name": "BLE ADV Ceiling Fan / Lamps",
    "after_dependencies": [
      "esphome"
    ],
    "codeowners": [
      "NicoIIT"
    ],
    "config_flow": true,
    "documentation": "https://github.com/NicoIIT/ha-ble-adv",
    "integration_type": "device",
    "iot_class": "assumed_state",
    "issue_tracker": "https://github.com/NicoIIT/ha-ble-adv/issues",
    "requirements": [
      "pycryptodome",
      "btsocket"
    ],
    "version": "v2.0.3",
    "is_built_in": false,
    "overwrites_built_in": false
  },
  "coordinator": {
    "hci": {
      "adapters": {
        "hci/XX:XX:XX:XX:XX:XX": {
          "type": "BluetoothHCIAdapter",
          "mac": "XX:XX:XX:XX:XX:XX",
          "available": true,
          "queue": 4,
          "dequeueing": true,
          "logs": [
            "2026-06-14 18:35:41.885695 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0008064853E0EAB4AAC07B24C29646ED",
            "2026-06-14 18:35:41.997280 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0008064853E0EAB4AAC07B24C29646ED",
            "2026-06-14 18:35:42.105348 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0008064853E0EAB4AAC07B24C29646ED",
            "2026-06-14 18:35:42.214379 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0008064853E0EAB4AAC07B24C29646ED",
            "2026-06-14 18:35:42.324337 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0008064853E0EAB4AAC07B24C29646ED",
            "2026-06-14 18:35:42.434368 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0008064853E0EAB4AAC07B24C29646ED",
            "2026-06-14 18:35:49.540657 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0009064852F354040406FE2973EDA719",
            "2026-06-14 18:35:49.649529 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0009064852F354040406FE2973EDA719",
            "2026-06-14 18:35:49.759513 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0009064852F354040406FE2973EDA719",
            "2026-06-14 18:35:49.867458 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0009064852F354040406FE2973EDA719",
            "2026-06-14 18:35:49.977471 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0009064852F354040406FE2973EDA719",
            "2026-06-14 18:35:50.086468 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F0009064852F354040406FE2973EDA719",
            "2026-06-14 18:35:50.595058 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000A064851C797D5F74D773FA0618504",
            "2026-06-14 18:35:50.704471 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000A064851C797D5F74D773FA0618504",
            "2026-06-14 18:35:50.812474 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000A064851C797D5F74D773FA0618504",
            "2026-06-14 18:35:50.923490 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000A064851C797D5F74D773FA0618504",
            "2026-06-14 18:35:51.034469 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000A064851C797D5F74D773FA0618504",
            "2026-06-14 18:35:51.148528 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000A064851C797D5F74D773FA0618504",
            "2026-06-14 18:35:51.658979 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000B064850D42965598BF232111A64F0",
            "2026-06-14 18:35:51.767467 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000B064850D42965598BF232111A64F0",
            "2026-06-14 18:35:51.879527 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000B064850D42965598BF232111A64F0",
            "2026-06-14 18:35:51.987497 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000B064850D42965598BF232111A64F0",
            "2026-06-14 18:35:52.096481 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000B064850D42965598BF232111A64F0",
            "2026-06-14 18:35:52.204498 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000B064850D42965598BF232111A64F0",
            "2026-06-14 18:35:52.717184 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000C064857AE107611DA63120779C13F",
            "2026-06-14 18:35:52.826468 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000C064857AE107611DA63120779C13F",
            "2026-06-14 18:35:52.938507 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000C064857AE107611DA63120779C13F",
            "2026-06-14 18:35:53.047479 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000C064857AE107611DA63120779C13F",
            "2026-06-14 18:35:53.156498 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000C064857AE107611DA63120779C13F",
            "2026-06-14 18:35:53.266507 - Advertising - duration: 100ms, repeat: 1, 02011A15FF4E6F720F000C064857AE107611DA63120779C13F"
          ],
          "extended_adv": false,
          "mgmt_adv": false
        }
      },
      "ids": {
        "0": "hci/XX:XX:XX:XX:XX:XX"
      },
      "logs": [
        "2026-06-14 18:31:41.882889 - MGMT Connected - fileno: 84",
        "2026-06-14 18:31:41.884634 - MGMT Nb HCI Adapters: 1",
        "2026-06-14 18:31:41.886136 - MGMT - HCI Adapters: [(0, 'XX:XX:XX:XX:XX:XX')]",
        "2026-06-14 18:31:41.886408 - Adding adapter 'hci/XX:XX:XX:XX:XX:XX'/'0' of type BluetoothHCIAdapter"
      ],
      "supported_by_host": true
    },
    "esp": {
      "adapters": {},
      "ids": {},
      "logs": [
        "2026-06-14 18:31:41.881174 - BLE ADV Name Entities: []"
      ]
    },
    "ign_adapters": [],
    "ign_duration": 60000,
    "ign_cids": [
      65231,
      64903,
      65162,
      65163,
      64908,
      64918,
      65049,
      65183,
      65184,
      65061,
      65062,
      65063,
      65194,
      65068,
      64689,
      64822,
      65223,
      65224,
      65225,
      65226,
      65227,
      65228,
      65229,
      65230,
      64719,
      65104,
      65233,
      65234,
      65235,
      65236,
      65109,
      65110,
      64598,
      65240,
      65232,
      64994,
      64867,
      64866,
      64879,
      65008,
      64753,
      65267,
      65268,
      64627
    ],
    "ign_macs": [],
    "adapter_macs": [
      "XX:XX:XX:XX:XX:XX"
    ],
    "last_unk_raw": {
      "1BFF75004204018066A0D7F39EED27A2D7F39EED2601020000000000": "2026-06-14T18:37:02.800381",
      "02011A0AFF4C00100507183A6A62020A00": "2026-06-14T18:37:02.139524",
      "02011A0CFF4C001007241B5F4B69F758020A00": "2026-06-14T18:37:02.568365",
      "02010213FFFFFF35366134643366353765646361323863020AF103035634": "2026-06-14T18:37:02.654437",
      "1BFF75004204018066C8A6EF4F0BB7CAA6EF4F0BB60102B400000000": "2026-06-14T18:37:02.832557",
      "0201021BFF7500021842B1D460C554961FCA92BA7765C225EB73E6107999A0": "2026-06-14T18:37:02.198661",
      "02011A020A110BFF4C001006061D13C32678": "2026-06-14T18:37:02.730554",
      "02011A09FFC4000333021315800303B9FE081B0043BC822AE6B4": "2026-06-14T18:37:02.424505",
      "02011805030F180218": "2026-06-14T18:37:02.343328",
      "0201010319C0000303E7FE0409503937": "2026-06-14T18:37:01.875287",
      "0201060E1695FE1059083500C49675FDCE8C0516ABFD0101": "2026-06-14T18:37:01.800316",
      "0201060F1695FE30585B05EA83CBCB38C1A408": "2026-06-14T18:37:01.280459",
      "02011A15FF4E6F720F497C23F241EA9F2BC7F64F773DC0EEDD": "2026-06-14T18:36:12.680722",
      "02011A15FF4E6F720F889FB43E8ED3B2EF1A8C3831515EE6E5": "2026-06-14T18:36:08.720680",
      "02011A15FF4E6F720F663CCCDF951FB0E6C33437A9A3AC6973": "2026-06-14T18:36:09.738731",
      "02011A15FF4E6F720F603F77D9FFACD0D1A76B901868647054": "2026-06-14T18:36:11.687820",
      "02011A15FF4E6F720FDCF2C16F7F369AC0C3EE553176747482": "2026-06-14T18:36:13.701680",
      "02010215FF4E6F720F002406487D4433E6BF3E91C9A3DAF00A": "2026-06-14T18:36:18.553797",
      "02011A0BFF4C001006251E5A9F3A00020A00": "2026-06-14T18:36:18.267851",
      "02010215FF4E6F720F0026064B7F634E87E2B30FA8C42FA089": "2026-06-14T18:36:18.777848",
      "02010215FF4E6F720F0027064B7E70F0374C7589BB75544140": "2026-06-14T18:36:18.893861",
      "02010215FF4E6F720F0028064B71973CA172102BC9E8E8EB33": "2026-06-14T18:36:19.021865",
      "02010215FF4E6F720F0029064B70848211DCD6ADC259930AD9": "2026-06-14T18:36:20.000930",
      "02011A15FF4E6F720F51C571EB54E93ECC14AF7B63E34637FA": "2026-06-14T18:36:19.669831",
      "02010215FF4E6F720F002A064B73B041C02F9D4B89881D4495": "2026-06-14T18:36:20.623850",
      "02010215FF4E6F720F002B064B72A3FF70815BCD043967A521": "2026-06-14T18:36:22.945870",
      "02011A15FF4E6F720F002B06BF72A3FF70815BCD043E765B62": "2026-06-14T18:36:20.695824",
      "02011A15FF4E6F720FA8BBAB1CDF3C8BE0A987A81EC7F3CEC2": "2026-06-14T18:36:22.689026",
      "02010215FF4E6F720F002C064B75D9C663C90A5FA42F0500AE": "2026-06-14T18:36:25.835872",
      "02011A15FF4E6F720FFF0DC44ECDB85B1E809A8C59C01EF4AE": "2026-06-14T18:36:28.727966",
      "02011A15FF4E6F720F210D3F9C32D50BB0A95BA381B1CD4427": "2026-06-14T18:36:56.714280",
      "02011A15FF4E6F720F128479ACCA7AD615E1C168D2789A9479": "2026-06-14T18:36:40.763052",
      "02011A15FF4E6F720F2CBE11914BC35A4AE545D8DDAC1A3F58": "2026-06-14T18:36:45.670149",
      "02011A15FF4E6F720F889DB43E8CF4CF8E4701CB2A33A9250C": "2026-06-14T18:36:53.706217",
      "02011A15FF4E6F720F167F92A87155EB9998FCC0B51484CD52": "2026-06-14T18:37:01.691404"
    },
    "last_dec_raw": {}
  },
  "entries": {},
  "flow": [
    "2026-06-14 18:35:13.251113 - Config flow 'user' started.",
    "2026-06-14 18:35:20.324614 - Wait Config - Raw advs: ['02010215FF4E6F720F002406487D4433E6BF3E91C9A3DAF00A', '02011A0BFF4C001006251E5A9F3A00020A00', '02010215FF4E6F720F0026064B7F634E87E2B30FA8C42FA089', '02010215FF4E6F720F0027064B7E70F0374C7589BB75544140', '02010215FF4E6F720F0028064B71973CA172102BC9E8E8EB33', '02010215FF4E6F720F0029064B70848211DCD6ADC259930AD9', '02011A15FF4E6F720F51C571EB54E93ECC14AF7B63E34637FA', '02010215FF4E6F720F002A064B73B041C02F9D4B89881D4495']",
    "2026-06-14 18:35:20.324701 - Wait Config - Confs: {'hci/XX:XX:XX:XX:XX:XX': [mantra_v1 - 0x95BD - 0]}",
    "2026-06-14 18:35:20.368139 - Start blink - hci/XX:XX:XX:XX:XX:XX / mantra_v1 - 0x95BD - 0.",
    "2026-06-14 18:35:24.373696 - Stop blink.",
    "2026-06-14 18:35:38.700250 - Start blink - hci/XX:XX:XX:XX:XX:XX / mantra_v1 - 0x95BD - 0.",
    "2026-06-14 18:35:42.707147 - Stop blink.",
    "2026-06-14 18:35:49.537147 - Start blink - hci/XX:XX:XX:XX:XX:XX / mantra_v1 - 0x95BD - 0.",
    "2026-06-14 18:35:53.543022 - Stop blink."
  ]
}

Hi,

First of all, thank you for this amazing integration, it works really well with my ceiling fan using the Zhi Mei protocol!

I have two issues I'd like to report/request:

1. Light state is inverted
When the light is ON, Home Assistant shows it as OFF, and when it's OFF, HA shows it as ON. The control itself works fine (I can turn it on and off from HA), but the state is always the opposite of reality.

My device: LEDUNI ceiling fan with retractable blades, protocol: Zhi Mei.

Is there a configuration option to invert the light state, or is this a bug that could be fixed?

2. Physical remote uses RF, not BLE
I tried to sync my physical remote as a supplementary controller (via reconfigure), and HA detected something during setup. However, it doesn't actually sync — when I use the remote, HA doesn't update its state.

After investigating, I believe the physical remote uses RF (not BLE/IR), which would explain why ha-ble-adv can't listen to it. Is there any way to support RF remotes, or a workaround you'd recommend?

Thanks a lot for your work on this integration!

I have been using this integration and it works well however I noticed an issue. My fan uses fanlamp pro and if I only use home assistant everything works as expected. However if I use the remote the fan came with in conjunction with home assistant it seems the commands are stepping on one another causing problems. The only fix is to hit the switch to cut the power to the fan to restart it. It seems that there is a persistent command being sent or when using both together it causes a problem. @NicoIIT

I think I may have found the issue. I didn’t pair the remote to the integration. Now that I did the states are all connected correctly .