There used to be a feature on the classic Android 2.2 which was titled "Profiles". It allowed people to set different variables of their phone settings with the tap of a button. Later, they added stuff like Triggers, customizable actions, quick access profiles and others. Ironically enough, all those features that should have enticed more users to take advantage of profiles, ended up having the opposite effect.
It is unclear whether it is because of the lack of interest or some other bug or unforseen occurance, but with the emergence of Android 4.1, that feature seemed to be broken in all sorts of ways for different devices. Some have speculated this has something to do with Google revamping the permissions framework for profile and app access. I recall a lot of my friends with Samsung devices having the profiles do nothing at all, despite them being there. HTC users experienced a crash whenever they tried to access the profiles menu and a lot of the others just hid that tab, so as to avoid overloading their support Emails. I secretly had hopes that with the next update it will be fixed, but having an HTC phone at that time, I was not that optimistic about it.
Feelings of despair and frustration with a broken feature were brought back by my search to remove my long screen password on my phone whenever I am at home. I tried many reccomended apps in online communities such as StackOverflow, Reddit and some imageboards, only to find most of them are simply outdated and do not run properly and if they do, they end up draining a lot of battery. The best one I came across was an app by the name of "AutomateIt". It was relatively easy on the battery of my four year old device and had sufficient amount of customability. It is not FOSS and the way some triggers are designed, even by the app creators, not the community have me doubting the intentions of the app. Thankfully, a person from a Discord group, smoKEEN (He asked me to put in his tag), who we later became friends with, advised me I can do that with Android's embedded System Profiles.
This threw me back a bit, as I thought he was referring to the couple of old articles you can find about them when they were still working, but on investigation, it apprears that one of the many bugs the release of Android 6.0 addressed was exactly that of this specific feature. The "Work Profiles" Google was eager to push meant that for ease of use and minimal resource usage, they based it on top of the existing System Profiles code initially. They reworked the base and with 6.0.1 it was fully functional. Because I, frankly, forgot about this feature and its usefulness, I was excited with the prospect of utilizing it again.
Recently switching to an Android 8.1.2 ROM, I hoped it would have this feature running properly as I later found out it did. Located under the "System" tab in Settings, it is easy to navigate to. I found out since the last time I used them, they have added a WiFi and NFC trigger, which can be extremely useful for someone like me. Bluetooth was not especially alluring, since SmartLock already handled the intended result I was looking for with Bluetooth devices fine. After some experimentation, I ended up setting three profiles: A default one, a Work one and a Home one. The default holds my default settings, as one can assume, the Work one silences anything aside from my Alarms and disables any unnecessary radio and the Home one puts all volume back up, removes my lengthy screen lock, enables Bluetooth so it can sync with some devices I have and starts up a Samba server.
The way you set up a profile is extremely simple. You click on the button on the lower left corner, which takes you to the wizard. This presents you with two simple steps. The first one asks you which event should trigger the switching to the profile you're making. As the time of writing this post, it can be connecting/disconnecting from a WiFi network, connecting/disconnecting to a Bluetooth device or scanning a NFC tag. In the next screen, you define the actions this profile will take. Those can be the toggling of various Wireless and Network settings, volume overrides, miscellaneous system settings such as screen brightness and, optionally, chaining another app with it. Once finished, this will create a profile which will require zero maintenance and will diligently do the tasks which you have set when the trigger conditions are met.
There are undoubtedly a lot of other possibilities if you use other apps alongside System Profiles to help with avoiding the huge battery drain and simplifying your phone setup a bit.
Hopefully this functionality does not break again as I have enjoyed all of the seconds saved as a result of this configuration to the fullest and would not want to go back to they way it was.