Closed ricain59 closed 4 months ago
Hello,
Do you see the packets in ESPHome log? This log should looks like below, but be sure that you get messages from your device by MAC address, in this example it's 2A:03:4E:CF:0F:38
.
[06:06:47][D][ble_gateway:063]: [2A:03:4E:CF:0F:38] Packet 043E2D02010000BA....
If your device requires active scanning, you should add this parameter into esp32_ble_tracker section (more info you can find here):
esp32_ble_tracker:
scan_parameters:
active: true
Hello,
Do you see the packets in ESPHome log? This log should looks like below, but be sure that you get messages from your device by MAC address, in this example it's
2A:03:4E:CF:0F:38
.[06:06:47][D][ble_gateway:063]: [2A:03:4E:CF:0F:38] Packet 043E2D02010000BA....
Yes, but only the first time when i active input_boolean.settings_ble_gateway_discovery on home assistant. And after that, never more the sensor send data to the home assistant and on esphome log never appear again this log.
If your device requires active scanning, you should add this parameter into esp32_ble_tracker section (more info you can find here):
esp32_ble_tracker: scan_parameters: active: true
I go to try this configuration. Thank you for your time.
Yes, but only the first time when i active input_boolean.settings_ble_gateway_discovery on home assistant. And after that, never more the sensor send data to the home assistant and on esphome log never appear again this log.
input_boolean.settings_ble_gateway_discovery
should allow to send all BLE packets into Home Assistant, not just from your device, so you should see many packets in the log sure if you have other BLE devices.
Hello, I know, but i only connected 1 device for testing.
I put this on esphome:
esp32_ble_tracker:
scan_parameters:
active: true
But the problem is the same, send the data the first time is connected on esphome and after that never send anymore.
I don't fin where is the problem, the sensor works fine directly connected o usb bluetooth connected on home assistant. But with esphome ble gateway only send the first time. I believe the problem on my side but don't find where.
I don't specify, but the sensor is aside the esp32.
Thank you.
You can also try to use esp-idf framework, bluetooth in this framework works better.
esp32:
board: esp32dev
framework:
type: esp-idf
So to make things simpler use this minimal config in your ESPHome device, where I mark important changes:
substitutions:
devicename: esp32-blegateway
upper_devicename: esp32-blegateway
esphome:
name: $devicename
external_components:
- source: github://myhomeiot/esphome-components
esp32:
board: esp32dev
framework:
type: esp-idf # <--------------------------------
mqtt:
broker: x.x.x.x
username: !secret esphomemqttlogin
password: !secret esphomemqttpass
port: 1883
wifi:
ssid: !secret esphomewifi
password: !secret esphomewifipass
reboot_timeout: 5min
fast_connect: on
domain: !secret esphomedomain
logger:
api:
encryption:
key: !secret esphomeapiha
ota:
password: !secret esphomeota
web_server:
port: 80
esp32_ble_tracker:
scan_parameters:
active: true # <--------------------------------
ble_gateway:
id: blegateway
discovery: true # <--------------------------------
on_ble_advertise:
then:
homeassistant.event:
event: esphome.on_ble_advertise
data:
packet: !lambda return packet;
# gateway_id: ${device_id}
If this doesn't help when I need more information about your device and maybe some logs from Passive BLE Monitor when device connected by USB dongle.
Hello, I've done this changes 1 hours ago and working fine. I'm waiting more days and give more feedback.
Thank you for your help and your time.
Hello, It's working fine.
Thank you for your help.
Hi,
I've a sensor connected on passive ble, with a usb bluetooth connected on my home assistant and working fine various weeks ago. I try connect this sensor on BLE gateway, but send the first time value and not send anymore any values.
Maybe i've put or done anything wrong and need your help.
It's my esp32 board: https://pt.aliexpress.com/item/1005006220389074.html?spm=a2g0o.order_list.order_list_main.45.3e1bcaa4BezpRe&gatewayAdapt=glo2bra
My esphome code on esp32:
Put this on home assistant:
And create this automation on Home assistant:
What ti's wrong on my configuration?
Thank you for help.