Add a couple sensors to debug btproxy

This commit is contained in:
2025-01-20 21:41:30 +01:00
parent e5109b056f
commit 36b11ca687
2 changed files with 31 additions and 0 deletions
+1
View File
@@ -1,6 +1,7 @@
esphome:
name: btproxy
name_add_mac_suffix: true
friendly_name: "BTProxy"
project:
name: dasfoo.btproxy
+30
View File
@@ -5,12 +5,42 @@ esp32:
framework:
type: esp-idf
globals:
- id: ble_scans
type: int
restore_value: no
initial_value: '0'
esp32_ble_tracker:
scan_parameters:
# Recommended scan intervals for esphome.
interval: 1100ms
window: 1100ms
active: true
on_scan_end:
- then:
- sensor.template.publish:
id: ble_scans_finished
state: !lambda 'return ++id(ble_scans);'
bluetooth_proxy:
id: btproxy
active: true
sensor:
- platform: template
name: "btproxy connections free"
lambda: 'return id(btproxy).get_bluetooth_connections_free();'
update_interval: 60s
state_class: "measurement"
accuracy_decimals: 0
entity_category: diagnostic
icon: "mdi:bluetooth-settings"
- platform: template
name: "BLE scans finished"
id: ble_scans_finished
state_class: "total_increasing"
accuracy_decimals: 0
entity_category: diagnostic
icon: "mdi:bluetooth-settings"