Controlling BLE ceiling light with HA

Try upgrading to a more recent version of ESPHome, yours is almost a year old. It’s probably running on an older version of Python that doesn’t support the match syntax.

1 Like

Thank you @aronsky . That was the problem. I was now able to compile the version and flash it to the ESP32.
Unfortunately, my lamp is not recognised or cannot be paired.
The lamp is controlled with the “ZhiMeiDengKong” app. Can I sniff the communication? I only have an iOS device.

Hey Folks,

Just wanted to thanks all those that have worked on this.
I have this chandelier


with this remote
24ghzremote

It has Warn White, Cool White, & diming capability. (Main light)
It also has 4 LED downlights not dimable - switched separately to main light using top left button on remote - (Lets call the “second lights” - can just see 2 of the 4 them in the picture)

I was able to get it working with:

substitutions:
  device_name: s3mini01
  friendly_name: Chandelier Remote


esphome:
  name: $device_name
  friendly_name: $friendly_name
  platformio_options:
    build_flags: [
      "-DBOARD_HAS_PSRAM"
     ,"-DARDUINO_LOLIN_S3_MINI"
      ]

esp32:
  board: lolin_s3_mini
  variant: esp32s3
  framework:
    type: arduino
    version: 2.0.8
    platform_version: 6.3.2
  flash_size: 4MB

# Enable logging
logger:
#  level: VERY_VERBOSE

# Enable Home Assistant API
api:
  encryption:
    key: <mykey>

ota:
  password: <mypassword>

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  output_power: 10
  use_address: 192.168.30.29
  domain: .home
  fast_connect: yes

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "s3mini01 Fallback Hotspot"
    password: !secret fallback_wifi_password

captive_portal:

web_server:
  port: 80

#LampSmart Pro
external_components:
  source: github://flicker581/esphome-lampsmart
  
lampsmart_pro_light:

light:
  #- platform: lampsmart_pro_light
  #  name: V3 light
  #  duration: 200
  #  #default:
  #  #variant: v3
  #- platform: lampsmart_pro_light
  #  name: V2 light
  #  duration: 200
  #  default_transition_length: 0s
  #  variant: v2
  - platform: lampsmart_pro_light
    name: Chandelier
    duration: 200
    default_transition_length: 0s
    variant: v1a
    icon: mdi:chandelier
    restore_mode: RESTORE_DEFAULT_ON 
  #- platform: lampsmart_pro_light
  #  name: V1bLight
  #  duration: 200
  #  default_transition_length: 0s
  #  variant: v1b

button:
  - platform: restart
    name: Restart
    entity_category: diagnostic

sensor:
  - platform: wifi_signal
    name: 'WiFi Signal'
    entity_category: diagnostic
  - platform: uptime
    name: 'Uptime'
    entity_category: diagnostic
    unit_of_measurement: s

text_sensor:
  - platform: version
    name: 'ESPHome Version'
    entity_category: diagnostic
  - platform: wifi_info
    ip_address:
      name: WiFi IP Address
      entity_category: diagnostic
    ssid:
      name: WiFi SSID
      entity_category: diagnostic
    mac_address:
      name: WiFi MAC Address
      entity_category: diagnostic
    dns_address:
      name: WiFi DNS Address
      entity_category: diagnostic

My Question is:
Does anyone know what changes I would need to make to enable the “second light” as a separate ESPHome switch? i.e. the 4 down lights.

Oh, and one other thing.
Remember to re-pair after flashing when working out which variant your light uses. Unsure how much time I wasted trying different values, but not re-pairing…

In fact you do not need to re-pair after flash if you only change the “variant”: you only need to re-pair if you change the “name” that is used to build the ID sent to the lamp, which is what happens in case you comment / uncomment the whole sections in your config :slight_smile:
I am working on a new component that is able to handle several entities (lights / fan) for a same controller but for now only supporting variant v2, do you confirm only the v1a is working on your side ?

Hi all,

I built a new version of this component here, based on the work done in the 2 repositories previously referenced and that evolved in parallel. The new component is ‘ble_adv_controller’, it integrates features from aronsky concerning Zhijia and flicker581 for the variants v1a/v1b/v2/v3 of the Smart Lamp pro part.

It also provides new features:

  • Control of multiple entities for a same lamp / device, could interest @junkie69 as It may add the support of multiple lights, to be tested as I do not own such device!
  • Control of Fan, may interest @cRazyK77
  • Pairing button

Example of configuration can be found in the repo.

Hope it can help!

1 Like

@NicoIIT This is pretty cool you added all this. I am also interested in fan control coupled with the light.

I am trying to wrap my head around your config but im confused as to some of your example configuration. The fan section shows the controller as salon_controller but that is not created above. Is this on purpose? Can it be the same controller?

Also fans tend to have speeds, these speeds can be set with a button on the remote so im guessing these actions are not represented and therefore would need to tinker with the For the very tecki ones section?

While I am savvy this seems to be not my wheelhouse unfortunately, if there is anymore information you can give on how to get these commands id appreciate it. Regardless its pretty cool you all have worked well towards reverse engineering this.

EDIT: On a second note I tried compiling your code but recieved an error. This is the log i get:

INFO ESPHome 2023.11.6
INFO Reading configuration /config/esp32-bluetooth-proxy-d61d68.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-bluetooth-proxy-d61d68 (board: esp32dev; framework: espidf; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40405.230623 (4.4.5) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Dependency Graph
|-- Improv @ 1.2.3
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_frame_helper.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_pb2.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_pb2_service.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_server.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/list_entities.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/proto.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/subscribe_state.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/user_services.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/binary_sensor/automation.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/binary_sensor/binary_sensor.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/binary_sensor/filter.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ble_presence/ble_presence_device.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/bluetooth_proxy/bluetooth_connection.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/bluetooth_proxy/bluetooth_proxy.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/button/button.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32/gpio.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32/preferences.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32_ble/ble.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32_ble/ble_advertising.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32_ble/ble_uuid.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32_ble_client/ble_characteristic.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32_ble_client/ble_client_base.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32_ble_client/ble_service.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/esp32_ble_tracker/esp32_ble_tracker.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/improv_base/improv_base.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/improv_serial/improv_serial_component.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/logger/logger.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/md5/md5.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/mdns/mdns_component.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/mdns/mdns_esp32.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/mdns/mdns_esp8266.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/mdns/mdns_host.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/mdns/mdns_libretiny.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/mdns/mdns_rp2040.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/network/util.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ota/ota_backend_arduino_esp32.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ota/ota_backend_arduino_esp8266.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ota/ota_backend_arduino_libretiny.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ota/ota_backend_arduino_rp2040.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ota/ota_backend_esp_idf.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ota/ota_component.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/safe_mode/button/safe_mode_button.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/socket/bsd_sockets_impl.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/socket/lwip_raw_tcp_impl.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/socket/lwip_sockets_impl.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/socket/socket.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/wifi/wifi_component.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/wifi/wifi_component_esp32_arduino.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/wifi/wifi_component_esp8266.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/wifi/wifi_component_esp_idf.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/wifi/wifi_component_libretiny.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/wifi/wifi_component_pico_w.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/application.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/component.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/component_iterator.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/controller.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/entity_base.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/helpers.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/log.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/scheduler.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/string_ref.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/util.o
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o
In file included from src/esphome.h:18,
                 from src/main.cpp:3:
src/esphome/components/ble_adv_controller/ble_adv_controller.h:79:8: error: 'queue' in namespace 'std' does not name a template type
   std::queue<uint8_t *> commands_;
        ^~~~~
src/esphome/components/ble_adv_controller/ble_adv_controller.h:79:3: note: 'std::queue' is defined in header '<queue>'; did you forget to '#include <queue>'?
src/esphome/components/ble_adv_controller/ble_adv_controller.h:9:1:
+#include <queue>
 
src/esphome/components/ble_adv_controller/ble_adv_controller.h:79:3:
   std::queue<uint8_t *> commands_;
   ^~~
src/esphome/components/ble_adv_controller/ble_adv_controller.h:94:3: warning: missing initializer for member 'esp_ble_adv_data_t::service_data_len' [-Wmissing-field-initializers]
   };
   ^
src/esphome/components/ble_adv_controller/ble_adv_controller.h:94:3: warning: missing initializer for member 'esp_ble_adv_data_t::p_service_data' [-Wmissing-field-initializers]
src/esphome/components/ble_adv_controller/ble_adv_controller.h:94:3: warning: missing initializer for member 'esp_ble_adv_data_t::service_uuid_len' [-Wmissing-field-initializers]
src/esphome/components/ble_adv_controller/ble_adv_controller.h:94:3: warning: missing initializer for member 'esp_ble_adv_data_t::p_service_uuid' [-Wmissing-field-initializers]
*** [.pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o] Error 1
========================= [FAILED] Took 20.09 seconds =========================

The configuration I have is:

ble_adv_controller:
  - id: my_controller
    encoding: fanlamp_pro
    variant: v3
    duration: 500

light:
  - platform: ble_adv_controller
    ble_adv_controller_id: my_controller
    name: ble_light
    index: 0
    min_brightness: 21

Oups sorry, missing include, it was working on my side due to other components included. This is corrected now you can retry.
I also corrected the example that was wrong, remaining of my personal configuration: you were right the id must be ‘my_controller’ in this example.

For the Fan, it includes a 4-level speed and a direction change, let me know if you need more :slight_smile:

When I have time I will elaborate on the ‘custom’ section in the doc but it is quite complex as it is specific to each encoding type and variant…

1 Like

@NicoIIT Thanks! I have a new error for you however

In file included from src/esphome.h:18,
                 from src/main.cpp:3:
src/esphome/components/ble_adv_controller/ble_adv_controller.h:95:3: warning: missing initializer for member 'esp_ble_adv_data_t::service_data_len' [-Wmissing-field-initializers]
   };
   ^
src/esphome/components/ble_adv_controller/ble_adv_controller.h:95:3: warning: missing initializer for member 'esp_ble_adv_data_t::p_service_data' [-Wmissing-field-initializers]
src/esphome/components/ble_adv_controller/ble_adv_controller.h:95:3: warning: missing initializer for member 'esp_ble_adv_data_t::service_uuid_len' [-Wmissing-field-initializers]
src/esphome/components/ble_adv_controller/ble_adv_controller.h:95:3: warning: missing initializer for member 'esp_ble_adv_data_t::p_service_uuid' [-Wmissing-field-initializers]
Linking .pioenvs/esp32-bluetooth-proxy-d61d68/firmware.elf
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection11fan_commandERKNS0_17FanCommandRequestE+0x8): undefined reference to `esphome::fan::Fan::make_call()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection11fan_commandERKNS0_17FanCommandRequestE+0xc): undefined reference to `esphome::fan::FanCall::perform()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x0): undefined reference to `esphome::light::LightState::make_call()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x4): undefined reference to `esphome::light::LightCall::set_state(bool)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x8): undefined reference to `esphome::light::LightCall::set_brightness(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0xc): undefined reference to `esphome::light::LightCall::set_color_mode(esphome::light::ColorMode)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x10): undefined reference to `esphome::light::LightCall::set_color_brightness(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x14): undefined reference to `esphome::light::LightCall::set_red(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x18): undefined reference to `esphome::light::LightCall::set_green(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x1c): undefined reference to `esphome::light::LightCall::set_blue(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x20): undefined reference to `esphome::light::LightCall::set_white(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x24): undefined reference to `esphome::light::LightCall::set_color_temperature(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x28): undefined reference to `esphome::light::LightCall::set_cold_white(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x2c): undefined reference to `esphome::light::LightCall::set_warm_white(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x30): undefined reference to `esphome::light::LightCall::set_transition_length(unsigned int)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x34): undefined reference to `esphome::light::LightCall::set_flash_length(unsigned int)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x38): undefined reference to `esphome::light::LightCall::set_effect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection13light_commandERKNS0_19LightCommandRequestE+0x3c): undefined reference to `esphome::light::LightCall::perform()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection16send_light_stateEPNS_5light10LightStateE+0x8): undefined reference to `esphome::light::LightState::get_traits()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection16send_light_stateEPNS_5light10LightStateE+0x10): undefined reference to `esphome::light::LightState::supports_effects()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection16send_light_stateEPNS_5light10LightStateE+0x14): undefined reference to `esphome::light::LightState::get_effect_name[abi:cxx11]()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection15send_light_infoEPNS_5light10LightStateE+0x8): undefined reference to `esphome::light::LightState::get_effects() const'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o: in function `esphome::api::APIConnection::fan_command(esphome::api::FanCommandRequest const&)':
/config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:320: undefined reference to `esphome::fan::Fan::make_call()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:331: undefined reference to `esphome::fan::FanCall::perform()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o: in function `esphome::api::APIConnection::light_command(esphome::api::LightCommandRequest const&)':
/config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:401: undefined reference to `esphome::light::LightState::make_call()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:403: undefined reference to `esphome::light::LightCall::set_state(bool)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:405: undefined reference to `esphome::light::LightCall::set_brightness(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:407: undefined reference to `esphome::light::LightCall::set_color_mode(esphome::light::ColorMode)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:409: undefined reference to `esphome::light::LightCall::set_color_brightness(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:411: undefined reference to `esphome::light::LightCall::set_red(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:412: undefined reference to `esphome::light::LightCall::set_green(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:413: undefined reference to `esphome::light::LightCall::set_blue(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:416: undefined reference to `esphome::light::LightCall::set_white(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:418: undefined reference to `esphome::light::LightCall::set_color_temperature(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:420: undefined reference to `esphome::light::LightCall::set_cold_white(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:422: undefined reference to `esphome::light::LightCall::set_warm_white(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:424: undefined reference to `esphome::light::LightCall::set_transition_length(unsigned int)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:426: undefined reference to `esphome::light::LightCall::set_flash_length(unsigned int)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:428: undefined reference to `esphome::light::LightCall::set_effect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:429: undefined reference to `esphome::light::LightCall::perform()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o: in function `esphome::api::APIConnection::send_light_state(esphome::light::LightState*)':
/config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:340: undefined reference to `esphome::light::LightState::get_traits()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:354: undefined reference to `esphome::light::LightState::supports_effects()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:357: undefined reference to `esphome::light::LightState::get_effect_name[abi:cxx11]()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.o: in function `esphome::api::APIConnection::send_light_info(esphome::light::LightState*)':
/config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:362: undefined reference to `esphome::light::LightState::get_traits()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:382: undefined reference to `esphome::light::LightState::supports_effects()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/api/api_connection.cpp:382: undefined reference to `esphome::light::LightState::get_effects() const'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._ZN7esphome16bleadvcontroller17FanLampControllerC5ENS0_7VariantE[esphome::bleadvcontroller::FanLampController::FanLampController(esphome::bleadvcontroller::Variant)]+0x4): undefined reference to `vtable for esphome::bleadvcontroller::BleAdvController'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._ZN7esphome16bleadvcontroller17FanLampControllerC5ENS0_7VariantE[esphome::bleadvcontroller::FanLampController::FanLampController(esphome::bleadvcontroller::Variant)]+0x8): undefined reference to `vtable for esphome::bleadvcontroller::BleAdvController'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._ZN7esphome16bleadvcontroller17FanLampControllerC5ENS0_7VariantE[esphome::bleadvcontroller::FanLampController::FanLampController(esphome::bleadvcontroller::Variant)]+0x10): undefined reference to `vtable for esphome::bleadvcontroller::FanLampController'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._ZN7esphome16bleadvcontroller17FanLampControllerC5ENS0_7VariantE[esphome::bleadvcontroller::FanLampController::FanLampController(esphome::bleadvcontroller::Variant)]+0x14): undefined reference to `vtable for esphome::bleadvcontroller::FanLampController'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0xf4): undefined reference to `vtable for esphome::light::LightOutput'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0xfc): undefined reference to `vtable for esphome::bleadvcontroller::BleAdvLight'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x100): undefined reference to `vtable for esphome::bleadvcontroller::BleAdvLight'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x104): undefined reference to `vtable for esphome::bleadvcontroller::BleAdvLight'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x130): undefined reference to `vtable for esphome::bleadvcontroller::BleAdvFan'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x134): undefined reference to `vtable for esphome::bleadvcontroller::BleAdvFan'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x190): undefined reference to `esphome::light::LightState::LightState(esphome::light::LightOutput*)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x194): undefined reference to `esphome::light::LightState::set_restore_mode(esphome::light::LightRestoreMode)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x198): undefined reference to `esphome::light::LightState::set_default_transition_length(unsigned int)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x19c): undefined reference to `esphome::light::LightState::set_flash_transition_length(unsigned int)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x1a0): undefined reference to `esphome::light::LightState::set_gamma_correct(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o:(.literal._Z5setupv+0x1a4): undefined reference to `esphome::light::LightState::add_effects(std::vector<esphome::light::LightEffect*, std::allocator<esphome::light::LightEffect*> > const&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o: in function `setup()':
/config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/main.cpp:269: undefined reference to `esphome::light::LightState::LightState(esphome::light::LightOutput*)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/main.cpp:291: undefined reference to `esphome::light::LightState::set_restore_mode(esphome::light::LightRestoreMode)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o: in function `esphome::bleadvcontroller::BleAdvEntity::BleAdvEntity()':
/config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/ble_adv_controller/ble_adv_controller.h:110: undefined reference to `esphome::light::LightState::set_default_transition_length(unsigned int)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/ble_adv_controller/ble_adv_controller.h:110: undefined reference to `esphome::light::LightState::set_flash_transition_length(unsigned int)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/main.o: in function `esphome::bleadvcontroller::BleAdvLight::BleAdvLight()':
/config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/ble_adv_controller/light/ble_adv_light.h:9: undefined reference to `esphome::light::LightState::set_gamma_correct(float)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/components/ble_adv_controller/light/ble_adv_light.h:9: undefined reference to `esphome::light::LightState::add_effects(std::vector<esphome::light::LightEffect*, std::allocator<esphome::light::LightEffect*> > const&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/controller.o:(.literal._ZN7esphome10Controller16setup_controllerEb+0x18): undefined reference to `esphome::fan::Fan::add_on_state_callback(std::function<void ()>&&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/controller.o:(.literal._ZN7esphome10Controller16setup_controllerEb+0x1c): undefined reference to `esphome::light::LightState::add_new_remote_values_callback(std::function<void ()>&&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/core/controller.o: in function `esphome::Controller::setup_controller(bool)':
/config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/core/controller.cpp:17: undefined reference to `esphome::fan::Fan::add_on_state_callback(std::function<void ()>&&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /config/.esphome/build/esp32-bluetooth-proxy-d61d68/src/esphome/core/controller.cpp:23: undefined reference to `esphome::light::LightState::add_new_remote_values_callback(std::function<void ()>&&)'
collect2: error: ld returned 1 exit status
*** [.pioenvs/esp32-bluetooth-proxy-d61d68/firmware.elf] Error 1

Hum I tried a minimum configuration with no other components and corrected some other missing includes, so you can give it a new try.
Still I was not able to reproduce your issue exactly, could you try to clean your build files and retry ? Could you also confirm you are using an ESP32 board?

The full minimum configuration used for my tests:

esphome:
  name: esp32-test

esp32:
  board: esp32dev

logger:
  level: DEBUG

ble_adv_controller:
  - id: my_controller
    variant: v2
    duration: 500

light:
  - platform: ble_adv_controller
    ble_adv_controller_id: my_controller
    name: First Light

fan:
  - platform: ble_adv_controller
    ble_adv_controller_id: my_controller
    name: My Fan

button:
  - platform: ble_adv_controller
    ble_adv_controller_id: my_controller
    name: Pair
    cmd: pair

external_components:
  - source: github://NicoIIT/esphome-components
    components: [ble_adv_controller]

Thanks @NicoIIT

I am using an esp32, the board configuration seems to be visible atop the logs

Processing esp32-bluetooth-proxy-d61d68 (board: esp32dev; framework: espidf; platform: platformio/[email protected])
--------------------------------------------------------------------------------
Library Manager: Installing esphome/Improv @ 1.2.3
INFO Installing esphome/Improv @ 1.2.3
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40405.230623 (4.4.5) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Generating assembly for certificate bundle...
Dependency Graph

I did run a clean and get same error it seems

Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ble_adv_controller/zhijia.o
In file included from src/esphome/components/ble_adv_controller/ble_adv_controller.cpp:1:
src/esphome/components/ble_adv_controller/ble_adv_controller.h:97:3: warning: missing initializer for member 'esp_ble_adv_data_t::service_data_len' [-Wmissing-field-initializers]
   };
   ^
src/esphome/components/ble_adv_controller/ble_adv_controller.h:97:3: warning: missing initializer for member 'esp_ble_adv_data_t::p_service_data' [-Wmissing-field-initializers]
src/esphome/components/ble_adv_controller/ble_adv_controller.h:97:3: warning: missing initializer for member 'esp_ble_adv_data_t::service_uuid_len' [-Wmissing-field-initializers]
src/esphome/components/ble_adv_controller/ble_adv_controller.h:97:3: warning: missing initializer for member 'esp_ble_adv_data_t::p_service_uuid' [-Wmissing-field-initializers]
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/ble_presence/ble_presence_device.o
In file included from src/esphome/components/ble_adv_controller/fan/ble_adv_fan.h:4,
                 from src/esphome/components/ble_adv_controller/fan/ble_adv_fan.cpp:1:
src/esphome/components/ble_adv_controller/fan/../ble_adv_controller.h:97:3: warning: missing initializer for member 'esp_ble_adv_data_t::service_data_len' [-Wmissing-field-initializers]
   };
   ^
src/esphome/components/ble_adv_controller/fan/../ble_adv_controller.h:97:3: warning: missing initializer for member 'esp_ble_adv_data_t::p_service_data' [-Wmissing-field-initializers]
src/esphome/components/ble_adv_controller/fan/../ble_adv_controller.h:97:3: warning: missing initializer for member 'esp_ble_adv_data_t::service_uuid_len' [-Wmissing-field-initializers]
src/esphome/components/ble_adv_controller/fan/../ble_adv_controller.h:97:3: warning: missing initializer for member 'esp_ble_adv_data_t::p_service_uuid' [-Wmissing-field-initializers]
Compiling .pioenvs/esp32-bluetooth-proxy-d61d68/src/esphome/components/bluetooth_proxy/bluetooth_connection.o

I am using a board that is doubling as a bluetooth proxy. I will try out a fresh board later today and let you know. What ESP32 board are you using?

It seems we may not use the same compiler options and yours is more strict, and showing errors on partially initialized structs, which must definitively be corrected!!!

As I could not reproduce I corrected from the logs you gave :slight_smile:

I also added a doc for the custom service.

I hope this time it will work!

Thanks a bunch @NicoIIT

I also booted up a new board, and that seemed to work! So I can compile and i have the board realized in HA. Nothing erroring in the logs

I think now im forgetting to pair the device :stuck_out_tongue: so let me try to do that and report back

Pairing is not working for me. These Chinese instructions are poorly translated. I am not sure if im doing something wrong or the esp cant communicate with the fan. What should i see in the logs if pair was successful?

EDIT: I got the pairing to work but when using the switches it seems to turn the light on significantly after its been toggled. I am looking into the duration parameter

EDIT2: Looks like the buttons work better when duration: 1 i guess ill keep playing with this. Sometimes they dont work at all and other times super responsive. I am guessing syncing the state of the fan with HA is a tall order. Since I can control the fan with the remote as well, the ESP is not tracking that state change with HA and still thinks its turned on (for instance)

There is a feature of standard esphome light that allows to switch on/off the light ‘smoothly’ making a transition of 1s by default. I advise to put it to 0s as a property of your light:

default_transition_length: 0s

On my side it solved the exact same issue a few days ago, and my light is performing the smooth transition on its own :slight_smile:. I have duration of 500 and all is working perfectly.

Concerning the fact the state is not changed in HA, this is indeed a big drawback of those BLE Advertising based devices: they only listen to broadcasted messages and never send back their state and then if you control the device with the remote, neither the android app nor esphome/HA will be informed of the state change :frowning:

Thanks @NicoIIT

It seems to be in most trouble when the light is on and i try to control the fan. Almost like I can only have one on at a time

Ok so you are right about the transition length in combination with the duration of 500 working well. While sometimes the commands still dont submit it is becoming more rare. Do i play with duration to help fine tune that?

Also my light is LED and has color temperature support. I don’t know if it was intentional but the temperature functions correctly but its reversed, meaning when i select warm it becomes cool.

Brightness values also work out of the box with no issue

Hum it is strange that some action are lost, there is a queue mechanism that should ensure it is not the case. Still there is a possibility that the device is still processing a previous message and missed another message, you can try to increase duration to 750 but it will mean that only one action can be executed every 0.75s. FYI on the android application side it is setup to 200.

For the cold / warn this was an issue previously experienced by other users, you can setup ‘reversed: true’ at the controller level, after the ‘id’ declaration, see the doc for ‘potentially experienced issues’.

I also added the support for 6 Level Speed Fan if you have a 6 level remote, this can be added to the fan with option ‘speed_count: 6’. it will not solve the state synchro issues between remote and app/HA but it cannot make it worst…

Voilà :slight_smile:

you can try to increase duration to 750 but it will mean that only one action can be executed every 0.75s

I might be pressing buttons too fast to begin with so maybe thats why they are getting dropped. I will play around with this some

For the cold / warn this was an issue previously experienced by other users, you can setup ‘reversed: true’ at the controller level, after the ‘id’ declaration, see the doc for ‘potentially experienced issues’.

Sorry for not seeing this in the doc, i though reversed was for fan direction

I also added the support for 6 Level Speed Fan if you have a 6 level remote

I do have this! So thanks for the update! I will pull the repo again and try it out

EDIT: For the sake of future readers this is the fan i purchased off Amazon and it works very well with this fan

In order to fix the fact the states are not in sync when using the remote, i guess using a remote that talks to HA directly would be a good alternative

Any chance you’d be able to dumb down a how to for this?