Phone charger on/off by battery level

still a noob to all this, I have 2 automations for my wallpanel one for on and one for off for charging, but that still works so glad I did not install any of these as I thought it would be cleaner ill try to adapt it to a blueprint to help out