First, there’s an Apple’s iPhone guide: Create a new personal automation if you want to have a look.
If you already know that charging your phone’s battery over 80% is not such a good idea then let’s create an automation to let us know when we should stop charging.
Some more details on mobile phone life.
And you’re done.
Keep coding!
Featured image: Frankie