Ah, your explanation does make sense! Shelly does have scripting interface that enables the BLE Observer, maybe some adjustments to the script could force them to update regularly?
// aioshelly BLE script 2.0
const queueServeTimer = 100; // in ms, timer for events emitting
const burstSendCount = 5; // number if events, emitted on timer event
const maxQueue = 32; // if the queue exceeds the limit, all new events are ignored until it empties
const packetsInSingleEvent = 16; // max number of packets in single event
let queue = [];
let timerHandler = null;
function timerCallback() {
for(let i = 0; i < burstSendCount; i++) {
if (queue.length <= 0) {
break;
}
Shelly.emitEvent(
"ble.scan_result", [
2,
queue.slice(0, packetsInSingleEvent),
]
);
queue = queue.slice(packetsInSingleEvent);
}
timerHandler = null;
if (queue.length > 0) {
timerHandler = Timer.set(queueServeTimer, false, timerCallback);
}
}
function bleCallback(event, res) {
if (event !== BLE.Scanner.SCAN_RESULT) {
return
}
if (queue.length > maxQueue) {
return;
}
queue.push([
res.addr,
res.rssi,
btoa(res.advData),
btoa(res.scanRsp)
]);
if(!timerHandler) {
timerHandler = Timer.set(queueServeTimer, false, timerCallback);
}
}
// Skip starting if scanner is active
if (!BLE.Scanner.isRunning()) {
BLE.Scanner.Start({
duration_ms: -1,
active: true,
interval_ms: 320,
window_ms: 30,
});
}
BLE.Scanner.Subscribe(bleCallback);
Above is the aioshelly BLE script v2 that gets automatically installed when BLE Active listening is enabled from native HA integration settings.
I was considering getting some M5Stack Lite ESP32 proxies, but I read various issues about the battery issues. Also running BLE proxy with battery seems not recommended. Considering cabling etc, for me Shelly Plus 1PM Mini Gen3 makes the most sense (price, versatility and installation).
Did I read correctly, you mentioned multiple proxies in same room/area could improve reliability? If so, do you have any recommendations for minimum/maximum distances between proxies?
EDIT: Found some discussion about Shelly BLE, there’s also passive script to run on the Shelly:
// aioshelly BLE script 1.0
BLE.Scanner.Subscribe(function (ev, res) {
if (ev === BLE.Scanner.SCAN_RESULT) {
Shelly.emitEvent("ble.scan_result", [
1,
res.addr,
res.rssi,
btoa(res.advData),
btoa(res.scanRsp)
]);
}
});
BLE.Scanner.Start({
duration_ms: -1,
active: false,
interval_ms: 320,
window_ms: 30,
});
As far as I understood, active listening sends requests to surrounding devices and asks for updates, while passive just receives broadcasted messages. Not sure if this actually matters in this use case?