Setting motion sensor to inactive

I used some Schlage/Ecolink contact sensors as pressure sensors similarly to this post.

ST picks these up correctly as contact sensors, which I modified to motion sensors. However, ST sometimes confuses the state of these sensors, and really is only useful for determining if there is pressure in a “presence” context rather than “occupancy” context. The bad news is that sometimes ST understands the sensor to have continuous motion for hours when it does not. Thus, I had a need to clear the occupancy from the sensor on a regular basis.

I solved this issue by creating a custom motion sensor device with an added “refresh” capability. This refresh clears any active motion. A Pollster-inspired SmartApp reaps the sensors on a regular basis, so that they do not remain stuck in “active” motion. The code for both the custom device and SmartApp are here:

As an additional use case, I have two low quality battery z-wave motion sensors that sometimes do not report “inactive”. This device type and SmartApp cure that issue as well.