Device Sleep Issue/DTH Request

Due to my very low level of editing DTHs and creating my own, I am hoping this community could assist me.

I am using my existing smoke/co detectors in the home with a relay/and dry contact sensor (Aeotec by Aeon Labs ZW097-A Dry Contact Sensor Gen5) and a custom DTH that allows the sensor to report like a Smoke detector.

It works great except for one issue, the contact sensor sleeps and causes the New Smartthings App to report it as offline throughout the day. Did not have this issue in the original ST app. This obviously is not only a nuisance, but impacts my ability to effectively use it as part of the Security features in Smartthings as it will throw errors when arming the alarm.

Can anyone provide edits to the DTH (or offer a alternative version) that would resolve this? I am thinking I need to find a way to change the DTH to not care about the device going to sleep (may not be possible as a Smoke device?) or to create a separate Virtual Smoke DTH that my current one can toggle, which would eliminate the sleep issue. I thought something similar to the Alexa simulated switch DTH that couples a switch and contact sensor as an intermediary, but I am not skilled in this area to make those changes.

Any advice? I have pasted the DTH from @vseven below that I am using.

I’ve not got my thinking head on, but try changing line 109 (I think - the one with checkInterval on it) to

sendEvent(name: "DeviceWatch-Enroll", value: [protocol: "zwave", scheme:"untracked"].encodeAsJson(), displayed: false)

You’ll need to edit and update the device in the IDE when you’ve done, so it gets run.

Health Check lacks documentation but hopefully there isn’t a conflict between that and checkInterval.

Also I just did a fresh download of SmartThings generic contact code and re-modified it:

Notice the -2 at the end. See if that is better. Their code is defaulting to a 8 hour check interval.

Thank you both. I am going to see how @vseven’s updated DTH works and go from there!

Just checking in. Did the newer DTH work? If so I’ll wipe out the old one and replace it with the new one.

Hey Allan!

Yes, so far it is working great. All I did was update your DTH. Been sitting on it making sure it didn’t act up. All seems to be very good!

Thank you!

Cool. I’m going to delete the “-2” DTH and just put the changes into the original. Then I’ll update the other for CO so they both work.