esphome: name: btclassic platform: ESP32 board: esp32doit-devkit-v1 wifi: networks: - ssid: "your_ap" password: "password" manual_ip: # Set this to the IP of the ESP static_ip: 192.168.x.yyy # Set this to the IP address of the router. Often ends with .1 gateway: 192.168.x.yyy dns1: 192.168.x.yyy # The subnet of the network. 255.255.255.0 works for most home networks. subnet: 255.255.255.0 fast_connect: true reboot_timeout: 5min captive_portal: # Enable logging logger: level: DEBUG ota: mqtt: broker: 192.168.x.yyy keepalive: 30s reboot_timeout: 5min birth_message: topic: btclassic/newborn payload: online on_message: - topic: btclassic/ask then: - if: condition: lambda: 'return x == "ask";' then: - switch.turn_on: blue - mqtt.publish: topic: btclassic/response payload: "Something happened!" - delay: 1sec - switch.turn_off: blue switch: - platform: gpio name: "blue" id: "blue" pin: 2 # Example config.yaml external_components: - source: github://pr#4736 components: [ esp32_bt_classic, bt_classic_presence, esp32_bt_common ] esp32_ble_tracker: binary_sensor: # BT Classic can run side-by-side with BLE! - platform: ble_presence mac_address: AA:BB:CC:DD:EE:F0 name: FitBit Presence - platform: bt_classic_presence name: Walters Iphone Presence mac_address: AA:BB:CC:DD:EE:F0 num_scans: 5 update_interval: 10s esp32_bt_classic: on_scan_start: - switch.turn_on: blue on_scan_result: - mqtt.publish: topic: btclassic/response payload: !lambda |- return "Found during scan: " + to_string(name) + ", " + address.str(); - switch.turn_off: blue