I am new to Ewelink. I am looking for some time for a USB relay, which has data passthrough, you can control to toggle the conncted USB device on/off through the same USB port or via WIFI. I found this device online:
I don’t really understand what that device does but have a look at the Sonoff SV. It can be powered by USB power. You cut the usb cable and a data cable has 4 wires. Just connect the 5V and ground to and from the SV. Just pass the two data cables through and it makes no difference to data transfer… I used to do this. Recently dismantled it. It has a local mode, so there is a local API, but I don’t know what it is. There is an open source GitHub entry for the integration and it prefers local; guess the local activation is there in the code somewhere. You can however pay roughly $10 a year for an advanced plan and then you can use webhooks.
Please do check with the retailer before purchase as some Wi-Fi modules do not support LAN control. If it does, some third-party integrations can control it via local API.
And as @eerke has mentioned, webhooks also meet your needs. It may be overkilled a little but you have other benefits from eWeLink if you already have some from the brand)
I doubt a device exists off the shelf that could meet those requirements. but maybe you could find something pre-flashed with Tasmota (as it has an http control node). Even if you ask the retailer here if that device has a local mode you’d still need to figure out how the local mode works and it’s unlikely to be that simple.