Aqara contact multiple state changes

Using MCCGQ11LM contact sensor on an automatic chicken coop door. Raises vertically about 12 inches in the morning and lowers again at night, based on ambient light setting. So one open and one close per day. Sensor is fixed on the metal runner frame and magnet is on moving door right next to it.

Connected via Hubitat HE running 2.3.5.141 although it has been through a couple of updates since I put the sensor in place.

I then have that connected into Home Assistant with a notification to mobile phone, triggered only when the state changes from open -> closed or vice-versa (i.e. different from and to states), not if I get multiple open -> open or closed -> closed states.

All is working except that HE is producing multiple state changes so I get multiple notifications at either open or close time. If the door is open, I typically get a closed, open, then final closed notification all within a fraction of a second. If it is closed, I get an open, closed then final open notification.

HE is producing multiple events that get passed through to Home Assistant and for the life of me I don't know why. This is from the open yesterday morning:

Here is the corresponding log info:

Any ideas appreciated.

Driver info:

Can you post a screenshot of the Preferences section for this device?

I am using a slightly modified version of the same driver, and for me it behaves as expected.

It looks like a typical contact bouncing caused by the chicken coop door vibration during the vertical movement... This driver does not have a contact debouncing option, but you can search this forum on how to add a debouncing function for a virtual contact sensor using the Rule Machine, for example.

1 Like

Hey thanks for jumping in here. The alignment to get a closed reading is pretty specific i.e. you can't move the contact very much one way or the other and keep the same state. I would not expect that a movement enough to change state could then fall back to closed or vice-versa. But, that being said, easier to implement a debounce on the hubitat side or just add extra automation trigger logic on the home assistant side ?

UPDATE: Added "for 2 secs" on the automation notification trigger. Also found a post that suggested having the magnet too close could cause bounce so can try that too.

1 Like