『瀚思彼岸』» 智能家居技术论坛

标题: 自制开源ESPHome通用蓝牙网关(ESP32) [打印本页]

作者: riceball    时间: 2022-5-6 21:22
标题: 自制开源ESPHome通用蓝牙网关(ESP32)
本帖最后由 riceball 于 2022-5-21 15:10 编辑

该蓝牙通用网关与https%3A//github.com/custom-components/ble_monitor">Passive BLE Monitor 集成搭配使用.

从而解决因为蓝牙穿墙能力弱导致蓝牙信号无法穿墙的问题,蓝牙通用网关的主要用途有:



  1. 蓝牙信号过不来的就走开源ESPHome通用蓝牙网关,通过wifi信号再到HA上的 https%3A//github.com/custom-components/ble_monitor">Passive BLE Monitor 集成.

  2. 接入只支持Active BLE connection的蓝牙设备


关于蓝牙设备的相关介绍,请参阅: HA智能硬件采购避坑指要(三) 蓝牙篇


硬件很简单,你只需要自备ESP32的主板一枚,建议最好选4M Flash的, 虽然2M的也能刷,但是稍微麻烦些(而且因为闪存小无法支持OTA了). 我选的是ESP-C3-32S(4M)的开发板. 可在某陶上搜索"ESP-C3-32S-Kit"记得问清楚是否4M(2M和4M只差几毛钱).



ESP32-C3是Espressif新出的RISC-V 32位单核处理器(160MHz)支持蓝牙5.0(BLE支持),以前的ESP32是基于蓝牙4.2.



然后准备好ESPHome开发环境,请升级到ESPHome的最新版(至少2022.1版本以后),请不要在arm环境下开发,因为Espressif目前还不支持ESP-C3在arm下的编译.


在Linux环境下安装使用很简单:


sudo apt -y install python3 python3-pip python3-pip-whl
sudo -H pip3 install --upgrade pip
pip3 install --user esphome
# To set this permanently, you can run echo 'export PATH=$PATHHOME/.local/bin' >> $HOME/.bashrc
export PATH=$PATHHOME/.local/bin
# You may need to logout and back in for the new group to take effect.
sudo usermod -a -G dialout $USER

好了,刷机的YAMLbluetooth-gateway.yaml配置如下(如果板子不是ESP32-C3请自行调整board参数),记得在相同目录下的secrets.yaml文件中填好参数:


substitutions:
  # Name the device and it's entities
  device: ble_gateway
  device_name: blegateway1

esphome:
  name: $device_name
  comment: $device
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-c3-devkitm-1
  variant: esp32c3
  framework:
    type: arduino
    version: 2.0.2
    platform_version: https://github.com/tasmota/platf ... essif32-2.0.2.3.zip

external_components:
  - source: github://myhomeiot/esphome-components

esp32_ble_tracker:

# Enable logging
logger:

# Enable Home Assistant API
api:
  reboot_timeout: 1h

ota:
  password: !secret ota_password

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

  # Enable fallback hotspot in case wifi connection fails
  ap:
    ssid: "$device_name Fallback Hotspot"
    password: !secret ap_password

ble_gateway:
  id: $device_name
  # devices:
  #   - mac_address: 01:23:45:67:89:AB
  #   - mac_address: !secret lywsd03mmc_mac
  on_ble_advertise:
    then:
      - homeassistant.service:
          service: ble_monitor.parse_data
          data:
            packet: !lambda return packet;
            gateway_id: $device_name
      - homeassistant.event:
          event: esphome.on_ble_advertise
          data:
            packet: !lambda return packet;

binary_sensor:
  - platform: homeassistant
    id: ble_gateway_discovery
    entity_id: binary_sensor.ble_gateway
    attribute: discovery
    on_state:
      then:
        lambda: id($device_name).set_discovery(x);

text_sensor:
  - platform: homeassistant
    id: ble_gateway_devices
    entity_id: binary_sensor.ble_gateway
    attribute: devices
    on_value:
      then:
        lambda: id($device_name).set_devices(x);
  # IP address of device. Not really needed for HA (as HA already knows it), but for showing on the display during startup. The startup screen will leave on if no instance connects to the API.
  - platform: wifi_info
    ip_address:
      name: $device_name IP address
      id: ip_address
  # ESPHome version used to compile the app
  - platform: version
    name: $device_name ESPHome Version

sensor:
  # WiFi signals strength sensor
  - platform: wifi_signal
    name: $device_name WiFi Signal Sensor
    update_interval: 60s

USB插上ESP32开发板,看清楚串口号(ls /dev/tty*),一般是/dev/ttyUSB0,然后执行如下语句编译烧录固件:


# choose the port after compiling
esphome run bluetooth-gateway.yaml

至此,通用蓝牙网关的硬件烧录部分完成.


接着,还要在HA上配置与https%3A//github.com/custom-components/ble_monitor">Passive BLE Monitor 集成的搭配部分.


修改HA configuration.yaml文件:


input_boolean:
  ha_started:
    initial: false
  settings_ble_gateway:
    name: BLE Gateway
    icon: mdi:bluetooth
  settings_ble_gateway_discovery:
    name: BLE Gateway Discovery
    icon: mdi:bluetooth-connect

input_text:
  settings_ble_gateway_add_device:
    name: BLE Gateway Add Device
    icon: mdi:bluetooth-connect
    initial: ''

template:
  - binary_sensor:
      - name: BLE Gateway Add Device
        state: "{{ (state_attr('binary_sensor.ble_gateway_add_device', 'mac_address')) }}"
        availability: "{{ is_state('input_boolean.ha_started', 'on') }}"
        attributes:
          mac_address: "{{ states('input_text.settings_ble_gateway_add_device') | replace(':', '') | trim }}"
  - binary_sensor:
      - name: BLE Gateway
        icon: mdi:bluetooth
        state: "{{ is_state('input_boolean.settings_ble_gateway', 'on') }}"
        availability: "{{ is_state('input_boolean.ha_started', 'on') }}"
        attributes:
          discovery: "{{ is_state('input_boolean.settings_ble_gateway_discovery', 'on') }}"
          devices: "{{ states | selectattr('entity_id', 'search', '^(device_tracker||(binary_)?sensor).ble_') | selectattr('attributes.mac_address', 'defined') | map(attribute='attributes.mac_address') | unique | sort | join('') | replace(':', '') if is_state('binary_sensor.ble_gateway', 'on') }}"

然后修改automations.yaml文件:


- alias: HA Start automation
  initial_state: true
  trigger:
    platform: homeassistant
    event: start
  action:
    service: input_boolean.turn_on
    entity_id: input_boolean.ha_started
  id: ha_start

重启HA即可. 对了记得把刚刚新鲜出炉的蓝牙网关加入进来.


然后该蓝牙网关就会自动转发已发现的并且在https%3A//github.com/custom-components/ble_monitor">Passive BLE Monitor 集成中设备.


如果要添加新的蓝牙设备请在https%3A//github.com/custom-components/ble_monitor">Passive BLE Monitor 集成上添加.

如果想只针对个别设备在指定的蓝牙网关上转发,那么请使用input_text.settings_ble_gateway_add_device添加该设备的MAC地址.


蓝牙网关接收到已注册设备的广播后会同时触发事件esphome.on_ble_advertise发送原始数据.


最后,记得设置input_boolean.settings_ble_gateway为"on",启用蓝牙网关功能.

设置input_boolean.settings_ble_gateway_discovery为"on",启用自动发现功能.


ESPHome 蓝牙网关的日志查看:



  1. 在 PC 上通过直接连接的USB:  esphome logs bluegateway.yaml --device /dev/ttyUSB0

  2. PC 远程查看: esphome logs bluegateway.yaml 选择远程

  3. HA上远程查看: 启用 ESPHome addon, 建一个同名的空配置,点 LOGS .


版本更新


2022-5-9: [zxsq-anti-bbcode-Bug] esp-idf 下无法更改 scan_parameters, 使用 Arduino framework now.

2022-5-21: [zxsq-anti-bbcode-feat] 新增 启用自动发现开关



作者: hellkun    时间: 2022-5-6 23:09
感谢LZ分享

ESP C3的开发板建议慎选,C3是单核RISC-V方案,优势是支持蓝牙5.0,价格更便宜,但是跟之前的ESP32的双核Xtensa还是差别比较大的,包括ESPHOME目前对它的支持还处于in development状态,我自己在编译的过程中遇到过奇奇怪怪的小坑。个人觉得,多花几块钱买普通的ESP32对新手更友好
作者: riceball    时间: 2022-5-7 06:10
hellkun 发表于 2022-5-6 23:09
感谢LZ分享

ESP C3的开发板建议慎选,C3是单核RISC-V方案,优势是支持蓝牙5.0,价格更便宜,但是跟之前的E ...

既然是用途作为蓝牙网关,当然要选蓝牙5,向下兼容的。
在PC上编译,没问题的,不过一定要记得升级esphome到最新版
作者: liwei19920307    时间: 2022-5-7 09:54
感谢分享 C3确实很好 我很多项目都用的C3 这个项目拓展了蓝牙功能 很棒
作者: riceball    时间: 2022-5-7 10:03
忘记写了,最后要记得设置`input_boolean.settings_ble_gateway`为"on",启用蓝牙网关功能.

作者: wison    时间: 2022-5-7 10:55
有没购买链接啊,私发我一下吧,怕买错了
作者: XCray    时间: 2022-5-7 11:37
本帖最后由 XCray 于 2022-5-7 12:56 编辑

这个称为“蓝牙网关”不太准确吧?更接近于蓝牙中继器的概念。另外,ble_monitor虽然不错但也有明显的缺点。其实esphome本身已经可以实现很不错的蓝牙网关功能,使用上也更简单。加上自己撸的代码,扩展性也够了。我自己在用的就是花花草草、蓝牙温湿度(内置组件)、体脂秤、燃气灶、门锁、yeelight调光开关(自定义组件)一块esp32搞定
作者: ghostist    时间: 2022-5-7 13:10
XCray 发表于 2022-5-7 11:37
这个称为“蓝牙网关”不太准确吧?更接近于蓝牙中继器的概念。另外,ble_monitor虽然不错但也有明显的缺点 ...

X大白嫖一下体脂称+蓝牙温湿度可否?

作者: ztrx    时间: 2022-5-7 13:42
esp32蓝牙距离有多远
作者: riceball    时间: 2022-5-7 13:47
XCray 发表于 2022-5-7 11:37
这个称为“蓝牙网关”不太准确吧?更接近于蓝牙中继器的概念。另外,ble_monitor虽然不错但也有明显的缺点 ...

1. 是的主要是能中继, 不过也可以说网关: HA上可以不用插蓝牙适配器, 就可以通过这货接入蓝牙设备.
2. ble_monitor 集成的缺陷在哪里? 还请多多指教.
3. 如果有更通用的方式,那自是更好
4. 如果能搞定蓝牙发送指令,未来就是蓝牙的,价格决定一切


作者: XCray    时间: 2022-5-7 16:43
ghostist 发表于 2022-5-7 13:10
X大白嫖一下体脂称+蓝牙温湿度可否?

体脂秤我之前发过帖子,有代码,一般需要根据具体秤的情况修改。

蓝牙温湿度直接用esphome自己的组件就行了。

当然,这些都是积木,直接在yaml里面组合就行。
作者: XCray    时间: 2022-5-7 16:58
riceball 发表于 2022-5-7 13:47
1. 是的主要是能中继, 不过也可以说网关: HA上可以不用插蓝牙适配器, 就可以通过这货接入蓝牙设备.
2. bl ...

1. 也对,这个思路确实挺巧妙的。
2. 我知道一个情况,也不能说完全是ble_monitor的问题。ble_monitor机械地把物理实体映射到ha的传感器,有时候后就会出现数值没变化但实际上有动作需要触发自动化。我最早意识到这个问题是yeelight调光开关的重复动作;再比如指纹锁,连续用同一个指纹开锁,keyid肯定没变化,以至于传感器数值也没有变化;ble_monitor只能提供超时后数值重置的方法,但这个超时最短只能设置为1秒(默认35秒)。显然,很多时候1秒还是太长了。
3. 通用性这方面,其实esphome和ble_monitor也是在互相促进,主要受限还是各厂家各产品的开放性问题,尤其是加密方面。
4. 蓝牙发送指令在esphome上已经可以初步实现了,就是ble_client,但主要限制还是厂家不够开放,也就是我们很只知道发给设备的具体指令是啥。这个比较有参考价值的是坛里风靡一时的那个魅族遥控器。
作者: riceball    时间: 2022-5-7 21:05
XCray 发表于 2022-5-7 16:58
1. 也对,这个思路确实挺巧妙的。
2. 我知道一个情况,也不能说完全是ble_monitor的问题。ble_monitor机 ...

2. 是的有的传感是需要每次状态都要的, 把`reset_timer`设置为0,能不能成? 我看文档说设置为0是关闭该习惯. 如果不能那就需要提一个issue了.
3&4. 对啊, 就如Zigbee的ZHA推出了很久了,但是接入还是各种麻烦. 还是需要适配设备. 在我看来这是因为知识工程还不完善.  扯远了.  就通用性而言, 我感觉  Tasmota 要好于 ESPHome, 但是  Tasmota 太重了. 如果 Tasmota能作为一个简单的HA替代性能又太弱, ESPHome的好处是编译灵活,模块化好,不过如果每加一个设备就要重新编译上传固件也挺烦的. ble_monitor 已经有点像Z2M的感觉了:设备的注册管理以及解析内容由ble_monitor完成,只要在ble_monitor 上添加新设备的数据解析就能立马支持新设备,如果能破袭发送指令,那么通过ble_client也是很简单的事情,



作者: home-io    时间: 2022-5-8 21:16
可以试一下
作者: riceball    时间: 2022-5-9 19:24
修正错误

2022-5-9: [Bug] esp-idf 下无法更改 scan_parameters, 使用 Arduino framework now.
作者: evadestiny    时间: 2022-5-14 17:03
wison 发表于 2022-5-7 10:55
有没购买链接啊,私发我一下吧,怕买错了

你好,问一下你买了吗?要是买了给个链接
作者: riceball    时间: 2022-5-14 19:51
evadestiny 发表于 2022-5-14 17:03
你好,问一下你买了吗?要是买了给个链接

在某陶上搜索"ESP-C3-32S-Kit"记得问清楚是否4M(2M和4M只差几毛钱).
作者: evadestiny    时间: 2022-5-14 20:16
楼上大佬有没有推荐的淘宝链接,想少走点弯路
作者: riceball    时间: 2022-5-14 20:34
evadestiny 发表于 2022-5-14 20:16
楼上大佬有没有推荐的淘宝链接,想少走点弯路

不作担保,我买的这家 https://detail.tmall.com/item.htm?id=653180591542
作者: shavn1984    时间: 2022-5-15 15:39
ble_gateway:
  id: $device_name  这行报错
作者: shavn1984    时间: 2022-5-17 02:14
我用的ESP-C3-32S(4M)  ,用esphome webtool编译烧写bin成功,就是连不上wifi,怎么破?
作者: riceball    时间: 2022-5-17 08:04
shavn1984 发表于 2022-5-17 02:14
我用的ESP-C3-32S(4M)  ,用esphome webtool编译烧写bin成功,就是连不上wifi,怎么破? ...

查日志(Logs)
作者: evadestiny    时间: 2022-5-17 10:41
大佬请教一个问题,yaml文件里的
!secret
!lambda
这些参数是固定的语法格式吗?
还是需要自己修改,我用的是你本篇文章用的esp32的型号
作者: shavn1984    时间: 2022-5-17 16:51
riceball 发表于 2022-5-17 08:04
查日志(Logs)

板子是2M的。。求指教如何刷?
作者: riceball    时间: 2022-5-17 20:39
evadestiny 发表于 2022-5-17 10:41
大佬请教一个问题,yaml文件里的
!secret
!lambda

仔细看文,要改的是 !secret, 放在secrets.yaml文件中
!lambda 是程序,不要改
作者: riceball    时间: 2022-5-17 20:41
shavn1984 发表于 2022-5-17 16:51
板子是2M的。。求指教如何刷?

ESPHome 新手不推荐2M
作者: shavn1984    时间: 2022-5-17 21:35
riceball 发表于 2022-5-17 20:41
ESPHome 新手不推荐2M

我用另外一块旧的板子刷好了。日志里有扫描到的蓝牙设备。ha config和自动化都配置好了,但是重启后扫不到设备
作者: ilongjiang    时间: 2022-5-17 22:27
大神复制进去报错了。记得在相同目录下的secrets.yaml文件中填好参数.这个不知道怎么填
作者: riceball    时间: 2022-5-18 07:20
shavn1984 发表于 2022-5-17 21:35
我用另外一块旧的板子刷好了。日志里有扫描到的蓝牙设备。ha config和自动化都配置好了,但是重启后扫不 ...

还是得查日志阿, 蓝牙没开?
作者: riceball    时间: 2022-5-18 07:21
ilongjiang 发表于 2022-5-17 22:27
大神复制进去报错了。记得在相同目录下的secrets.yaml文件中填好参数.这个不知道怎么填 ...

自然用yaml格式填

key: value
key2: value2
作者: nucleic_acid    时间: 2022-5-18 19:43
感谢分享,做了一个,用的是d1 r32,安装顺利没有任何问题,C3下单了,封城了不知道啥时候能送来。用起来挺好的,就是觉得每次重启HA之后蓝牙网关同步不太顺利,要拿到主机那里去识别一下就连上了,先观察几天,研究一下
作者: shavn1984    时间: 2022-5-18 20:02
riceball 发表于 2022-5-18 07:20
还是得查日志阿, 蓝牙没开?

2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] Initializing BLE Monitor entry (config entry): <homeassistant.config_entries.ConfigEntry object at 0x7f6b4fbc6700>
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: domain {}
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] Bluetooth interface is disabled
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] HCI interface is ['disable']
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': True, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': [], 'is_flow': True, 'hci_interface': ['disable']}
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] Spawning HCIdump thread
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: Init
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] 0 encryptors mac:key pairs loaded
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] sensor whitelist: []
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] 0 sensor whitelist item(s) loaded
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] 0 device tracker(s) being monitored
2022-05-17 17:50:25 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:50:25 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:50:35 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Starting binary sensor entry startup
2022-05-17 17:50:35 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialization
2022-05-17 17:50:35 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialized
2022-05-17 17:50:35 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary sensor entry setup finished
2022-05-17 17:50:35 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary entities updater loop started!

2022-05-17 17:50:43 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Starting device tracker entry startup
2022-05-17 17:50:43 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] BLE device tracker updater initialization
2022-05-17 17:50:43 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] BLE device tracker updater initialized
2022-05-17 17:50:43 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Device Tracker entry setup finished
2022-05-17 17:50:43 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Device tracker updater loop started!

2022-05-17 17:51:43 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 17:51:46 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Starting measuring sensor entry startup
2022-05-17 17:51:46 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialization
2022-05-17 17:51:46 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialized
2022-05-17 17:51:46 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Measuring sensor entry setup finished

2022-05-17 17:51:52 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Entities updater loop started!



2022-05-17 17:52:26 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: None
2022-05-17 17:52:26 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (before): {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': True, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': [], 'is_flow': True, 'hci_interface': ['disable']}

2022-05-17 17:53:14 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 17:53:14 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 17:53:14 DEBUG (Thread-3) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 17:53:14 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:53:14 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:53:14 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 17:53:14 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)

2022-05-17 17:53:19 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)

2022-05-17 17:54:14 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 17:54:14 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 17:54:14 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 17:54:14 DEBUG (Thread-3) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 17:54:14 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:54:14 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:54:14 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)

2022-05-17 17:54:19 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)

2022-05-17 17:55:05 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: None
2022-05-17 17:55:05 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (before): {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': True, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': [], 'is_flow': True, 'hci_interface': ['disable']}
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: {'bt_interface': [], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (after): {'bt_interface': [], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] _create_entry: {'bt_interface': [], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] async_unload_entry: <homeassistant.config_entries.ConfigEntry object at 0x7f6b4fbc6700>
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: joining
2022-05-17 17:55:11 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 17:55:11 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Run finished
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: joined
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] BLE monitor stopped
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] Initializing BLE Monitor entry (config entry): <homeassistant.config_entries.ConfigEntry object at 0x7f6b4fbc6700>
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: domain {}
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] Bluetooth interface is disabled
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] HCI interface is ['disable']
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': [], 'is_flow': True, 'hci_interface': ['disable']}
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] Spawning HCIdump thread
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: Init
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] 0 encryptors mac:key pairs loaded
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] sensor whitelist: []
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] 0 sensor whitelist item(s) loaded
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor] 0 device tracker(s) being monitored
2022-05-17 17:55:11 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Starting device tracker entry startup
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] BLE device tracker updater initialization
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] BLE device tracker updater initialized
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Device Tracker entry setup finished
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Starting binary sensor entry startup
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialization
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialized
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary sensor entry setup finished
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Starting measuring sensor entry startup
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialization
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialized
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Measuring sensor entry setup finished
2022-05-17 17:55:11 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Device tracker updater loop started!
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary entities updater loop started!
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Entities updater loop started!
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Entities updater loop stopped
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Entities updater loop stopped
2022-05-17 17:55:11 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Entities updater loop stopped

2022-05-17 17:56:11 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 17:56:11 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 17:56:11 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 17:56:11 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 17:56:11 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 17:56:11 DEBUG (Thread-18) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 17:56:11 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:56:11 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:57:12 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 17:57:12 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 17:57:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 17:57:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 17:57:12 DEBUG (Thread-18) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 17:57:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:57:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:57:12 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)

2022-05-17 17:58:12 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 17:58:12 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 17:58:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 17:58:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 17:58:12 DEBUG (Thread-18) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 17:58:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:58:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:58:12 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)

2022-05-17 17:59:12 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 17:59:12 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 17:59:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 17:59:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 17:59:12 DEBUG (Thread-18) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 17:59:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:59:12 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:59:12 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 17:59:56 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: None
2022-05-17 17:59:56 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (before): {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': [], 'is_flow': True, 'hci_interface': ['disable']}
2022-05-17 17:59:57 WARNING (MainThread) [androidtv.adb_manager.adb_manager_async] Couldn't connect to 192.168.2.78:5555.  OSError: Connect call failed ('192.168.2.78', 5555)
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: {'bt_interface': [], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (after): {'bt_interface': [], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] _create_entry: {'bt_interface': [], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] async_unload_entry: <homeassistant.config_entries.ConfigEntry object at 0x7f6b4fbc6700>
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: joining
2022-05-17 17:59:59 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 17:59:59 DEBUG (Thread-18) [custom_components.ble_monitor] HCIdump thread: Run finished
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: joined
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] BLE monitor stopped
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] Initializing BLE Monitor entry (config entry): <homeassistant.config_entries.ConfigEntry object at 0x7f6b4fbc6700>
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: domain {}
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] Bluetooth interface is disabled
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] HCI interface is ['disable']
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': [], 'is_flow': True, 'hci_interface': ['disable']}
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] Spawning HCIdump thread
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: Init
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] 0 encryptors mac:key pairs loaded
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] sensor whitelist: []
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] 0 sensor whitelist item(s) loaded
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor] 0 device tracker(s) being monitored
2022-05-17 17:59:59 DEBUG (Thread-38) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Starting device tracker entry startup
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] BLE device tracker updater initialization
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] BLE device tracker updater initialized
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Device Tracker entry setup finished
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Starting binary sensor entry startup
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialization
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialized
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary sensor entry setup finished
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Starting measuring sensor entry startup
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialization
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialized
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Measuring sensor entry setup finished
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Device tracker updater loop started!
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary entities updater loop started!
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Entities updater loop started!
2022-05-17 17:59:59 DEBUG (Thread-38) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Entities updater loop stopped
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Entities updater loop stopped
2022-05-17 17:59:59 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Entities updater loop stopped
2022-05-17 18:00:42 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: None
2022-05-17 18:00:42 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (before): {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': [], 'is_flow': True, 'hci_interface': ['disable']}
2022-05-17 18:01:00 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:01:00 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:01:00 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 18:01:00 DEBUG (Thread-38) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:01:00 DEBUG (Thread-38) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:01:00 DEBUG (Thread-38) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:01:00 DEBUG (Thread-38) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:01:00 DEBUG (Thread-38) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 18:01:17 WARNING (MainThread) [androidtv.adb_manager.adb_manager_async] Couldn't connect to 192.168.2.78:5555.  OSError: Connect call failed ('192.168.2.78', 5555)
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init user_input: {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] async_step_init (after): {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.config_flow] _create_entry: {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': '--Devices--'}
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] async_unload_entry: <homeassistant.config_entries.ConfigEntry object at 0x7f6b4fbc6700>
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: joining
2022-05-17 18:01:32 DEBUG (Thread-38) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:01:32 DEBUG (Thread-38) [custom_components.ble_monitor] HCIdump thread: Run finished
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: joined
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] BLE monitor stopped
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] Initializing BLE Monitor entry (config entry): <homeassistant.config_entries.ConfigEntry object at 0x7f6b4fbc6700>
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: domain {}
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] Bluetooth interface is disabled
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] HCI interface is ['disable']
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] async_setup_entry: {'bt_interface': ['disable'], 'bt_auto_restart': False, 'active_scan': False, 'discovery': True, 'period': 60, 'use_median': False, 'decimals': 1, 'log_spikes': False, 'restore_state': False, 'report_unknown': 'Off', 'devices': [], 'is_flow': True, 'hci_interface': ['disable']}
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] Spawning HCIdump thread
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] HCIdump thread: Init
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] 0 encryptors mac:key pairs loaded
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] sensor whitelist: []
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] 0 sensor whitelist item(s) loaded
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor] 0 device tracker(s) being monitored
2022-05-17 18:01:32 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:01:32 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Starting device tracker entry startup
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] BLE device tracker updater initialization
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] BLE device tracker updater initialized
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Device Tracker entry setup finished
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Starting binary sensor entry startup
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialization
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] BLE binary sensors updater initialized
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary sensor entry setup finished
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Starting measuring sensor entry startup
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialization
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.sensor] BLE sensors updater initialized
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Measuring sensor entry setup finished
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Device tracker updater loop started!
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Binary entities updater loop started!
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Entities updater loop started!
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] Entities updater loop stopped
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Entities updater loop stopped
2022-05-17 18:01:32 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] Entities updater loop stopped
2022-05-17 18:02:33 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:02:33 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:02:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:02:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:02:33 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:02:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:02:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 18:02:33 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)

2022-05-17 18:03:33 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:03:33 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:03:33 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 18:03:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:03:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:03:33 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:03:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:03:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop

2022-05-17 18:04:33 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:04:33 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:04:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:04:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:04:33 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:04:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:04:33 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 18:04:33 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)

2022-05-17 18:05:34 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:05:34 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:05:34 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:05:34 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:05:34 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:05:34 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:05:34 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 18:05:34 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)

2022-05-17 18:06:34 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:06:34 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:06:34 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:06:34 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:06:34 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:06:34 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:06:34 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 18:06:34 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)

2022-05-17 18:07:35 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:07:35 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:07:35 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 18:07:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:07:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:07:35 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:07:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:07:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop

2022-05-17 18:08:35 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:08:35 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:08:35 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 18:08:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:08:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:08:35 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:08:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:08:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop

2022-05-17 18:09:35 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:09:35 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:09:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:09:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:09:35 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:09:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:09:35 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 18:09:35 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)
2022-05-17 18:10:36 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)
2022-05-17 18:10:36 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 BLE advertisements processed for 0 binary sensor device(s)
2022-05-17 18:10:36 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing.
2022-05-17 18:10:36 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2022-05-17 18:10:36 DEBUG (Thread-45) [custom_components.ble_monitor] 0 HCI events processed for previous period
2022-05-17 18:10:36 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: Run
2022-05-17 18:10:36 DEBUG (Thread-45) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2022-05-17 18:10:36 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE advertisements processed for 0 sensor device(s)


作者: shavn1984    时间: 2022-5-18 20:05
riceball 发表于 2022-5-18 07:20
还是得查日志阿, 蓝牙没开?

我在集成里就不显示自制蓝牙网关,也不显示原来主机上的usb蓝牙适配器。
作者: riceball    时间: 2022-5-19 06:30
shavn1984 发表于 2022-5-18 20:02
2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] Initializing BLE Monitor en ...
  1. 2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] Bluetooth interface is disabled
  2. 2022-05-17 17:50:25 DEBUG (MainThread) [custom_components.ble_monitor] HCI interface is ['disable']
复制代码


你这个是ble_monitor的日志,不是esphome网关的日志, 如果要自动发现没有加密的设备,必须要在集成启用自动发现配置. 否则你得自己加上设备的MAC地址,如果是加密的,还要有加密Key.

另外 input_boolean.settings_ble_gateway 实体设置为"on"没有?

执行 `esphome logs bluegateway.yaml --device /dev/ttyUSB0` 查看 蓝牙网关日志. 远程查看可以用 ESPHome addon, 建一个同名的空配置即可.
作者: riceball    时间: 2022-5-19 06:37
nucleic_acid 发表于 2022-5-18 19:43
感谢分享,做了一个,用的是d1 r32,安装顺利没有任何问题,C3下单了,封城了不知道啥时候能送来。用起来挺 ...

留意下日志, 更新了文档,加上如何查看 ESPHome 日志
作者: nucleic_acid    时间: 2022-5-19 12:10
本帖最后由 nucleic_acid 于 2022-5-19 13:18 编辑
riceball 发表于 2022-5-19 06:37
留意下日志, 更新了文档,加上如何查看 ESPHome 日志

刚才看了你之前的帖子

使用Passive BLE Monitor集成代替蓝牙网关直接接入HA
https://bbs.hassbian.com/thread-16148-1-1.html
发现重启后恢复状态没有勾选,勾了之后就好了,非常完美

下面的内容是之前发的,就不删了

=================================================================================

  1. [11:13:44][C][logger:274]: Logger:
  2. [11:13:44][C][logger:275]:   Level: DEBUG
  3. [11:13:44][C][logger:276]:   Log Baud Rate: 115200
  4. [11:13:44][C][logger:277]:   Hardware UART: UART0
  5. [11:13:44][C][ble_gateway:055]: BLE Gateway: Discovery NO, 0 device(s) configured:
  6. [11:13:44][C][version.text_sensor:021]: Version Text Sensor 'blegateway1 ESPHome Version'
  7. [11:13:44][C][version.text_sensor:021]:   Icon: 'mdi:new-box'
  8. [11:13:44][C][esp32_ble_tracker:712]: BLE Tracker:
  9. [11:13:44][C][esp32_ble_tracker:713]:   Scan Duration: 300 s
  10. [11:13:44][C][esp32_ble_tracker:714]:   Scan Interval: 320.0 ms
  11. [11:13:44][C][esp32_ble_tracker:715]:   Scan Window: 30.0 ms
  12. [11:13:44][C][esp32_ble_tracker:716]:   Scan Type: ACTIVE
  13. [11:13:44][C][mdns:084]: mDNS:
  14. [11:13:44][C][mdns:085]:   Hostname: blegateway1
  15. [11:13:44][C][ota:085]: Over-The-Air Updates:
  16. [11:13:44][C][ota:086]:   Address: blegateway1.local:3232
  17. [11:13:44][C][ota:089]:   Using Password.
  18. [11:13:44][C][api:138]: API Server:
  19. [11:13:44][C][api:139]:   Address: blegateway1.local:6053
  20. [11:13:44][C][api:143]:   Using noise encryption: NO
  21. [11:13:44][C][wifi_info:009]: WifiInfo IPAddress 'blegateway1 IP address'
  22. [11:13:44][C][wifi_signal.sensor:009]: WiFi Signal 'blegateway1 WiFi Signal Sensor'
  23. [11:13:44][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
  24. [11:13:44][C][wifi_signal.sensor:009]:   State Class: 'measurement'
  25. [11:13:44][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
  26. [11:13:44][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
  27. [11:13:44][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'ble_gateway_devices'
  28. [11:13:44][C][homeassistant.text_sensor:024]:   Entity ID: 'binary_sensor.ble_gateway'
  29. [11:13:44][C][homeassistant.text_sensor:026]:   Attribute: 'devices'
  30. [11:13:58][D][sensor:125]: 'blegateway1 WiFi Signal Sensor': Sending state -43.00000 dBm with 0 decimals of accuracy
复制代码
这是HA重启之后的日志,ESP32上没有任何蓝牙设备,如果HA附近没有蓝牙设备连上去,等很久也不会同步,ESP32一直显示在扫描
然后我将蓝牙设备拿到HA附近,检测到设备后,会自动同步连上的设备到ESP32

  1. [11:32:01][D][homeassistant.text_sensor:015]: 'binary_sensor.ble_gateway::devices': Got attribute state 'C37F254D462D'
  2. [11:32:01][D][text_sensor:067]: 'ble_gateway_devices': Sending state 'C37F254D462D'
  3. [11:32:01][D][ble_gateway:079]: set_devices: (3C37F254D462D)
复制代码
重新载入后就可以看到有新发现的设备添加进去了
  1. [11:40:31][C][ble_gateway:055]: BLE Gateway: Discovery NO, 1 device(s) configured:
  2. [11:40:31][C][ble_gateway:057]:   MAC address: C3:7F:25:4D:46:2D
复制代码
HA上原来是有好几个已发现的实体的,我认为ESP32应该是自动同步已发现实体的MAC地址,但是现在的情况是自动同步新发现的MAC(也不是不可以接受),已发现但未连接到HA的设备不会同步到ESP32,最难受的是HA重启之后,ESP32里的MAC就清空了,HA要重新连接蓝牙设备,才能再次下发MAC到ESP32。
如果楼主使用没问题的话,我这不知道是哪里出了问题,还需要在研究一下,或者等C3的板子来了再试试看。






作者: shavn1984    时间: 2022-5-19 16:21
本帖最后由 shavn1984 于 2022-5-19 16:26 编辑
riceball 发表于 2022-5-19 06:30
你这个是ble_monitor的日志,不是esphome网关的日志, 如果要自动发现没有加密的设备,必须要在集成启用自 ...

[attach]37706[/attach]
感觉问题还是在ble moniotr集成上。我之前自动扫描加入过几个设备,小米电水壶、小米温湿度2刷了ATC固件、小米体脂秤2.  自从上次手动删除这些设备后就再也扫描不到了。尝试过升级ha,重新安装ble集成和降级版本,手动删除core.config_entries里的实体都不行。。而且每次我去掉"不适用蓝牙适配器"钩选项提交后,再次打开依然钩上了。现在不管是勾选不勾选都扫描不到设备,即用ha蓝牙适配器和esp32网关都不行,,ha ble debug日志就是之前发的。

ha版本2022.5.4    群晖nas docker版本
ble moniotr版本8.6.5

在群晖下可以使用这些命令,可以扫描设备
root@shavnnas:~# hcitool lescan
LE Scan ...
A4:C1:38:FF:37A (unknown)
00:09:B0:BB:1A:4A (unknown)
A4:C1:38:FF:37A ATC_FF37DA
^Croot@shavnnas:~# hcitool dev
Devices:
        hci0        00:19:86:00:3B:FC


看官方安装步骤,需要授权。但是不知道怎么弄,之前也没操作过这块就可以自动扫描设备Step 0. Grant permissions for Python to have rootless access to the HCI interface
This is usually only needed for alternative installations of Home Assistant that only install Home Assistant core. Also, for alternative installations, please note that BlueZ package must be installed on the system, but its bluetooth daemon service can be stopped and disabled, if you are sure of such a need.

input_boolean.settings_ble_gateway 实体也设置为"on"


以下是esphome log:

INFO Reading configuration /config/esphome-web-084270.yaml...WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.INFO Starting log output from esphome-web-084270.local using esphome APIINFO Successfully connected to esphome-web-084270.local[08:09:22][I][app:102]: ESPHome version 2022.4.0 compiled on May 17 2022, 12:15:25[08:09:22][C][wifi:491]: WiFi:[08:09:22][C][wifi:353]:   Local MAC: 84:0D:8E:08:42:70[08:09:22][C][wifi:354]:   SSID: 'shavn'[redacted][08:09:22][C][wifi:355]:   IP Address: 192.168.2.104[08:09:22][C][wifi:357]:   BSSID: F0:9F:C2:F4:B1:21[redacted][08:09:22][C][wifi:358]:   Hostname: 'esphome-web-084270'[08:09:22][C][wifi:360]:   Signal strength: -42 dB ▂▄▆█[08:09:22][C][wifi:364]:   Channel: 1[08:09:22][C][wifi:365]:   Subnet: 255.255.255.0[08:09:22][C][wifi:366]:   Gateway: 192.168.2.1[08:09:22][C][wifi:367]:   DNS1: 192.168.2.1[08:09:22][C][wifi:368]:   DNS2: 0.0.0.0[08:09:22][C][logger:233]: Logger:[08:09:22][C][logger:234]:   Level: DEBUG[08:09:22][C][logger:235]:   Log Baud Rate: 115200[08:09:22][C][logger:236]:   Hardware UART: UART0[08:09:22][C][ble_gateway:055]: BLE Gateway: Discovery NO, 0 device(s) configured:[08:09:22][C][esp32_ble_tracker:712]: BLE Tracker:[08:09:22][C][esp32_ble_tracker:713]:   Scan Duration: 300 s[08:09:22][C][esp32_ble_tracker:714]:   Scan Interval: 320.0 ms[08:09:22][C][esp32_ble_tracker:715]:   Scan Window: 30.0 ms[08:09:22][C][esp32_ble_tracker:716]:   Scan Type: ACTIVE[08:09:22][C][web_server:129]: Web Server:[08:09:22][C][web_server:130]:   Address: esphome-web-084270.local:80[08:09:22][C][mdns:084]: mDNS:[08:09:22][C][mdns:085]:   Hostname: esphome-web-084270[08:09:22][C][ota:085]: Over-The-Air Updates:[08:09:23][C][ota:086]:   Address: esphome-web-084270.local:3232[08:09:23][C][ota:089]:   Using Password.[08:09:23][C][api:138]: API Server:[08:09:23][C][api:139]:   Address: esphome-web-084270.local:6053[08:09:23][C][api:143]:   Using noise encryption: NO[08:09:23][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'ble_gateway_devices'[08:09:23][C][homeassistant.text_sensor:024]:   Entity ID: 'binary_sensor.ble_gateway'[08:09:23][C][homeassistant.text_sensor:026]:   Attribute: 'devices'




[td]
Time
level
Tag
Message
16:10:42[D][esp32_ble_tracker:217]Starting scan...
16:10:42[D][esp32_ble_tracker:726]Found device 00:E3:5F:3A:06:08 RSSI=-40
16:10:42[D][esp32_ble_tracker:747]  Address Type: RANDOM
16:10:45[D][esp32_ble_tracker:726]Found device 72:C4:9D:A6:22:1C RSSI=-67
16:10:45[D][esp32_ble_tracker:747]  Address Type: RANDOM
16:10:45[D][esp32_ble_tracker:751]  TX Power: 2
16:10:46[D][esp32_ble_tracker:726]Found device EC:4D:3E:868:6C RSSI=-61
16:10:46[D][esp32_ble_tracker:747]  Address Type: PUBLIC
16:11:13[D][esp32_ble_tracker:726]Found device 72:8D:B5:5B:1D:4D RSSI=-73
16:11:13[D][esp32_ble_tracker:747]  Address Type: RANDOM
16:11:13[D][esp32_ble_tracker:751]  TX Power: 2
16:11:33[D][esp32_ble_tracker:726]Found device B8:7C:6F:32:95F RSSI=-90
16:11:33[D][esp32_ble_tracker:747]  Address Type: PUBLIC
16:11:33[D][esp32_ble_tracker:749]  Name: 'MiKettle'
看日志esp32网关应该是扫描到设备了

Don't use Bluetooth adapter
th adapterDon't use Bluetooth adapterDDon't use Bluetooth adapteron't use Bluetooth adapter


作者: riceball    时间: 2022-5-19 18:02
本帖最后由 riceball 于 2022-5-19 18:11 编辑
shavn1984 发表于 2022-5-19 16:21
感觉问题还是在ble moniotr集成上。我之前自动扫描加入过几个设备,小米电水壶、小米温湿度2刷了ATC固件 ...

很明显  HA主机上没有找到蓝牙适配器, 也可能是实体硬件没有传递到 docker 中.

我也是 [email protected] 今天升级的, 刚看了看蓝牙设备正常上报数据.

看上去是像ble_monitor没有激活

作者: shavn1984    时间: 2022-5-19 20:08
riceball 发表于 2022-5-19 18:02
很明显  HA主机上没有找到蓝牙适配器, 也可能是实体硬件没有传递到 docker 中.

我也是 [email protected] 今天 ...

这还需要激活? 删除重装集成也没用,是不是有哪里没删干净?
作者: riceball    时间: 2022-5-19 20:37
shavn1984 发表于 2022-5-19 20:08
这还需要激活? 删除重装集成也没用,是不是有哪里没删干净?

我的意思是HA上找不到蓝牙适配器硬件, 所以 bt_interface 是 disable 的(没激活的)

你是在 docker 容器里执行的 hcitool ,还是在主机上执行的?

另外如果只用 ESPHome 蓝牙网关(主机上没有蓝牙适配器), 那就要手动在ble_monitor上添加设备,没法自动发现的.
我看你ble_monitor上一个已知的设备都没有.
作者: shavn1984    时间: 2022-5-19 21:16
本帖最后由 shavn1984 于 2022-5-20 00:11 编辑
riceball 发表于 2022-5-19 20:37
我的意思是HA上找不到蓝牙适配器硬件, 所以 bt_interface 是 disable 的(没激活的)

你是在 docker 容器 ...

是在主机和容器都能执行。
容器里是不是要授权?但是我进入容器输入官方那两条命令是错误的命令,应该怎么用?
作者: shavn1984    时间: 2022-5-20 02:45
我删除ui集成,用yaml模式配置hci0,可以扫描到usb蓝牙适配器下的设备了。
ble_monitor:
  hci_interface:
    - 0
  bt_auto_restart: True
  discovery: True
  devices:
    - mac: 'E8:FE:8B:ED:4F:09'
      name: 'b1-miscale'
    - mac: 'A4:C1:38:FF:37A'
      name: 'b1-temp'
    - mac: 'B8:7C:6F:32:95F'
      name: '4F-ketter'

但是esphome网关还不行,两者可以共存吗?还是只能用一种方式?
作者: riceball    时间: 2022-5-20 08:38
shavn1984 发表于 2022-5-20 02:45
我删除ui集成,用yaml模式配置hci0,可以扫描到usb蓝牙适配器下的设备了。
ble_monitor:
  hci_interface:

1. esphome网关如何不行?  detail
2. 可以共存.

作者: riceball    时间: 2022-5-20 08:40
nucleic_acid 发表于 2022-5-19 12:10
刚才看了你之前的帖子

使用Passive BLE Monitor集成代替蓝牙网关直接接入HA

`重启后恢复状态` 如果没有勾选,那么重启后在没有收到广播前,设备状态为 `Unavailable`.

作者: shavn1984    时间: 2022-5-20 12:46
本帖最后由 shavn1984 于 2022-5-20 12:57 编辑
riceball 发表于 2022-5-20 08:40
`重启后恢复状态` 如果没有勾选,那么重启后在没有收到广播前,设备状态为 `Unavailable`.
...

esp32编译烧录正常,启动后有扫描到设备日志。ha没有自动扫描添加实体
配置如下
esphome:
  1. substitutions:
  2.   # Name the device and it's entities
  3.   device: ble_gateway
  4.   device_name: ble_gateway4

  5. esphome:
  6.   name: esphome-web-084270
  7.   comment: $device
  8.   platformio_options:
  9.     board_build.flash_mode: dio

  10. esp32:
  11.   board: nodemcu-32s
  12.   framework:
  13.     type: arduino
  14.     version: 2.0.2
  15.     platform_version: https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip
  16.    
  17. external_components:
  18.   - source: github://myhomeiot/esphome-components


  19. esp32_ble_tracker:

  20. # Enable logging
  21. logger:

  22. web_server:
  23.   port: 80
  24. # Enable Home Assistant API
  25. api:
  26.   reboot_timeout: 1h

  27. ota:
  28.   password: "wxb1984626**"

  29. wifi:
  30.   ssid: "XXX"
  31.   password: "XXX"
  32. #  manual_ip:
  33. #    static_ip: "192.168.2.41"
  34. #    gateway: "192.168.2.1"
  35. #    subnet: "255.255.255.0"
  36. #    dns1: "192.168.2.1"
  37.   # Enable fallback hotspot in case wifi connection fails
  38.   ap:
  39.     ssid: "4fblegateway"
  40.     password: "XXX"

  41. ble_gateway:
  42.   id: $device_name
  43. #  devices:
  44. #     - mac_address: B8:7C:6F:32:95:DF
  45.   #   - mac_address: !secret lywsd03mmc_mac
  46.   on_ble_advertise:
  47.     then:
  48.       - homeassistant.service:
  49.           service: ble_monitor.parse_data
  50.           data:
  51.             packet: !lambda return packet;
  52.             gateway_id: $device_name
  53.       - homeassistant.event:
  54.           event: esphome.on_ble_advertise
  55.           data:
  56.             packet: !lambda return packet;

  57. text_sensor:
  58.   - platform: homeassistant
  59.     id: ble_gateway_devices
  60.     entity_id: binary_sensor.ble_gateway
  61.     attribute: devices
  62.     on_value:
  63.       then:
  64.         lambda: id($device_name).set_devices(x);

复制代码
ha configuration.yaml:
  1. 配置相同
复制代码
ha automations.yaml
  1. - id: '1652780647472'
  2.   alias: HA Start automation
  3.   trigger:
  4.     platform: homeassistant
  5.     event: start
  6.   action:
  7.     service: input_boolean.turn_on
  8.     entity_id: input_boolean.ha_started
  9.   initial_state: true
复制代码



作者: riceball    时间: 2022-5-20 19:19
shavn1984 发表于 2022-5-20 12:46
esp32编译烧录正常,启动后有扫描到设备日志。ha没有自动扫描添加实体
配置如下
esphome:

你没注意看我给你的回复, `重启后恢复状态` 是我回复别人的.

esphome 网关不会发现添加设备, 你必须手动在ble_monitor集成中添加.
自动发现添加只能在ble_monitor集成上的蓝牙适配器上完成.
作者: shavn1984    时间: 2022-5-20 21:17
riceball 发表于 2022-5-20 19:19
你没注意看我给你的回复, `重启后恢复状态` 是我回复别人的.

esphome 网关不会发现添加设备, 你必须手动 ...

我用了官方的配置,自动发现也可以了,感谢回复
作者: ljw    时间: 2022-5-21 14:17
本帖最后由 ljw 于 2022-5-21 14:19 编辑

我想问下,你们使用 ble monitor 会不会不稳定,偶尔会有这条日志
HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
我在容器使用 hciconfig 是能发现 hci0 是 running 的  

使用是正常的,就是偶尔传感器的数据读不了。。

对于温湿度是没多大影响,但对于门窗传感器就影响大了,一次没更新自动化都触发不了了。。


作者: riceball    时间: 2022-5-21 15:12
shavn1984 发表于 2022-5-20 21:17
我用了官方的配置,自动发现也可以了,感谢回复

看到了一周前才加的新功能, 已更新.
作者: riceball    时间: 2022-5-21 15:17
ljw 发表于 2022-5-21 14:17
我想问下,你们使用 ble monitor 会不会不稳定,偶尔会有这条日志
HCIdump thread: Something wrong - inte ...

没有出现过这个问题, 看看是docker的问题,还是蓝牙适配器硬件的瓶颈: 无法持续扫描

ESP32就存在这样的硬件的瓶颈,因为它与WIFI是共用通道,所以只能分时间片处理.可以调校scan_parameters,但是如果蓝牙占用太多的时间,那么WIFI就会出问题.

最好的办法是ESP32只开蓝牙,另外加ESP8266芯片单独处理WIFI



作者: ljw    时间: 2022-5-21 22:23
riceball 发表于 2022-5-21 15:17
没有出现过这个问题, 看看是docker的问题,还是蓝牙适配器硬件的瓶颈: 无法持续扫描

ESP32就存在这样的硬 ...

我的是树莓派3b,可能也会有这样的问题了
作者: TwoOne    时间: 2022-5-27 14:07
这个可以添加小米筒灯等蓝牙mesh的设备嘛?
作者: 怪物json    时间: 2022-6-19 10:55
烧录时报错了,请教下是什么问题

  1. INFO Reading configuration /config/bluetooth-gateway.yaml...
  2. WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
  3. WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
  4. INFO Generating C++ source...
  5. INFO Compiling app...
  6. Processing blegateway1 (board: esp32dev; framework: arduino; platform: https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip)
  7. --------------------------------------------------------------------------------
  8. FILESYSTEM  spiffs
  9. HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
  10. - tool-mklittlefs 1.203.210628 (2.3)
  11. - tool-mkspiffs 2.230.0 (2.30)
  12. - toolchain-xtensa-esp32 8.4.0+2021r2-patch2
  13. Dependency Graph
  14. |-- <AsyncTCP-esphome> 1.2.2
  15. |-- <WiFi> 2.0.0
  16. |-- <FS> 2.0.0
  17. |-- <Update> 2.0.0
  18. |-- <ESPAsyncWebServer-esphome> 2.1.0
  19. |   |-- <AsyncTCP-esphome> 1.2.2
  20. |-- <DNSServer> 2.0.0
  21. |-- <ESPmDNS> 2.0.0
  22. Compiling .pioenvs/blegateway1/src/esphome/components/ble_gateway/ble_gateway.cpp.o
  23. Compiling .pioenvs/blegateway1/src/esphome/components/esp32/gpio_idf.cpp.o
  24. Compiling .pioenvs/blegateway1/src/esphome/components/esp32/preferences.cpp.o
  25. Compiling .pioenvs/blegateway1/src/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp.o
  26. Compiling .pioenvs/blegateway1/src/esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp.o
  27. src/esphome/components/ble_gateway/ble_gateway.cpp: In member function 'virtual bool esphome::ble_gateway::BLEGateway::parse_device(const esphome::esp32_ble_tracker::ESPBTDevice&)':
  28. src/esphome/components/ble_gateway/ble_gateway.cpp:62:56: error: 'const class esphome::esp32_ble_tracker::ESPBTDevice' has no member named 'get_scan_result'
  29.      auto packet = scan_result_to_hci_packet_hex(device.get_scan_result());
  30.                                                         ^~~~~~~~~~~~~~~
  31. *** [.pioenvs/blegateway1/src/esphome/components/ble_gateway/ble_gateway.cpp.o] Error 1
  32. ========================= [FAILED] Took 10.87 seconds =========================
复制代码

作者: riceball    时间: 2022-6-19 21:22
怪物json 发表于 2022-6-19 10:55
烧录时报错了,请教下是什么问题

该配置文件是仅限 ESP32-C3 主板, 如果是ESP32主板 要修改: 移除所有的特有的配置,
作者: lensam    时间: 2022-6-25 23:25
必须收藏
作者: hb2501877    时间: 2022-6-29 08:49
要先安装好ble_monitor,再进行configuration.yaml配置,否则会装不上
作者: kkkkllll08    时间: 2022-7-3 23:43
本帖最后由 kkkkllll08 于 2022-7-3 23:47 编辑

想问一下 esp32已经接入Hass了  但是Hass主机没有蓝牙也没有蓝牙适配器的,怎么将温湿度计通过esp32接入,温湿度计已经刷了ATC固件,esp32也能扫到它的mac,但是Hass发现不了温湿度计
作者: riceball    时间: 2022-7-4 13:04
kkkkllll08 发表于 2022-7-3 23:43
想问一下 esp32已经接入Hass了  但是Hass主机没有蓝牙也没有蓝牙适配器的,怎么将温湿度计通过esp32接入, ...

看文档仔细些:     "配置好蓝牙网关后, 如果要添加新的蓝牙设备请在Passive BLE Monitor 集成上添加."
作者: woshisuyongbo    时间: 2022-7-4 23:34
你好,这个能在windows下刷入吗?楼主能给个视频教程吗
作者: kkkkllll08    时间: 2022-7-5 21:05
riceball 发表于 2022-5-21 15:17
没有出现过这个问题, 看看是docker的问题,还是蓝牙适配器硬件的瓶颈: 无法持续扫描

ESP32就存在这样的硬 ...

连接wifi困难,是否有建议的scan_parameters参数值
作者: riceball    时间: 2022-7-6 14:43
kkkkllll08 发表于 2022-7-5 21:05
连接wifi困难,是否有建议的scan_parameters参数值

如果你使用默认值,那么就不应该存在问题.
作者: hackyjso    时间: 2022-7-7 12:40
我也是这个那个 ESP32 C3 板子,为什么不能联网呢,

就 arduino 不行,可是esp-idf平台就可以

INFO Reading configuration /config/esphome/lany.yaml...
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Starting log output from blegateway1.local using esphome API
WARNING Can't connect to ESPHome API for blegateway1.local: Error resolving IP address: [Errno -5] No address associated with hostname
INFO Trying to reconnect to blegateway1.local in the background
作者: leonarddo    时间: 2022-7-10 02:17
刚想问没有设备,复制log的时候发现有上传packet。弄好以后要等一段时间,而且等的时间还挺长,十分钟的样子。。。
作者: leonarddo    时间: 2022-7-10 04:08
楼主你好,我后面又添加了几个设备,esphome的log里能看到有发packet,但是等了很久都没显示,能请教一下问题在哪吗。[attach]39219[/attach][attach]39220[/attach]
作者: demon3434    时间: 2022-7-15 15:59
感谢分享
作者: hackyjso    时间: 2022-7-18 22:57
我用合宙的 c3开发版 直接复制这个配置文件,刷上后没法启动,板子根本不联网,但是把蓝牙代码注释掉就好了
作者: zhaidoudou123    时间: 2022-7-26 22:55
楼主你好,请问后面如果再买第二块板子,需要修改ha里面的相应实体以区分吗?
作者: riceball    时间: 2022-8-8 12:57
zhaidoudou123 发表于 2022-7-26 22:55
楼主你好,请问后面如果再买第二块板子,需要修改ha里面的相应实体以区分吗? ...

是的需要修改设备名称
作者: penguinmm    时间: 2022-8-19 22:53
请问下:“最后,记得设置input_boolean.settings_ble_gateway为"on",启用蓝牙网关功能.
                设置input_boolean.settings_ble_gateway_discovery为"on",启用自动发现功能.”
这两项在哪里设置,一直没找到
谢谢!
作者: mmygo    时间: 2022-8-26 17:09
能通过HOMEASSISTANT 中ESPHOME集成来刷机吗?
没有LINUX环境
作者: mmygo    时间: 2022-8-27 22:21
我是用windows python 刷的一直无法连接WIFI,看LOGS提示是WIFI验证不过,连接了它的热点获取IP 192.168.4.100,也无法登录它的配置页,另外一个ESP32很顺利就配制好了
作者: dy008    时间: 2022-8-31 11:27
好主意,谢谢
作者: wodepiqi    时间: 2022-9-19 23:06
大神,这个又办法解决吗。乐鑫c3 mini
作者: tangyali    时间: 2022-9-27 11:06
太棒了,马上esp32C3就到了,到时立马刷一个试试,家里的yeelight蓝牙开关应该有信号了
作者: hatonas    时间: 2022-9-30 09:53
合宙板子esp32c3,加上蓝牙esp32_ble_tracker,WiFi就连不上了。删掉就可以。有遇到过吗
作者: win741852    时间: 2022-11-8 12:23
本帖最后由 win741852 于 2022-11-8 14:01 编辑
hatonas 发表于 2022-9-30 09:53
合宙板子esp32c3,加上蓝牙esp32_ble_tracker,WiFi就连不上了。删掉就可以。有遇到过吗 ...

我也是这个情况 用的是ESP-C3-13U-KIT 已经确定不是路由器的问题

最新测试结果,我刚添加了手动配置网络,如下
刷进去立马就连上网了,折腾了两天终于是找到解决方案了。。。

wifi:  ssid: MyHomeNetwork  password: VerySafePassword  # Optional manual IP  manual_ip:    static_ip: 192.168.0.123    gateway: 192.168.0.1    subnet: 255.255.255.0

作者: bainiu    时间: 2022-11-8 14:59
本帖最后由 bainiu 于 2022-11-8 15:01 编辑

不是很懂,但很想知道这个自制esp32蓝牙中继,除了接入蓝牙传感器,请问能不能做到以下两点:
1、接入小米情景蓝牙mesh开关并控制。
2、接入小米智能门锁(蓝牙),读取门锁状态。如果能,我的小米多模网关可以拆了,现在这个网关下面只挂了几个蓝牙温度计和人体传感器、几个蓝牙mesh开关、门锁。zigbee设备全走z2m了。


作者: msavi    时间: 2022-11-10 18:19
刷了这个固件,esp32只能当蓝牙网关使用了吗?可以通过wifi连接hass吗?
作者: msavi    时间: 2022-11-11 14:45
shavn1984 发表于 2022-5-15 15:39
ble_gateway:
  id: $device_name  这行报错

遇到同样的问题,你解决了吗?
作者: hatonas    时间: 2022-11-14 15:06
win741852 发表于 2022-11-8 12:23
我也是这个情况 用的是ESP-C3-13U-KIT 已经确定不是路由器的问题

最新测试结果,我刚添加了手动配置网络 ...

谢谢,看来是要手动配置的,我挂了一晚上,也连上了。连接速度只能说很慢很慢
作者: win741852    时间: 2022-11-15 11:40
hatonas 发表于 2022-11-14 15:06
谢谢,看来是要手动配置的,我挂了一晚上,也连上了。连接速度只能说很慢很慢 ...

如果有IPEX接口的话,可以考虑加个IPEX天线。
我手边有个NUC盒预留了wifi天线,试着把板子接上去以后信号一下变强了,连的速度也快了
作者: bainiu    时间: 2022-11-24 11:05
请教楼主:我买的是普通的esp32,修改了相关模块代码,其他完全是按楼主的代码编译通过并刷进固件。
1、blegateway1网关可发现并在hass里提交配置,看到一个实体,但是显示不可用(灰色)
2、在hass前端配置yaml开关和hacs下载的Passive BLE Monitor 集成重启并提交,
3、前端开关已打开,
4、在esphome能看到blegateway1网关log里跑蓝色代码,显示能看到我家小米系列蓝牙设备,温度计、青萍人体、小米人体
所有操作都按楼主的流程进行,但就是在Passive BLE Monitor 集成配置里不能发现设备。不知道是什么原因?
[attach]43623[/attach]

作者: justion    时间: 2022-11-24 11:25
楼主你好,我使用了你的代码成功刷入了,也接入了ha,并且小米门磁和温湿度计检测都没有问题,但是到了设备track就出现问题了,我要检测手机和手表的蓝牙作为判断是否在家,但是没用,状态一直都没有变化,不知道是什么情况,麻烦帮我看一下esphome的代码以及esphome的日志吧,谢谢了。
  1. substitutions:
  2.   # Name the device and it's entities
  3.   device: ble_gateway
  4.   device_name: blegateway1

  5. esphome:
  6.   name: $device_name
  7.   comment: $device
  8.   platformio_options:
  9.     board_build.flash_mode: dio

  10. esp32:
  11.   board: esp32-c3-devkitm-1
  12.   variant: esp32c3
  13.   framework:
  14.     type: arduino
  15.     version: 2.0.2
  16.     platform_version: https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip

  17. external_components:
  18.   - source: github://myhomeiot/esphome-components

  19. esp32_ble_tracker:
  20.   scan_parameters:
  21.    interval: 120ms
  22.    window: 100ms
  23. # Enable logging
  24. logger:

  25. # Enable Home Assistant API
  26. api:
  27.   reboot_timeout: 1h

  28. ota:
  29.   password: !secret ota_password

  30. wifi:
  31.   ssid: !secret wifi_ssid
  32.   password: !secret wifi_password
  33.   fast_connect: on
  34.   reboot_timeout: 23min
  35.   manual_ip:   
  36.     static_ip: 192.168.1.118   
  37.     gateway: 192.168.1.1   
  38.     subnet: 255.255.255.0

  39.   # Enable fallback hotspot in case wifi connection fails
  40.   ap:
  41.     ssid: "$device_name Fallback Hotspot"
  42.     password: !secret ap_password

  43. ble_gateway:
  44.   id: $device_name
  45.   # devices:
  46.   #   - mac_address: 01:23:45:67:89:AB
  47.   #   - mac_address: !secret lywsd03mmc_mac
  48.   on_ble_advertise:
  49.     then:
  50.       - homeassistant.service:
  51.           service: ble_monitor.parse_data
  52.           data:
  53.             packet: !lambda return packet;
  54.             gateway_id: $device_name
  55.       - homeassistant.event:
  56.           event: esphome.on_ble_advertise
  57.           data:
  58.             packet: !lambda return packet;

  59. binary_sensor:
  60.   - platform: homeassistant
  61.     id: ble_gateway_discovery
  62.     entity_id: binary_sensor.ble_gateway
  63.     attribute: discovery
  64.     on_state:
  65.       then:
  66.         lambda: id($device_name).set_discovery(x);
  67. - platform: ble_presence
  68. id: S21Ultra
  69. mac_address: C8:BD:69:D5:87:46
  70. name: "S21 Ultra(BT)"
  71. - platform: ble_presence
  72. id: GalaxyWatch4
  73. mac_address: 60:3A:AF:E1:20:40
  74. name: "Galaxy Watch4 Classic (4LQJ)"

  75. text_sensor:
  76.   - platform: homeassistant
  77.     id: ble_gateway_devices
  78.     entity_id: binary_sensor.ble_gateway
  79.     attribute: devices
  80.     on_value:
  81.       then:
  82.         lambda: id($device_name).set_devices(x);
  83.   # IP address of device. Not really needed for HA (as HA already knows it), but for showing on the display during startup. The startup screen will leave on if no instance connects to the API.
  84.   - platform: wifi_info
  85.     ip_address:
  86.       name: $device_name IP address
  87.       id: ip_address
  88.   # ESPHome version used to compile the app
  89.   - platform: version
  90.     name: $device_name ESPHome Version

  91. sensor:
  92.   # WiFi signals strength sensor
  93.   - platform: wifi_signal
  94.     name: $device_name WiFi Signal Sensor
  95.     update_interval: 60s
复制代码

  1. INFO Reading configuration /config/esphome/blegateway.yaml...
  2. WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
  3. WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
  4. INFO Starting log output from 192.168.1.118 using esphome API
  5. INFO Successfully connected to 192.168.1.118
  6. [09:51:56][I][app:102]: ESPHome version 2022.11.2 compiled on Nov 24 2022, 00:39:09
  7. [09:51:56][C][wifi:504]: WiFi:
  8. [09:51:56][C][wifi:362]:   Local MAC: 60:55:F9:74:3C:34
  9. [09:51:56][C][wifi:363]:   SSID: 'OpenWrt'[redacted]
  10. [09:51:56][C][wifi:364]:   IP Address: 192.168.1.118
  11. [09:51:56][C][wifi:366]:   BSSID: 10:44:00:48:26:28[redacted]
  12. [09:51:56][C][wifi:367]:   Hostname: 'blegateway1'
  13. [09:51:56][C][wifi:369]:   Signal strength: -24 dB ▂▄▆█
  14. [09:51:56][C][wifi:373]:   Channel: 6
  15. [09:51:56][C][wifi:374]:   Subnet: 255.255.255.0
  16. [09:51:56][C][wifi:375]:   Gateway: 192.168.1.1
  17. [09:51:56][C][wifi:376]:   DNS1: 0.0.0.0
  18. [09:51:56][C][wifi:377]:   DNS2: 0.0.0.0
  19. [09:51:56][C][logger:293]: Logger:
  20. [09:51:56][C][logger:294]:   Level: DEBUG
  21. [09:51:56][C][logger:295]:   Log Baud Rate: 115200
  22. [09:51:56][C][logger:296]:   Hardware UART: UART0
  23. [09:51:56][C][ble_gateway:055]: BLE Gateway: Discovery NO, 2 device(s) configured:
  24. [09:51:56][C][ble_gateway:057]:   MAC address: A4:C1:38:EC:AA:60
  25. [09:51:56][C][ble_gateway:057]:   MAC address: E4:AA:EC:5F:71:E5
  26. [09:51:56][C][ble_presence:011]: BLE Presence 'S21 Ultra(BT)'
  27. [09:51:56][C][ble_presence:011]: BLE Presence 'Galaxy Watch4 Classic (4LQJ)'
  28. [09:51:56][C][version.text_sensor:021]: Version Text Sensor 'blegateway1 ESPHome Version'
  29. [09:51:56][C][version.text_sensor:021]:   Icon: 'mdi:new-box'
  30. [09:51:56][C][esp32_ble_tracker:796]: BLE Tracker:
  31. [09:51:56][C][esp32_ble_tracker:797]:   Scan Duration: 300 s
  32. [09:51:56][C][esp32_ble_tracker:798]:   Scan Interval: 120.0 ms
  33. [09:51:56][C][esp32_ble_tracker:799]:   Scan Window: 100.0 ms
  34. [09:51:56][C][esp32_ble_tracker:800]:   Scan Type: ACTIVE
  35. [09:51:56][C][esp32_ble_tracker:801]:   Continuous Scanning: True
  36. [09:51:56][C][mdns:103]: mDNS:
  37. [09:51:56][C][mdns:104]:   Hostname: blegateway1
  38. [09:51:56][C][ota:093]: Over-The-Air Updates:
  39. [09:51:56][C][ota:094]:   Address: 192.168.1.118:3232
  40. [09:51:56][C][ota:097]:   Using Password.
  41. [09:51:56][C][api:138]: API Server:
  42. [09:51:56][C][api:139]:   Address: 192.168.1.118:6053
  43. [09:51:56][C][api:143]:   Using noise encryption: NO
  44. [09:51:56][C][homeassistant.binary_sensor:039]: Homeassistant Binary Sensor 'ble_gateway_discovery'
  45. [09:51:56][C][homeassistant.binary_sensor:040]:   Entity ID: 'binary_sensor.ble_gateway'
  46. [09:51:56][C][homeassistant.binary_sensor:042]:   Attribute: 'discovery'
  47. [09:51:56][C][wifi_info:009]: WifiInfo IPAddress 'blegateway1 IP address'
  48. [09:51:56][C][wifi_signal.sensor:009]: WiFi Signal 'blegateway1 WiFi Signal Sensor'
  49. [09:51:56][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
  50. [09:51:56][C][wifi_signal.sensor:009]:   State Class: 'measurement'
  51. [09:51:56][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
  52. [09:51:56][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
  53. [09:51:56][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'ble_gateway_devices'
  54. [09:51:56][C][homeassistant.text_sensor:024]:   Entity ID: 'binary_sensor.ble_gateway'
  55. [09:51:56][C][homeassistant.text_sensor:026]:   Attribute: 'devices'
  56. [09:51:57][D][ble_gateway:063]: [A4:C1:38:EC:AA:60] Packet 043E2B0201000060AAEC38C1A41F12161A1860AAEC38C1A40C08CC1AE60A41F60F0B094154435F454341413630CB
  57. [09:52:07][D][ble_gateway:063]: [A4:C1:38:EC:AA:60] Packet 043E2B0201000060AAEC38C1A41F12161A1860AAEC38C1A40C08CC1AE60A41F60F0B094154435F454341413630CB
  58. [09:52:12][D][ble_gateway:063]: [A4:C1:38:EC:AA:60] Packet 043E2B0201000060AAEC38C1A41F12161A1860AAEC38C1A40C08CD1AEA0A42F70F0B094154435F454341413630CB
  59. [09:52:16][D][sensor:127]: 'blegateway1 WiFi Signal Sensor': Sending state -23.00000 dBm with 0 decimals of accuracy
  60. [09:52:17][D][ble_gateway:063]: [A4:C1:38:EC:AA:60] Packet 043E2B0201000060AAEC38C1A41F12161A1860AAEC38C1A40C08CD1AEA0A42F70F0B094154435F454341413630CB
  61. [09:52:19][D][esp32_ble_tracker:812]: Found device F1:4D:CF:5E:3E:F1 RSSI=-95
  62. [09:52:19][D][esp32_ble_tracker:833]:   Address Type: RANDOM
  63. [09:52:27][D][ble_gateway:063]: [A4:C1:38:EC:AA:60] Packet 043E2B0201000060AAEC38C1A41F12161A1860AAEC38C1A40C08CD1AEA0A42F70F0B094154435F454341413630CD
  64. [09:52:32][D][ble_gateway:063]: [A4:C1:38:EC:AA:60] Packet 043E2B0201000060AAEC38C1A41F12161A1860AAEC38C1A40B08CD1AE30A41F80F0B094154435F454341413630CE
复制代码




作者: justion    时间: 2022-11-24 11:27
justion 发表于 2022-11-24 11:25
楼主你好,我使用了你的代码成功刷入了,也接入了ha,并且小米门磁和温湿度计检测都没有问题,但是到了设备 ...

刚刚这个日志里BLE Gateway: Discovery NO,这个地方我变成yes也试过了,也不行
作者: hatonas    时间: 2022-12-7 19:58
win741852 发表于 2022-11-8 12:23
我也是这个情况 用的是ESP-C3-13U-KIT 已经确定不是路由器的问题

最新测试结果,我刚添加了手动配置网络 ...

我试了手动配置网络,还是不行,能秒联网,能ping通,但是6053的端口打不开了。log提示Can't connect to ESPHome API
作者: [email protected]    时间: 2023-1-3 07:20
请教,配置configuration.yaml后,出现了错误:
Integration error:   - - Integration '  -' not found.
Integration error:   settings_ble_gateway_add_device - Integration '  settings_ble_gateway_add_device' not found.
Integration error:   settings_ble_gateway_discovery - Integration '  settings_ble_gateway_discovery' not found.
Integration error:   settings_ble_gateway - Integration '  settings_ble_gateway' not found.

这是passive ble monitor 这个集成,版本导致的么?当前安装的版本是11.2.0
作者: fonzon    时间: 2023-2-17 10:16
hackyjso 发表于 2022-7-7 12:40
我也是这个那个 ESP32 C3 板子,为什么不能联网呢,

就 arduino 不行,可是esp-idf平台就可以

我也是这样情况
作者: spaceman    时间: 2023-4-1 13:04
本帖最后由 spaceman 于 2023-4-1 13:26 编辑

12.9元的合宙 ESP32C3 经典版按楼主的配置刷,wifi连不上,按76楼介绍手动配置ip地址,重新编辑固件还是连不上。郁闷了,找不到原因。
删除蓝牙相关配置,用idf刷可以连上wifi, 但是不知道怎样在idf模式下做蓝牙网关。

作者: magpte    时间: 2023-4-13 09:25
改了这个之后,终于wifi稳定了,之前基本不能成功的。。。。。因为ble和wifi同时进行

  1. esphome:
  2.   name: esp32c3
  3.   friendly_name: esp32C3
  4.   on_boot:
  5.     priority: 250
  6.     then:
  7.       - delay: 15s
  8.       - lambda: |-
  9.           id(ble_tracker).set_scan_continuous(true);
  10.           id(ble_tracker).start_scan();
复制代码


作者: czjys    时间: 2023-4-17 10:40
准备购入1个来照葫芦画瓢,谢谢大佬分享
作者: guofanboy    时间: 2023-4-30 00:01
请问支持两个esp32当网关么?
作者: zhenshui5    时间: 2023-5-8 17:25
牛的。学习学习
作者: Awe7    时间: 2024-2-2 20:04
UnknownPackageError: Could not find the package with 'espressif/toolchain-riscv32-esp @ 8.4.0+2021r2-patch2' requirements for your system 'linux_x86_64'



esp12.9 提示这个0.0
作者: Awe7    时间: 2024-2-2 20:06
Awe7 发表于 2024-2-2 20:04
UnknownPackageError: Could not find the package with 'espressif/toolchain-riscv32-esp @ 8.4.0+2021r2 ...

INFO ESPHome 2023.12.9
INFO Reading configuration /config/esphome/esp32c3ble.yaml...
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source...
INFO Compiling app...
Processing blegateway1 (board: esp32-c3-devkitm-1; framework: arduino; platform: https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip)
--------------------------------------------------------------------------------
Tool Manager: Installing espressif/toolchain-riscv32-esp @ 8.4.0+2021r2-patch2
INFO Installing espressif/toolchain-riscv32-esp @ 8.4.0+2021r2-patch2
UnknownPackageError: Could not find the package with 'espressif/toolchain-riscv32-esp @ 8.4.0+2021r2-patch2' requirements for your system 'linux_x86_64'
作者: Awe7    时间: 2024-2-2 20:29
Awe7 发表于 2024-2-2 20:06
INFO ESPHome 2023.12.9
INFO Reading configuration /config/esphome/esp32c3ble.yaml...
WARNING The s ...

换大大的提示配置
substitutions:
  # Name the device and it's entities
  device: ble_gateway
  device_name: blegateway3

esphome:
  name: $device_name
  comment: $device
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-c3-devkitm-1
  variant: ESP32C3
  framework:
    type: esp-idf

已经烧录好了,三个实体
作者: Hermit    时间: 2024-2-29 23:20
感谢楼主,正好要用
作者: sunjx888    时间: 2024-3-5 09:04
Awe7 发表于 2024-2-2 20:04
UnknownPackageError: Could not find the package with 'espressif/toolchain-riscv32-esp @ 8.4.0+2021r2 ...

espreeif的git链接更新了,18行的链接换成这个试试:https://github.com/tasmota/platf ... orm-espressif32.zip
作者: 2CMOL    时间: 2024-3-20 00:04
sunjx888 发表于 2024-3-5 09:04
espreeif的git链接更新了,18行的链接换成这个试试:https://github.com/tasmota/platform-espressif32/r ...

IDF 版本的在linux下会编译错误 目前判断是c++的原因

要这个版本才能正常编译
https://github.com/tasmota/platf ... orm-espressif32.zip
作者: Awe7    时间: 2024-3-20 00:09
本帖最后由 Awe7 于 2024-3-20 00:18 编辑

老哥,,,能贴一个网口c3(模块是单独c3模块,不是9.9的合宙开发板)的蓝牙网关配置吗?
ethernet的配置已经测试,可用接入ha。
但是把配置文件贴到c3wifi的yami文件编译  不成功(已删除wifi部分配置)
ethernet:
  type: W5500
  clk_pin: GPIO02
  mosi_pin: GPIO03
  miso_pin: GPIO10
  cs_pin: GPIO7
  clock_speed: 16Mhz  
ps最新的esphome测试版 已支持w5500

作者: rolay8    时间: 2024-5-15 23:02
大佬,请问下,日志扫描到设备了,但是ble monitor下面还是空的
15:01:08][C][wifi:416]:   IP Address: 10.0.0.63
[15:01:08][C][wifi:420]:   BSSID: 8C:53:C36:7A:8F
[15:01:08][C][wifi:421]:   Hostname: 'blegateway1'
[15:01:08][C][wifi:423]:   Signal strength: -56 dB ▂▄▆█
[15:01:08][C][wifi:427]:   Channel: 2
[15:01:08][C][wifi:428]:   Subnet: 255.255.255.0
[15:01:08][C][wifi:429]:   Gateway: 10.0.0.10
[15:01:08][C][wifi:430]:   DNS1: 10.0.0.10
[15:01:08][C][wifi:431]:   DNS2: 0.0.0.0
[15:01:08][C][logger:185]: Logger:
[15:01:08][C][logger:186]:   Level: DEBUG
[15:01:08][C][logger:188]:   Log Baud Rate: 115200
[15:01:08][C][logger:189]:   Hardware UART: USB_CDC
[15:01:08][C][ble_gateway:055]: BLE Gateway: Discovery YES, 0 device(s) configured:
[15:01:08][C][version.text_sensor:021]: Version Text Sensor 'blegateway1 ESPHome Version'
[15:01:08][C][version.text_sensor:021]:   Icon: 'mdi:new-box'
[15:01:08][C][esp32_ble:374]: ESP32 BLE:
[15:01:08][C][esp32_ble:376]:   MAC address: 9C:9E:6E:09:A3:BE
[15:01:08][C][esp32_ble:377]:   IO Capability: none
[15:01:08][C][esp32_ble_tracker:649]: BLE Tracker:
[15:01:08][C][esp32_ble_tracker:650]:   Scan Duration: 300 s
[15:01:08][C][esp32_ble_tracker:651]:   Scan Interval: 320.0 ms
[15:01:08][C][esp32_ble_tracker:652]:   Scan Window: 30.0 ms
[15:01:08][C][esp32_ble_tracker:653]:   Scan Type: ACTIVE
[15:01:08][C][esp32_ble_tracker:654]:   Continuous Scanning: True
[15:01:08][C][mdns:115]: mDNS:
[15:01:08][C][mdns:116]:   Hostname: blegateway1
[15:01:08][C][ota:096]: Over-The-Air Updates:
[15:01:08][C][ota:097]:   Address: blegateway1.local:3232
[15:01:08][C][ota:100]:   Using Password.
[15:01:08][C][ota:103]:   OTA version: 2.
[15:01:08][C][api:139]: API Server:
[15:01:08][C][api:140]:   Address: blegateway1.local:6053
[15:01:08][C][api:144]:   Using noise encryption: NO
[15:01:08][C][homeassistant.binary_sensor:039]: Homeassistant Binary Sensor 'ble_gateway_discovery'
[15:01:08][C][homeassistant.binary_sensor:040]:   Entity ID: 'binary_sensor.ble_gateway'
[15:01:08][C][homeassistant.binary_sensor:042]:   Attribute: 'discovery'
[15:01:08][C][wifi_info:009]: WifiInfo IPAddress 'blegateway1 IP address'
[15:01:08][C][wifi_signal.sensor:009]: WiFi Signal 'blegateway1 WiFi Signal Sensor'
[15:01:08][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[15:01:08][C][wifi_signal.sensor:009]:   State Class: 'measurement'
[15:01:08][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[15:01:08][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[15:01:08][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'ble_gateway_devices'
[15:01:08][C][homeassistant.text_sensor:024]:   Entity ID: 'binary_sensor.ble_gateway'
[15:01:08][C][homeassistant.text_sensor:026]:   Attribute: 'devices'
[15:01:09][D][ble_gateway:063]: [15:02:49:8B:1F:5F] Packet 043E2B020103015F1F8B4902151F1EFF06000109202242BA6ED7202F912CF208D0E53EA9B0BEDDF4235294F605ED
[15:01:12][D][ble_gateway:063]: [DC:ED:83:6E:CA:CD] Packet 043E2302010300CDCA6E83EDDC17162A4823FC14F59E072A79C5D3BE06264443A61C1565C6C2
[15:01:13][D][ble_gateway:063]: [40:2A:8F:4EE:13] Packet 043E2B0201000013DE4E8F2A401F0201060303B3FE0FFFA801C7583B6A970012DE4E8F2A400316000403095447C5
[15:01:13][D][ble_gateway:063]: [15:02:49:8B:1F:5F] Packet 043E2B020103015F1F8B4902151F1EFF06000109202242BA6ED7202F912CF208D0E53EA9B0BEDDF4235294F605EC
[15:01:17][D][ble_gateway:063]: [15:02:49:8B:1F:5F] Packet 043E2B020103015F1F8B4902151F1EFF06000109202242BA6ED7202F912CF208D0E53EA9B0BEDDF4235294F605EE
[15:01:18][D][ble_gateway:063]: [15:02:49:8B:1F:5F] Packet 043E2B020103015F1F8B4902151F1EFF06000109202242BA6ED7202F912CF208D0E53EA9B0BEDDF4235294F605ED
[15:01:18][D][ble_gateway:063]: [15:02:49:8B:1F:5F] Packet 043E2B020103015F1F8B4902151F1EFF06000109202242BA6ED7202F912CF208D0E53EA9B0BEDDF4235294F605EC
[15:01:18][D][ble_gateway:063]: [15:02:49:8B:1F:5F] Packet 043E2B020103015F1F8B4902151F1EFF06000109202242BA6ED7202F912CF208D0E53EA9B0BEDDF4235294F605EE
[15:01:20][D][sensor:094]: 'blegateway1 WiFi Signal Sensor': Sending state -54.00000 dBm with 0 decimals of accuracy





欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/) Powered by Discuz! X3.5