HA Custom Integration to control BLE ADV Ceiling Fans / Lamps

First of all, the main problem in such case is usually the Bluetooth range: please try to put the device less than 3 meters away from your Bluetooth adapter (and in direct view, no wall) and retry in order to get ride of this possibility.

I tried to pair it - but without success.

Have you tried to use the recommended “Duplicate Config” Flow before that, from an already paired controller controlling your device (the Android Phone App or a Remote)?

Using the “Pairing” Flow, have you followed the instructions on screen (cut power supply of the device, reinstate it and then press “submit” within 5s)?

the remote was identified as a v3

Not exactly, ONE of the protocols used by the remote is v3. It may be sending other kind of protocols but we keep only the first one we manage to decode when discovering a supplementary controller.

Last potential issue if everything is failing: maybe VMWARE does not provide root user / direct access to the host network (CAP_ADMIN capacity), but I have very limited knowledge of VMWARE and I would not know how to do so…

Fun Fact: I will never understand why people would answer “yes” to the question “Did the light blink?” whereas it did not :smile:

Hello,
In the end I tried to work with a spare raspberry I had and installed HomeAssistant and tried the whole thing again.
This time I was able to achive it but with the PAIRING (the duplicate config unfortunately didn’t work).

Now I will see what I will do with those fans :slight_smile:
Using a second instance is a little stupid XD
I have to figure out how to do your workaround inside Unraid - since per default you add docker not with a “standard docker file”.
Still have to find out how to do it :slight_smile:

EDIT: I was able to run the container you indicated in the workaround and to connect to my HA instance.
I was able to pair the fan with the PAIRING mode:

I configured it as 6speed (as it has on the command), it has sleep mode, etc…
It’s correct that those 3 entries are the only one I get?
Also so the 6 “speed” steps, are indeed controlled as the 0-100% slider right? No “fix” step is shown.

In any case, thanks again for the support and great job with the addon! :slight_smile:

It’s correct that those 3 entries are the only one I get?

Yes, click on “Main Fan” text to have the full control UI. Same for lights.

EDIT: Oups I may misunderstood your comment…
Yes, what other entities would you want ?

the 6 “speed” steps, are indeed controlled as the 0-100% slider right? No “fix” step is shown.

Home Assistant standard Fan Entity UI: the 6-steps is shown as 0-100% but you can only setup 6 different values (16/33/50/66/83/100), and 0.

Hi @NicoIIT…I am really happy that the initial LampSmartPro work by @aronsky has now gone so far. Great work!

Having said that, I am currently using the old code and would like to migrate to using this new code of yours. Below is my current config, would you be able to advise how I can easily migrate over without having to pair the lights again if possible.

external_components:
  # shorthand
  source: github://aronsky/esphome-components
#LampSmart Pro
light:
  - platform: lampsmart_pro_light
    name: Main Hallway
    duration: 1000
    default_transition_length: 0s
    cold_white_color_temperature: 6500 K
    warm_white_color_temperature: 2700 K
    min_brightness: 5

Thanks.

Hello @skull29

I reverted to the (very old) version of the software on which your component is based, FYI I added a branch so that you could compile your ESP if needed:

external_components:
  - source: github://NicoIIT/esphome-components@lampsmart_pro_light

Anyway, just follow the doc using the Manual Input (Expert) configuration flow with the following parameters:

Codec: lampsmart_pro_v2
Forced Id: 232C493D
Index: 0

It should work directly without the need to pair.

EDIT:

  • Just to clarify, in this old software, the name Main Hallway was converted to a hash ID ( or Forced Id ) so I installed your config and listened to what it was emitting and that gave the parameters just above. Note that if you have 3 lights with 3 different names then you need to provide the full config so that I can give you the 3 different Forced Id, or use the conversion page I just created for you
  • Adding a thanks to the first creator @MasterDevX and his Lampify
  • If you have a Physical Remote you should also be able to use it as a base (probably) using the Duplicate Config flow.

Hi @NicoIIT

Finally have some time to see how to transition over. I followed the doc to setup your HACS component and then turning my original ESP32 with aronsky component into a ble_adv_proxy. I then added an integration in HA with the parameters for Manual Input (Expert) and all is working great. I am able to control the lights as before.

Do I need to add the below as I have not added it into the code and all is working?

external_components:
  - source: github://NicoIIT/esphome-components@lampsmart_pro_light

Thanks for helping me seamlessly move over :relieved:

1 Like

Do I need to add the below as I have not added it into the code and all is working?

Absolutely not! This was only in case the migration would have not worked and you would have needed to revert your ESP32 to its previous config based on lampsmart_pro_light (your config is so old that it would have not compiled with the last version of neither my repo nor Aronsky’s repo)

You are absolutely spot on! I was not able to upgrade the ESPHome version on this ESP32 module for quite a long while already. Also afraid if I were to change to the new code, might break what I already have.

Now I am happy :kissing_heart: Thanks again.

Integrated Mantra Alisio without any problems. Great integration.
I need to do some more testing, but it seems to work perfectly.
I was frustrated; everything was integrated into Home Assistant except for this fan. Now I can rest.
Thank you so much.

1 Like

Hi All,

Please be aware a bug was introduced in release v1.2.0 last week preventing the integration using the Bluetooth stack of the Host to publish messages, it has been fully corrected in v1.2.4

New features:

  • Support for new Applications Mantra and LE Light
  • Improved communication between ble_adv_proxy and the integration and more generally improved adapters resiliency to technical issues
  • Improved Diagnostics Dump (for me to ease investigations)
  • New Tools and Helpers menu allowing to:
    • Listen to BLE Advertising messages
    • Emit raw BLE Advertising messages
    • Produce a diagnostic dump even if no integration was created

In particular this will ease the writing of Bug Report while still in config flow, and the request for support of new Physical Remote, see How To.

Please note that if you use a ble_adv_proxy it is strongly advised to rebuild it with latest version in order to benefit from the changes.

You should also refresh your Browser cache (Ctrl + F5) to have a fully working Config Flow.

1 Like

Hi might need some help here. I have been able to control the lamp through Fanlamp pro in my iPhone, have installed a new esp32 for the adv ble proxy, with this configuration:

substitutions:
  name: esp32-bluetooth-proxy-445428
  friendly_name: Bluetooth Proxy
packages:
  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic/esp32-generic-s3.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  custom_services: true
  homeassistant_services: true
  encryption:
    key: AeuyZq4yWKP1HQIYT+75QlxBY3HxeRX3XgJQArMGZ5k=

ble_adv_proxy:
  use_max_tx_power: true # see below, remove in case of build issues

  # The 'adapter_name' option should be added ONLY if you want the adapter to have a different name from the device (esphome.name)
  # If you change the adapter_name, your ble_adv integrations using it will stop working and will require you to update them
  #   by reconfiguring -> Technical Parameters (see ha-ble-adv doc)
  # The name MUST be unique for HA: if you have several proxies linked to a HA instance, they MUST all have different names
  # This option requires ha-ble-adv v1.2.1 minimum
  adapter_name: esp-proxy

external_components:
  source: github://NicoIIT/esphome-ble_adv_proxy

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

When try to install the integration, it can detect the signal through automatic and define as fanlamp_pro_v1, with 3 profiles, but none of them blinks it.

What else can I try?

json log

  1. Check the Troubleshooting Guide, in particular the section about the Bluetooth Range
  2. Open a complete “Config Issue” following the instructions in the related config flow menu available when no configuration managed to make your light blink

Thanks NicoIIT,

Finally I have some progress by retrying multiple times, and when pairing, it sometimes blinks. With that configuration, I have an entity in HA, I’ll be able to turn on the light everytime, but not able to turn it off everytime, sometimes it works, and sometimes it won’t. If I control the light through IOS App, the status is reflect in HA immediately as well. The ESP32, the light and my phone is really close each together with less than 1m. Should I still log a config issue?

Have you tried to check the Bluetooth range of your ESP32 with the procedure given in the Troubleshooting guide?

Have you tried to increase the ‘Repetition’ in the Technical Parameters as advised in the configuration guide to see if it improves the situation?

And yes as already written several times in this thread: if you have an issue, open an issue with all requested info.

From now on I will not provide any support to anyone anymore in this thread as it seems it is just used by the people who do not want to take the time to read the docs or open Issues with all the info needed for me to investigate.

So I’ve successfully added one of my ESP32’s to control one of my ceiling lights. The thing is, I have 5 of those ceiling lights across my apartment. One esp32 can only reach 2 of them, so I wanted to add another one to control another 2 lights.
When I try to add the device I can select the BT adapter of the 2nd esp, my light blinks, but when I click on ‘yes’ this is what I get:

A device with the same (codec / id / index) is already configured.

What am I missing? :slight_smile:

1 Like

Hello @nightshadow,

I just updated the Troubleshooting guide for this, Step 3.3.

If it does not answer your problem then, as highlighted in the comment just above, please open an Issue.

Hi All,

A new major version v1.3.0 is available including (since v1.2.4):

  • Support for RuiXin App and Remote (Sanweyter Devices)
  • New LampSmart Pro Remote added
  • 2 New Zhi Mei Remotes added
  • Translations for french, slovak and czech added
  • Links to Troubleshooting guide and to open Issues directly in the Config Flow
  • Entity availability immediate refresh on adapter addition / removal
  • New technical service to inject raw commands
  • Possibility to force the send of ‘Turn OFF’ and ‘Turn ON’ commands even if nothing changed, it may help the ones having frequent de-synchronizations in between HA entities state and Device state.

Please note that de-synchro are not normal and are mostly caused by:

  • the use of a Physical Remote not configured as a supplementary Controller
  • a wall switch cutting the power supply of your device (not recommended).

I also wrote a (huge) doc to help working with Wall Switches, providing Blueprints and examples. Those are provided as is, no Issue will be accepted on this part.

Enjoy!

2 Likes

I have a fan with a “WS-10 60B” transformer/control unit, which is controlled by the “FanLamp Pro” app. I was able to pair it with Home Assistant, but is it normal that I can only turn the light and the fan on/off, and not adjust the fan speed and direction like with the included remote control?

Or am I doing something wrong?

Hello @CptCheesyCrust,

I added a new section in the Troubleshooting Guide, as it seems the HA standard UI for Entities needs to be explained (you are not the first one asking this).