Hey, I'd like to let my device charge overnight and I have a smart socket that can be turned on/off from smart life. I've tried deactivating it through the 'click UI action' when my battery reaches a certain percentage, but even with the 'screen on' action it cannot be done because MacroDroid can't use the UI action if the screen is locked. Anyone might know a way to achieve this?
What phone do you have?
The newer versions of Android stop charging at 100% and some have setting to stop at a lower preset level and some have intelligent trickle charging - all designed to help protect the battery.
The reason I mention this is it could be an alternative to using the smart plug.
However, if your phone doesn't have any of these settings or you prefer to use the smart plug, I can only offer the following, as I don't use smart devices and there may be other solutions.
To continue to use UI actions, you are correct the screen needs to be unlocked. This is possible and depend on the type of lock you are using. On my phone when fingerprint or face aren't available, swiping up allows the PIN to be input. The swipe up and PIN input can be accomplished via a macro using UI integration actions. I would recommend password protecting this macro as it contains your unlock PIN.