I've not done this, however, what occurs to would depends on the specific camera you have (ie the camera control protocols supported)
Assuming the camera can be configured to support a command line 'argument', then using a plug in Dummy Command Line, or Warmuptill's
https://obsproject.com/forum/threads/advanced-scene-switcher.48264/
Now, PTZ Optics is taking a new PTZ control software, supporting some open protocols (so ymmv depending on your camera mfg) .. I'm planning to look further into it, but haven't yet. Their pre-release announcement webcast made the new software sound promising and intriguing
There are a number of other options, but they'd depend on the specific camera control interface involved (ex ONVIF/VISCA over IP, vs Serial, vs USB, etc).. it depends. In my case, I have a nice NDI camera, with a 300+ page published API guide... some lower-end/knock brand cameras, well, good luck...