Already most diapers (for babies) have a yellow strip that turns blue with pee. No lights or electronics needed.
The secret is in changes before naps though :)
My kid gets her diaper changed several times a night and sleeps through it. If she does wake up she cries for a drink of water then immediately goes back to sleep.