Disable Bluetooth hibernation/sleep/deep sleep

Hello all,

I recently boght some S-MATE2 bluetooth modified protocol switches from SONOFF. Those devices work massively with bluetooth, they are not permanently connected to the HA computer.

I ve managed to connect em via eWeLink Remote Gateway add on and i use them as light switches.

Problem
They present only one issue, after some time (3 to 5 mins) the first press on any of them its not recognised by the Bluetooth device. Second, third, etc works just fine on any or the same device.

Conclusion
I came to the conclusion that the Bluetooth of the PC that runs bare metal gets into a sleep state, first ping as an input waking up the bluetooth.

Posible solution?
Is there a way to create an ‘alert’ mode by randomly searching for devices or a way to just disable bluetooth sleep?

Thank you all!!

It is not the BT service on the server that goes to sleep, but the one on the S-MATE2.
They do it to preserve battery.

You might have luck finding a setting on the Sonoff support site that can change this, but know that it will severely affect your battery life.

Hello!

I’ve read the same thing, but I’m confident that this isn’t what’s happening here. To be sure, I might take some measurements tomorrow.

Here’s why I don’t think that explanation applies. Let’s consider this scenario:

There are two devices: S MATEnr1 and S MATEnr2.

I press S MATEnr1 → no response

I press S MATEnr2 → it responds

After waiting some time for the idle timer to reset:

I press S MATEnr2 → no response

I press S MATEnr1 → it responds

From what I’ve read about those Sonoff devices, they don’t support bridge mode or anything similar. So it wouldn’t make sense for the second device to wake up on its own just because I interacted with the first one.

Also, something just occurred to me: if triggering one device doesn’t wake the others, and it keeps the Bluetooth “alert” , then I could simply buy another unit, connect it to a power supply, and use it to send wake signals every 20 seconds.

I’ll come back with some power consumption measurements.

Thank you for answering!

Hello everybody!

Good and bad news.

Came back with the measurements but they mostly indicate 0 uA. I can only conclude that the S-MATE goes into sleep before my meter could register it. Sorry for not being more precise, in this case an oscilloscope could ve been great, but i dont have one :<

So, with the conclusion of the device going imediatly to sleep, i tried some logs, this is what i ve got:

2025-12-18 07:53:02.647 [INFO] bdaddr: 66:55:44:33:22:11, data: 02 01 02 1B 05 FF FF EE 1B C8 78 F6 4A 43 75 F2 13 6B 49 F8 B5 46 90 58 5A 40 62 D2 9E 00 00

2025-12-18 07:53:02.647 [INFO] publish sender2remote message success, topic: cube/remote-ble/received/broadcast

[2025-12-18T05:53:02.648Z] [INFO] default - [mqtt] onmessage <========== cube/remote-ble/received/broadcast {“data”:[“02”,“01”,“02”,“1B”,“05”,“FF”,“FF”,“EE”,“1B”,“C8”,“78”,“F6”,“4A”,“43”,“75”,“F2”,“13”,“6B”,“49”,“F8”,“B5”,“46”,“90”,“58”,“5A”,“40”,“62”,“D2”,“9E”,“00”,“00”]} 165 {“reqClientId”:“remote-ble-7397”,“reqSequence”:“1766037182000”}

[2025-12-18T05:53:02.649Z] [WARN] default - received invalid model: undefined, skip…

So here we go, i ll try to make a keep BT alive automation or maybe an add-on.

Thank you all!

Hello everybody!

Solved it! Looks like the solution was rly under my eyes. All i needed was BLE passtrough so the devices devices wont need authentification:

Just implemented this and works like a charm!

Thanks!