SHD
(SHD)
August 31, 2022, 1:13pm
1
Hello,
I need help setting up my HA to control my bluetooth device by sending an advertising packet that I recorded earlier.
how do i set up an automation script to make the ad pack send?
I have a code recorded by the scanner that needs to be sent via bluetooth
data:
packet: FF5556188752B65F2B5E00FC3151D09C940824CB70FC7CAEBFD8DDCDFFFF
Helge_K
(Helge)
March 7, 2023, 9:41am
2
angulito
(Natalia)
February 3, 2024, 10:47pm
3
Did you finally get anything working? Would you mind sharing? Thanks!
1 Like
Helge_K
(Helge)
May 3, 2024, 9:02am
4
When you follow the links I posted above you will find answers. You can e.g. use the XGIMI remote control integration for this. It can also be hard coded or soft coded into ESPHome based ESP32 controller.
fahlsen
(Zin)
August 13, 2024, 1:17pm
5
Can you share some more information about how to make this work with ESPHome Bluetooth Proxy?
Helge_K
(Helge)
October 2, 2024, 1:54am
6
This is the code I use to run Bluetooth Proxy and XGIMI projector wakeup advertising on the same ESP32:
substitutions:
name: esp32-bluetooth-proxy-ble-wake
friendly_name: Bluetooth Proxy and BLE XGIMI Elfin Projector Wakeup ESP32 in Case
#packages:
# esphome.bluetooth-proxy: github://esphome/firmware/bluetooth-proxy/esp32-generic.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
api:
encryption:
key: something
logger:
ota:
- platform: esphome
password: !secret ota_password
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable BLE
esp32_ble:
id: ble
# Enable BLE Server
esp32_ble_server:
esp32_ble_tracker:
scan_parameters:
# We currently use the defaults to ensure Bluetooth
# can co-exist with WiFi In the future we may be able to
# enable the built-in coexistence logic in ESP-IDF
active: true
bluetooth_proxy:
active: true
button:
- platform: template
name: XGIMI Projector Wakeup
icon: "mdi:projector"
on_press:
- repeat:
count: 3
then:
- lambda: |-
std::vector<uint8_t> data = {0x46, 0x00, 0x7e, 0x31, 0xdb, 0x31, 0xb2, 0x24, 0x40, 0xff, 0xff, 0xff, 0x30, 0x43, 0x52, 0x4b, 0x54, 0x4d};
id(ble).advertising_set_manufacturer_data(data);
- delay: 1s
- lambda: |-
std::vector<uint8_t> data = {0x46, 0x00};
id(ble).advertising_set_manufacturer_data(data);
- delay: 1s
- platform: safe_mode
name: Safe Mode Boot
entity_category: diagnostic
# ELFIN CODE: 7e 31 db 31 b2 24 40 ff ff ff 30 43 52 4b 54 4d
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# # Enable fallback hotspot (captive portal) in case wifi connection fails
# ap:
# ssid: "something"
# password: "something"
#captive_portal:
####
#esphome:
#name: ${name}
#friendly_name: ${friendly_name}
# name_add_mac_suffix: true
#dashboard_import:
# package_import_url: github://esphome/firmware/bluetooth-proxy/esp32-generic.yaml@main
###
1 Like