The previously-committed api encryption key must be rotated separately and history scrubbed before publishing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
83 lines
2.1 KiB
YAML
83 lines
2.1 KiB
YAML
|
|
esphome:
|
|
name: frame-orchestrator
|
|
name_add_mac_suffix: true
|
|
project:
|
|
name: zyberzero.frame-orchestrator
|
|
version: "0.1-beta"
|
|
|
|
esp32:
|
|
board: seeed_xiao_esp32c3
|
|
framework:
|
|
type: esp-idf
|
|
|
|
dashboard_import:
|
|
package_import_url: "https://git.zyberze.ro/zyberzero/esphome-devices/frame-orchestrator.yaml@latest"
|
|
|
|
external_components:
|
|
- source:
|
|
type: local
|
|
path: components
|
|
|
|
esp32_ble:
|
|
enable_on_boot: true
|
|
|
|
esp32_ble_tracker:
|
|
|
|
bluetooth_proxy:
|
|
|
|
ibeacon_rotator:
|
|
id: waker
|
|
uuid_prefix: !secret ble_uuid_prefix
|
|
broadcast_length: 45s
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: !secret api_encryption_key
|
|
|
|
ota:
|
|
- platform: esphome
|
|
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
use_address: frame-proxy.local
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap:
|
|
ssid: "Frame-Proxy Fallback Hotspot"
|
|
password: !secret ap_fallback_password
|
|
|
|
captive_portal:
|
|
mqtt:
|
|
id: mqtt_client
|
|
broker: !secret mqtt_broker
|
|
username: !secret mqtt_username
|
|
password: !secret mqtt_password
|
|
on_connect:
|
|
- lambda: |-
|
|
static bool subscribed = false;
|
|
if (!subscribed) {
|
|
subscribed = true;
|
|
id(mqtt_client)->subscribe("frames/+",
|
|
[](const std::string &topic, const std::string &payload) {
|
|
auto pos = topic.find_last_of('/');
|
|
std::string leaf = (pos == std::string::npos)
|
|
? topic : topic.substr(pos + 1);
|
|
ESP_LOGD("frames", "leaf=%s payload=%s",
|
|
leaf.c_str(), payload.c_str());
|
|
// do something with `leaf` here
|
|
id(waker)->add_mac_from_string(leaf, ibeacon_rotator::Instruction::REFRESH);
|
|
});
|
|
id(mqtt_client)->subscribe("wake/+",
|
|
[](const std::string &topic, const std::string &payload) {
|
|
// payload is the target MAC, e.g. "AA:BB:CC:DD:EE:FF"
|
|
id(waker)->add_mac_from_string(payload, ibeacon_rotator::Instruction::WAKE);
|
|
});
|
|
}
|