|
@@ -38,10 +38,51 @@ esp32_ble_tracker:
|
|
|
# enable the built-in coexistence logic in ESP-IDF
|
|
# enable the built-in coexistence logic in ESP-IDF
|
|
|
active: true
|
|
active: true
|
|
|
|
|
|
|
|
-bluetooth_proxy:
|
|
|
|
|
- active: true
|
|
|
|
|
|
|
+# bluetooth_proxy:
|
|
|
|
|
+# active: true
|
|
|
|
|
+
|
|
|
|
|
+external_components:
|
|
|
|
|
+ - source: github://myhomeiot/esphome-components
|
|
|
|
|
+
|
|
|
|
|
+ble_gateway:
|
|
|
|
|
+ id: blegateway
|
|
|
|
|
+ on_ble_advertise:
|
|
|
|
|
+ then:
|
|
|
|
|
+ homeassistant.event:
|
|
|
|
|
+ event: esphome.on_ble_advertise
|
|
|
|
|
+ data:
|
|
|
|
|
+ packet: !lambda return packet;
|
|
|
|
|
+# gateway_id: ${device_id}
|
|
|
|
|
+binary_sensor:
|
|
|
|
|
+ - platform: homeassistant
|
|
|
|
|
+ id: ble_gateway_discovery
|
|
|
|
|
+ entity_id: binary_sensor.ble_gateway
|
|
|
|
|
+ attribute: discovery
|
|
|
|
|
+ on_state:
|
|
|
|
|
+ then:
|
|
|
|
|
+ lambda: id(blegateway).set_discovery(x);
|
|
|
|
|
+
|
|
|
|
|
+text_sensor:
|
|
|
|
|
+ - platform: homeassistant
|
|
|
|
|
+ id: ble_gateway_devices
|
|
|
|
|
+ entity_id: binary_sensor.ble_gateway
|
|
|
|
|
+ attribute: devices
|
|
|
|
|
+ on_value:
|
|
|
|
|
+ then:
|
|
|
|
|
+ lambda: id(blegateway).set_devices(x);
|
|
|
|
|
+
|
|
|
|
|
+switch:
|
|
|
|
|
+ - platform: template
|
|
|
|
|
+ id: switch_ble_gateway_discovery
|
|
|
|
|
+ name: BLE Gateway Discovery
|
|
|
|
|
+ icon: mdi:bluetooth-connect
|
|
|
|
|
+ lambda: return id(blegateway).get_discovery();
|
|
|
|
|
+ turn_on_action: [lambda: id(blegateway).set_discovery(true);]
|
|
|
|
|
+ turn_off_action: [lambda: id(blegateway).set_discovery(false);]
|
|
|
|
|
+ disabled_by_default: true
|
|
|
|
|
+ entity_category: config
|
|
|
|
|
|
|
|
button:
|
|
button:
|
|
|
- platform: safe_mode
|
|
- platform: safe_mode
|
|
|
name: Safe Mode Boot
|
|
name: Safe Mode Boot
|
|
|
- entity_category: diagnostic
|
|
|
|
|
|
|
+ entity_category: diagnostic
|