Control external monitor signal via shorcut?

Depending on where I am in the workday, I am either using my 15" MBP screen only, or with a wall mounted 27" screen as a screen extension. I’d like to be able to switch between these two arrangements via shortcut or automator, but so far - no luck figuring that out. I’m not interested in controlling the brightness; I want to be able to “unplug” the external without unplugging it, i.e., cut the signal entirely so that all the open windows move back to the laptop screen… just like unplugging the monitor. I’m not sure if this has been solved before, but I can’t seem to find a good solution for it, short of unplugging the cable itself, which isn’t really a good solution.

Any ideas?