Your iPhone can save some power during bedtime.
Optical signal from LED when iPhone charges.
With the Shortcuts app, you can create HomeKit automations that wait a moment before triggering.
Keeping the battery between 20 and 80% capacity is easy with shortcuts and extends the lifespan.
A HomeKit automation for a period of time must be created twice.