Only charge tablet when battery low?

I’m using Fully Kiosk Browser and Tileboard on a Samsung 4s 8 as my Home assistant dashboard. I’d like to keep the tablet plugged in all the time and only charge when the battery gets low (to not destroy the battery). Anyway tips on how to do this?

Thanks

sure… if you are using the plus extensions you can grab the battery level on the REST interface. You can use this information to control a smart plug.