I'm looking for a way to automatically disable my mobile hotspot after there has been no data activity for a set amount of time. Ideally, I'd also like to control network access for individual connected devices. The options I've found only shut the hotspot off after a data limit is reached, while Android's built-in setting turns it off only when no devices are connected. Since connected devices often remain idle without disconnecting, neither option solves the problem.
3 Answers
Tasker can use Shizuku and logcat access to detect when devices connect to tethering. That detection can serve as a starting point for a timer, after which Shizuku can turn the hotspot off. Root should not be necessary, but you’ll need Developer Options and ADB to configure it.
Recent Android versions restrict third-party apps from controlling hotspot functions directly. A ready-made app may not be able to do this unless the phone has root access or the feature is provided by a custom ROM.
You can probably build this with Tasker, Automate, or MacroDroid together with Shizuku. The automation would monitor connected devices or activity, start a timer after the last device becomes inactive, and then toggle the hotspot off.

That isn’t quite the ready-made solution I was hoping for, but since there doesn’t seem to be one, I’ll try building it with Automate instead of paying for Tasker just for this feature.