The echo integration is easy because, yes, you can use virtual switches. The trick is then to tie that virtual switch to something that triggers the other device. You can just subscribed to that switches advance if you want, that is usually the easiest way if you’re writing your own code.
The following is a clickable link to the project topic in which I described using the echo to control how many activities via IFT TT. Your “man in the middle” will be your own smart app instead, but the same logic applies as far as how the virtual switches are used with echo, so it may be of interest.
As far as working when Itach, many community members do that through the Wi-Fi interface. Just search the forums for those topics. That should give you some more ideas. Here’s one that discusses several different options. Again, you may do years differently because you’re doing your own coding, but this might still be of interest.