Power on when charging but only when battery level is greater than 20% I have recently tried to fit a tablet into my car and I came across a problem with waking up the device
without using the power button. My solution is to boot the device whenever it is charging, but 
I have noticed that when the battery level is at 0%, the device boots and then immediately shuts down.
I have used this adb option to trigger this behavior:

fastboot oem off-mode-charge 0


However this boots the phone without checking the battery level and as I said - if the battery is dead, the phone (or rather a tablet- Nexus 7 2012) turns off immediately - it drains the battery faster that I'm able to charge it.
Is there any way to make the tablet boot only if the battery level is greater than, say, 20%?
When the device is on it is probably drawing more current than is available from the charging port.  Make sure the automobile charging adapter you are using can generate sufficient current required by the device.  On most electronics there is a marking (either embedded in the plastic or on a sticker) near the power adapter that indicates the voltage (V) and current (I) requirements for the device.