In this work a novel sustainable, self-driven UV photodetection system using ternary transition metal dichalcogenide (TMDC) alloy (MoxW1−xS2) is proposed by coupling a photodetector as a light intensity sensor and a piezoelectric nanogenerator (PENG) as a power source. Crystalline MoxW1−xS2 ternary alloy nanosheets are synthesized via cost effective hydrothermal method to fabricate a UV (365 nm) photodetector with extraordinary high responsivity (≈229 A W-1). The microstructural, optical properties of different ternary alloy composition, along with their binary counterparts, have been studied. The optimized Mo0.5W0.5S2 ternary alloy nanosheets are used as fillers in PVDF matrix to fabricate flexible self-polled PENGs, exhibiting piezoelectric open-circuit output ≈50 V under finger tapping and a record high piezo-voltage ≈187 V under impact of 12 kPa. By coupling the two devices, the output voltage of the PENG is tuned by the resistance of the photodetector, exhibiting superior voltage sensitivity (≈0.75 V µW-1 cm-2) with UV illumination. The impedance matching between the PENG and photodetector has been utilized to demonstrate self-powered UV sensors by monitoring the on/off states of light-emitting diode directly. This self-powered, portable ternary TMDC alloy device is attractive for future real-time monitoring of UV radiation and smart health sensors for IOT applications.