gf-bt-proxy-01.yaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. esphome:
  2. name: gf-bt-proxy-01
  3. friendly_name: gf-bt-proxy-01
  4. esp32:
  5. board: esp32dev
  6. framework:
  7. type: esp-idf
  8. # Enable logging
  9. logger:
  10. # Enable Home Assistant API
  11. api:
  12. encryption:
  13. key: "ejeMnlF5M60w/yuYwAWn/kIBz701xLwVkUGf9iN8uLA="
  14. ota:
  15. password: "2c27af3ab81f992e23745c20ab5dfc02"
  16. wifi:
  17. ssid: !secret iot_ssid
  18. password: !secret iot_password
  19. domain: .int.mmax.cloud
  20. # Enable fallback hotspot (captive portal) in case wifi connection fails
  21. ap:
  22. ssid: "Gf-Bt-Proxy-01 Fallback Hotspot"
  23. password: "Ry3eaIb2vmf1"
  24. improv_serial:
  25. esp32_ble_tracker:
  26. scan_parameters:
  27. # We currently use the defaults to ensure Bluetooth
  28. # can co-exist with WiFi In the future we may be able to
  29. # enable the built-in coexistence logic in ESP-IDF
  30. active: true
  31. # bluetooth_proxy:
  32. # active: true
  33. external_components:
  34. - source: github://myhomeiot/esphome-components
  35. ble_gateway:
  36. id: blegateway
  37. on_ble_advertise:
  38. then:
  39. homeassistant.event:
  40. event: esphome.on_ble_advertise
  41. data:
  42. packet: !lambda return packet;
  43. # gateway_id: ${device_id}
  44. binary_sensor:
  45. - platform: homeassistant
  46. id: ble_gateway_discovery
  47. entity_id: binary_sensor.ble_gateway
  48. attribute: discovery
  49. on_state:
  50. then:
  51. lambda: id(blegateway).set_discovery(x);
  52. text_sensor:
  53. - platform: homeassistant
  54. id: ble_gateway_devices
  55. entity_id: binary_sensor.ble_gateway
  56. attribute: devices
  57. on_value:
  58. then:
  59. lambda: id(blegateway).set_devices(x);
  60. switch:
  61. - platform: template
  62. id: switch_ble_gateway_discovery
  63. name: BLE Gateway Discovery
  64. icon: mdi:bluetooth-connect
  65. lambda: return id(blegateway).get_discovery();
  66. turn_on_action: [lambda: id(blegateway).set_discovery(true);]
  67. turn_off_action: [lambda: id(blegateway).set_discovery(false);]
  68. disabled_by_default: true
  69. entity_category: config
  70. button:
  71. - platform: safe_mode
  72. name: Safe Mode Boot
  73. entity_category: diagnostic