PST02A by Philio Technology Corp motion sensing never clears

Newly installed sensor always in motion detected state. If I clear it manually my automations do work, but then it goes back to ‘detected’ state. There was a mention of the script I can use to clear it. Anyone has the script? Or solved the problem by other means?