I was wondering if there are any devices out there that work like smart plugs but for USB ports. Something that I can put between the actual USB port and the plug.
I know there are USB meters to see charge and data rates on a small display, but is there anything with Wi-Fi connectivity and that can be integrated into HA?
Thinks I want to be able to do:
See if and how much data and/or electricity is going through.
Turn port off and on.
Possible use-cases:
check if devices are plugged in to charger and get reminded if not
get notified if devices are finished charging
see data throughput of devices on dashboard
Does this device exist? Alternatively can it be build easily with ESP boards or something like it?
For switching power, its very easy. Im using an esp8266 with esphome, one gpio configured as switch. This gpio drives via gate driver IC a mosfet, which switches the ground of an usb port i soldered to the pcb where i mounted the other components of the node. I believe i used IRL510 mosfets and a TC4420CPA gate driver IC. Measuring power can be done over a shunt resistor (a small resistor like 1 ohm with high accuracy) between the 5v rail and the appliance via adc. BUT be carefull, you need a so called voltage divider for that to not destroy the esp. Alternatively, esphome implements a few sensors like CSE7766 or INA226 for voltage and current sensing.
But data sensing would involve hacking into the usb protocol, which i personally have absolutly no experience with and wouldnt recommend.