dentra/esphome-components

Which id to use in the configuration of EraClean CWBS-01: "lambda: id(sw_ble_client).turn_off();"

mihsu81 opened this issue · 4 comments

Hi @dentra,

Which id should be used in the configuration file for a EraClean CWBS-01 instead of sw_ble_client?

ota:
  on_begin:
    then:
      - lambda: id(sw_ble_client).turn_off();

Using the name of the ESP32 device throws errors during compilation, and sw_ble_client is not recognised.

Thanks in advance for your help and for the awesome job. 😊

@mihsu81 this is optional, but if you wish, here is an additional config lines:

switch:
  - platform: ble_client
    id: sw_ble_client
    ble_client_id: ble_client_deodorizer
    name: cwbs01 enabled

Thanks a lot @dentra. Works fine now.
This tells the ble_client component to connect to the CW-BS01, read the data and disconnect?
Wouldn't it be more appropriate to use a button component instead of a switch, or that can't be turned off in case of an ota update?

@mihsu81 the switch is only needed to disable connection before OTA update, you could even set it to internal: true. The binary_sensor.platform[miot_cwbs01] connects and disconnects independently

Thanks a lot @dentra for your help and clarifications.