Trigger on ESP8266_PWM change (switch relay depending on PWM 0/>0)

I’m having an AC dimmer attached to a Sonoff Basic and control it via PWM (GPIO14).
The AC dimmer is powered by the output of the Sonoff Basic (behind the switch relay).
Now I want to switch the relay - having the whole AC dimmer component switched off - if PWM is set to 0.
Meaning, I’d like to switch.on / depending on whether PWM is 0 / >0.
Is that possible and if so, how I’d do it? Didn’t see any events I could subscribe to in the ESP8266_PWM API reference.