Detecting PWM signal is present on the line
when any signal (duty cycle >0) is present


you need to detect

1) input signal at logic high, or
2) input signal has gone through a low->high transition.

it can be done with logic gates, flip flops, diodes, capacitors and / or a mcu.

edit: here is one example of how it can be done, with a look-back window.



U1A and U1B form our on-again-and-off-again pwm, for simulation purposes. the output from U1B is being OR's on U1D (actually the two signals, as discussed, are negated and then AND by U1D), to produce the output: it goes high once an active high is detected, or no transition is being detected within the look-back window. 

here the look back window is set to be about 100ms but you can change it to your liking.

all done with NAND gates, and some passives.