OK I got a sort of temporary working motion sensor now. I used this device handler
The motion sensor now reports a motion when it first picks up a motion, but it won’t check in again for 30 seconds, so what I’ve done is change line 77 of the code from
if (value == "active") {
def timeout = 2
to
if (value == "active") {
def timeout = 30
That way the sensor shows “MOTION” for 30 seconds when it first picks up motion and if it picks up motion again after this 30 second period, it will stay on. If not, it reverts back to “NO MOTION”.