I was using ST and webcore to trigger the outdoor floodlights on my house using Zooz outdoor motion detectors and an Ecolink contact sensor connected to a Guardline driveway alarm.
How can I get the contact sensor to work as a motion sensor for use in the Motion Lighting app? I setup a Virtual Motion Sensor but I can't figure out how to get the contact sensor to change the state.
Easiest way to do this would be to use RM instead of motion lighting app as it would allow you to use whatever event/condition you want to trigger the lighting and skip the virtual motion sensor all together.
Otherwise you would probably have to use RM to create a custom command that would control the virtual motion sensor's state and an RM rule that would control the custom commands based on the state of the contact sensor. There are also some community written drivers that allow for a virtual motion sensor with switch activation.
Plan A would be the easiest unless you have some super complicated motion lighting routine that may require more that one RM rule.
@halfrican.ak is absolutely correct. You can simply use Rule Machine. However, if you do have a more complicated setup, you can use contact sensors as motion sensors in apps that are designed to be used with motion sensors.
Create a new driver with the code from @cwwilson08
Then create a virtual device. Call it whatever you want.
Create a RM rule that turns on your virtual switch as motion device, when the contact sensor actuates. Just point to the virtual switch as motion device in motion lighting, or any other app you want to use it with.
@SmartHomePrimer this is almost perfect for my use case but I needed one without the auto-time off as this will be triggered by another device - Would you happen to know how to disable this feature on this driver code?