Any updates on this? I have the same issue. My keypad is connected via bluetooth and even when plugged in constantly it goes to sleep. Once it sleeps and wakes up again, I have to restart my script manually because devices aren't rescanned. In fact, LuaMacros thinks the handler is still connected.