Modeling of optoelectronic devices involves long and complex numerical simulations, usually performed with TCAD tools. Numerical simulations provide accurate results for a single device but are not feasible when dealing with a full circuit comprising several nodes. To solve this issue, we developed a novel approach to simulate optoelectronic devices in standard SPICE circuit simulators, thus avoiding using TCAD tools. The concept is based on a coarse meshing of the semiconductor whose nodes are interconnected with the so-called Generalized Lumped Devices. The Generalized Lumped Devices are four ports devices: two ports simulate real currents and voltages in the semiconductor while two additional ports simulate excess carrier density and gradient through the definition of equivalent currents and voltages. The model behind the Generalized Devices is physics based and can correctly simulate optical generation of excess carriers, drift-diffusion transport, bulk and surface recombination as well as capacitive effects, without the need to introduce fitting or empirical parameters. Moreover, since all inputs and outputs are electrical quantities, the model is fully SPICE-compatible and can be merged with SPICE netlists of circuits. In this work, we use the Generalized Devices approach to simulate a bipolar phototransistor and prove that we can predict the photocurrent versus the collector voltage, for different illumination intensities. The model accurately takes into account the optically-triggered current amplification in the phototransistor. Sentaurus TCAD numerical simulations are in agreement with the Generalized Devices approach. Finally, since the model is physics based, we could assess the impact of different semiconductor parameters, such as doping concentrations, lifetime, surface recombination velocity, on the output characteristics of the phototransistors, directly with SPICE circuit simulators.