USB power control from HA OS

Hello, I would like to control a device that is physically connected to a USB port on my laptop running HA OS (Generic x86-64).
I simply need to toggle the 5V power supply of that specific USB port, similar to turning on/off a lightbulb in HA.
Is this possible?

Before even getting to HA… I don’t know many laptops that allow someone to toggle the power of the USB ports. If you can’t do it in the hardware HA doesn’t magically make it possible.

What are you ACTUALLY trying to do. There may be other ways.

Well I would like to control a 5V Led with the USB port.
I thought it was possible after I saw something like that on Linux:

If you can turn on/off usb using command line or script then you may use a command line switch in HA to control it

This may work

1 Like

Sonoff makes a WiFi smart USB A switch.

1 Like

These can be flashed with Tasmota or ESPHome

Thank you everybody. I wish I could use a command line switch… if I only knew enough to make it work but it’s really complex for me! If anybody can make it, pleas let us all know!
For now i think I’m going to buy the Sonoff micro USB smart WiFi adaptor 5V, because I already use some Sonoff devices.
Anyway, if there’s a command line solution, even better, there’s plenty of USB ports :grinning:

Great, I’ve got it and it works like charm on HA

1 Like