Add a couple sensors to debug btproxy
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
esphome:
|
esphome:
|
||||||
name: btproxy
|
name: btproxy
|
||||||
name_add_mac_suffix: true
|
name_add_mac_suffix: true
|
||||||
|
friendly_name: "BTProxy"
|
||||||
|
|
||||||
project:
|
project:
|
||||||
name: dasfoo.btproxy
|
name: dasfoo.btproxy
|
||||||
|
|||||||
@@ -5,12 +5,42 @@ esp32:
|
|||||||
framework:
|
framework:
|
||||||
type: esp-idf
|
type: esp-idf
|
||||||
|
|
||||||
|
globals:
|
||||||
|
- id: ble_scans
|
||||||
|
type: int
|
||||||
|
restore_value: no
|
||||||
|
initial_value: '0'
|
||||||
|
|
||||||
esp32_ble_tracker:
|
esp32_ble_tracker:
|
||||||
scan_parameters:
|
scan_parameters:
|
||||||
# Recommended scan intervals for esphome.
|
# Recommended scan intervals for esphome.
|
||||||
interval: 1100ms
|
interval: 1100ms
|
||||||
window: 1100ms
|
window: 1100ms
|
||||||
active: true
|
active: true
|
||||||
|
on_scan_end:
|
||||||
|
- then:
|
||||||
|
- sensor.template.publish:
|
||||||
|
id: ble_scans_finished
|
||||||
|
state: !lambda 'return ++id(ble_scans);'
|
||||||
|
|
||||||
bluetooth_proxy:
|
bluetooth_proxy:
|
||||||
|
id: btproxy
|
||||||
active: true
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user