"Debounce a Contact Sensor" in RM

Were on about the contact sensor issue in this particular thread, if I start dealing with another issue at the same time, ill never keep them straight...
I'm already getting them confused

I'm using the Generic Zwave contact sensor in firmware 2.1.5.124, and I don't see any "Suppress duplicate contact events" option. I WAS having duplicate events in 2.1.4, but @mike.maxwell and @bravenel modified the Generic Zwave drivers for 2.1.5 and my problems went away. But it seems weird to me we are running the same driver and have different options available. You are running 2.1.5, right?

I'm on ver 2.1.5.124

Here's a screenshot of the device page showing the "Suppress":

Mike, after failing repeatedly yesterday, the errant driveway contact sensor did NOT chatter this morning. I did test it with suppression on, but only once. I also increased the delay time in my RM 2.5. Here's the live log of it working properly. If it fails again, I'll see if I can catch it in the logs.

That is so weird. Maybe it is because we have different sensors, but I'm surprised the device pages are so different with the same firmware and driver. Mine looks like this:

He has the Ecolink which is notorious for multiple event reporting. That's why the option to suppress those messages shows up for him and not you. You aren't using an Ecolink device, are you?

No, mine are old Aeon sensors. They were constantly double reporting before the driver was fixed in 2.1.5. My Ecolink motion sensors also, and also fixed (but that is a different thread). I was just surprised that the driver exposed different options based on the detected hardware. That is more sophistication that I expected from a "generic" driver.

We get tricky from time to time, generic doesnt mean lame...

3 Likes

I am having the same "multiples" issue with a Zooz ZSE29 outdoor motion sensor that I just got. I am using it with a Motion Lighting App.

My zooz 4-in-1 does double events also so I modified Bruce's contact debouncer to do motion.

definition(
        name: "Debounce motion",
        namespace: "hubitat",
        author: "Bruce Ravenel",
        description: "Debounce double reporting motion sensor",
        category: "Convenience",
        iconUrl: "",
        iconX2Url: "")

    preferences {
    	page(name: "mainPage")
    }

    def mainPage() {
    	dynamicPage(name: "mainPage", title: " ", install: true, uninstall: true) {
    		section {
    			input "thisName", "text", title: "Name this debouncer; debounced motion device will have this name", submitOnChange: true
    			if(thisName) app.updateLabel("$thisName") else app.updateSetting("thisName", "Debounce motion")
    			input "motion", "capability.motionSensor", title: "Select Motion Sensor", submitOnChange: true, required: true
    			input "delayTime", "number", title: "Enter number of milliseconds to delay for debounce", submitOnChange: true, defaultValue: 1000
    		}
    	}
    }

    def installed() {
    	initialize()
    }

    def updated() {
    	unsubscribe()
    	unschedule()
    	initialize()
    }

    def initialize() {
    	def debounceDev = getChildDevice("debounceSwitch_${app.id}")
    	if(!debounceDev) debounceDev = addChildDevice("hubitat", "Virtual Motion Sensor", "debounceSwitch_${app.id}", null, [label: thisName, name: thisName])
    	subscribe(motion, "motion", handler)
    }

    def handler(evt) {
    	runInMillis(delayTime, debounced, [data: [o: evt.value]])
    	//log.info "Motion $evt.device $evt.value, start delay of $delayTime milliseconds"
    }

    def debounced(data) {
    	//log.info "Debounced motion $data.o"
    	def debounceDev = getChildDevice("debounceSwitch_${app.id}")
    	if(data.o == "active") debounceDev.active() else debounceDev.inactive()
    }

@jon1 I saw Bruce said that could be done but I don't have any experience with that programming so I didn't know what to do. Thank you for modifying. I will give it a shot.

Platform 2.1.6 will have an update to this driver that includes a preference option to disable dup events.

2 Likes

Woo hoo! My Mighty Mule driveway announcer hack uses the flash from the LED to close the contact. It usually flashes 2 or 3 times.

It looks like I will just wait for the 2.1.6 update. The bounce is faster than the Debounce can stop.

It looks like its working properly. Your physical device dev:566 that sends double events, the logical debounced device is dev:580, only one event, this is the one you should use for your automations. Turn off logging on 566 if it bothers you.

Ohh, i get it now. I misunderstood. I thought the debounce app stopped the device's second motion from going active the 2nd time but it actually just is a virtual device that replaces the actual device for any automations.

I have a rule that turns on exterior lights when my Ring Doorbell detects motion then turns off lights on a 10 minutes delay. Unfortunately, the lights turning off triggers motion on the Ring so I created a virtual switch that turns on also at motion and then is delayed 12 minutes then turns off. The lights can only be turned on again if that virtual switch is also off. I found that if there was only a 1 minute difference in delay, the virtual switch would sometime turn off first thereby not doing its job. Long story short, I had it in my head that this debounce app did similar. It's obvious now.

Thanks for clarifying.

Ah man, when you said "this driver" I thought you were talking about the driver I was using (Generic Z-wave Motion Sensor), not the Zooz 4-in-1 that @jon1 has. I just installed update and learned the truth. No big deal because the Debounce virtual motion is working like a champ.

FYI in case it helps troubleshoot this issue....I just moved over to Hubitat and am getting things setup. I have BeSense IM20 contact sensors and with firmware v2.1.6.118 and the builtin Generic Z-wave Contact Sensor driver used for the IM20's, I was getting duplicate events similar to the ones described in this thread. I tried switching over to the Fibaro door/window sensor 2 driver and the duplicates went away.

1 Like

Thanks @bravenel for this app. I put a contact sensor on a stair gate that would get rattled a bit on opening or closing's. This was just what I needed to correct the human error that was triggering a rule multiple times.