Context: I have a USB-C powerbank that I use to keep powered on the go. But in the interest of keeping the external battery in good condition for as long as possible, I would like to avoid charging it beyond 70% and keeping it at that level overnight every single night. So, I want to be able to create some kind of script that could hypothetically disable power output on a certain USB port until a set time in the morning, way before I wake up, so that the bank can charge fully so I can have as much runtime as possible while preserving the long term health of the battery bank.
TL;DR: Can I programmatically enable and cut power output to a USB port on the FW12 on Windows?
It’s come up before. Iirc, you can not. Very few usb hub chips seem to include the required internal power switches.
An external switch might work, chargie.org. I recall some model has an independent mode that tries to cut off power before full charge by monitoring charge current. Never used one, don’t know how well it works, or doesn’t.
If you have a little programming ability, you could make a controllable switch for less with something like an esp32 mcu, and a mosfet board. No need to step down PD voltages if you use a 5v mcu board on a separate port, and an Opto-isolated AOD4184 or LR7843.
I myself hate that it’s so hard to limit charge for many devices. I’m currently lucky that it works in software on my phones (with root app or aac), and my laptop. Didn’t work on my old tablet.