Esphome BT Proxy with other sensor, possible?

Hi all

I’ve tried to build an Esphome bt proxy project adding also a bh1750 sensor. After installing into an esp32, it creates another project to adopt in the esphome page, but the new one does not contain the bh1750 sensor part.

Is there a way to do it?
Or is there a way to create a project that uses the esp32 to extend the bt and also let me use gpio to use one or more sensors?

Thanks

Yes it course. Just add the bh1750 config to the existing yaml. Install. Job done.

1 Like

Thanks

Will this code works both for BT Proxy and for sensor BH1750?

esphome:
  name: bluetooth-proxy-bh1750
  friendly_name: bluetooth proxy bh1750

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: “xxxxxxxxxxx”

ota:
  password: “xxxxxxx”

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bluetooth-Proxy-Bh1750"
    password: “xxxxxxxx”

captive_portal:
    
esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: true

switch:
  - platform: restart
    name: "BT Proxy BH1750 Restart"

i2c:
   sda: GPIO2
   scl: GPIO4
   scan: true

sensor:
  - platform: bh1750
    address: 0x23
    name: "BH1750 Illuminance"
    update_interval: 30s

That’s the way

I tried this code, it shows the sensor values for a couple of seconds, then it become unavailable and it does not come available any more…

Maybe the BT proxy part uses a lot of resources

Particularly set up that way the bt proxy will take a lot of resources.

Those interval and windows settings are for wired Ethernet. Change them to the defaults.

2 Likes

Thanks!!!
It works this way, I just removed the interval and windows lines