Skip to content

Instantly share code, notes, and snippets.

View greghesp's full-sized avatar
🖐️

Greg Hesp greghesp

🖐️
View GitHub Profile
@greghesp
greghesp / device.yml
Created November 12, 2024 19:07
Lambda Function for BT Beacon to MQTT Broadcast for Home Assistant mqtt_room
- lambda: |-
if (x.get_ibeacon().has_value()) {
std::string uuid;
esp_bt_uuid_t raw_uuid = x.get_ibeacon().value().get_uuid().get_uuid();
char sbuf[64];
char *bpos = sbuf;
switch (raw_uuid.len) {
case ESP_UUID_LEN_128:
for (int8_t i = 0; i <= 15; i++) {
sprintf(bpos, "%02x", raw_uuid.uuid.uuid128[i]);
substitutions:
room_name: 'Living Room'
device_name: 'living-room-esp32'
friendly_name: 'Living Room ESP32'
description: 'Living Room Touch LCD with MQTT Room, Glucose Levels and Fireplace Temperature'
static_ip: 192.168.1.25
esp32:
board: esp32dev
framework: