Do smart USB ports exist?

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:

  1. See if and how much data and/or electricity is going through.
  2. 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?

SONOFF Micro 5V USB Smart WiFi Adaptor for Type A USB Devices, Works with Alexa and Google Home, APP Remote Control Switch, Timer Function, No Hub Required: Industrial & Scientific
I don’t think this does power metering though :frowning:

1 Like

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.

1 Like

How would you set this up in Home Assistant?

Just answered my own question! I found Dr ZZZZ’s video on SonoffLan, didn’t know that existed before.

1 Like

There is/was a device recently on kickstarter that would do most or all of what you wanted.

Do you remember its name?

No, but a quick search found it

I believe there is a thread about it here too ???

exactly what I wanted, but 880 € is beyond my Home Automation budget :laughing: thanks anyways!

I’ve been using some of these for a while now. They flash easily with Esphome. No power monitoring though

1 Like

Or do some DIY! Get one of these with a ESP01s, flash Tasmota or ESPHome, add some cables, done! BTW, dirt cheap…