Sure, lots of people do something similar to control smart bulbs when they don’t want the wall switch to cut the power to the bulb. Instead the switch sends a message to the hub and the hub send a message to the bulb. Your use case would be similar. The switch sends a message to the hub, the hub sends a message to the outlet. So look at those threads, they should give you ideas.
Start with the following FAQ (this is a clickable link)