Hi all, is there a way to get into HA status scanning’s status of ESPHOME Bluetooth proxy?
Here my running code.
Is there a way to expose to HA status mentioned above?
> substitutions: #substitute your own values in this section
> device_name: "esp32-bluetooth-proxy-1"
> static_ip: 192.168.1.100
> gateway: 192.168.1.254
> subnet: 255.255.255.0
> dns1: 192.168.1.241
>
> #---------------------------------------------------------------------------------------------
>
> esphome:
> name: '${device_name}'
> friendly_name: '${device_name}'
> on_boot:
> priority: -100
> then:
> - logger.log: --- BT Scan started ON BOOT!!!! ---
> - light.turn_on:
> id: led_gpio2
> effect: "Fast Pulse"
>
> esp32:
> board: esp32dev
> framework:
> type: esp-idf
>
> time:
> - platform: sntp
> id: sntp_time
> timezone: Europe/Rome
> servers:
> - 0.pool.ntp.org
> - 1.pool.ntp.org
> - 2.pool.ntp.org
> - platform: homeassistant
> id: esptime
>
> logger:
> level: DEBUG #VERY_VERBOSE
>
> api:
> encryption:
> key: "xxxxxxxxxxxxxxxxxxxx"
>
> ota:
> platform: esphome
> password: "xxxxxxxxxxxxxxxxxxxxx"
>
> wifi:
> ssid: !secret wifi_ssid
> password: !secret wifi_password
> manual_ip:
> static_ip: $static_ip
> gateway: $gateway
> subnet: $subnet
> dns1: $dns1
>
> ap:
> ssid: '${device_name}'
> password: "xxxxxxxxxxxxxxxxx"
>
> esp32_ble_tracker:
> id: ble_tracker_1
> scan_parameters:
> continuous: true
> on_ble_advertise:
> then:
> - lambda: |-
> ESP_LOGD("ble_adv", "New BLE device");
> ESP_LOGD("ble_adv", " address: %s", x.address_str().c_str());
> ESP_LOGD("ble_adv", " name: %s", x.get_name().c_str());
> ESP_LOGD("ble_adv", " Advertised service UUIDs:");
> for (auto uuid : x.get_service_uuids()) {
> ESP_LOGD("ble_adv", " - %s", uuid.to_string().c_str());
> }
> ESP_LOGD("ble_adv", " Advertised service data:");
> for (auto data : x.get_service_datas()) {
> ESP_LOGD("ble_adv", " - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
> }
> ESP_LOGD("ble_adv", " Advertised manufacturer data:");
> for (auto data : x.get_manufacturer_datas()) {
> ESP_LOGD("ble_adv", " - %s: (length %i)", data.uuid.to_string().c_str(), data.data.size());
> }
> on_scan_end:
> - then:
> - lambda: |-
> ESP_LOGD("ble_auto", "############ The scan has ended! ###########");
>
> bluetooth_proxy:
> active: true
>
>
> output:
> - platform: ledc
> pin: GPIO2
> id: gpio2_led
>
> light:
> - platform: monochromatic
> output: gpio2_led
> name: "LED GPIO2"
> id: led_gpio2
> internal: False
> effects:
> - pulse:
> name: "Fast Pulse"
> transition_length: 1s
> update_interval: 1s
>
>
> binary_sensor:
> - platform: status
> name: "Display Status"
>
> sensor:
> - platform: wifi_signal
> name: "Segnale WiFi"
> update_interval: 60s
>
> - platform: uptime
> name: "Tempo di attività"
>
>
> button:
> - platform: template
> name: Start scan ESP32 BT Proxy 1
> id: scan_esp32bt_proxy_1
> on_press:
> then:
> - logger.log: --- BT Scan started ---
> - light.turn_on:
> id: led_gpio2
> effect: "Fast Pulse"
> - esp32_ble_tracker.start_scan:
> - platform: template
> name: Stop scan ESP32 BT Proxy 1
> id: no_scan_esp32bt_proxy_1
> on_press:
> then:
> - logger.log: --- BT Scan stopped!!! ---
> - light.turn_off: led_gpio2
> - esp32_ble_tracker.stop_scan: