Notifications App is sending 3 text messages for each event

FYI, this shows the 3 text messages that were sent at 6:02 AM

texts

Here is a total shot in the dark, change notify device to Pixel 3XL. Your Pixel 3 xl may be interpreted as 3 times

1 Like

The device name shouldn't matter. :slight_smile:

What's more likely: are you sure the contact sensor isn't sending multiple "opened" or "closed" events? Check your live logs as you open (or close) it and see what happens (assuming you have descriptionText logging enabled for this device on a standard driver or the equivalent on a custom driver; or in any case you can probably check the "Events" tab on the device page for history). For example, users of a certain other platform have noticed the Ecolink contact sensor sends duplicate events: Ecolink Z-Wave plus *ALMOST* always throws duplicate messages - Devices & Integrations - SmartThings Community. A revered Hubitat user and Z-Wave expert has found a way to eliminate one of these (porting the ST driver and removing some code, the closest we can get without the Hubitat driver being open source or them having a separate driver for devices like these): Aeotec Siren 6 is FINALLY here (I know, the thread title sounds unrelated, but...).

That being said, I'm not sure where the third event would be coming from since these are normally just two, but in any case, seeing what the device is actually doing would be a good first step. It's quite likely the Notifications app is just blindly sending one each time this happens. Regardless of the cause, you can probably work around this in Notifications by utilizing the option to only send once every x minutes or similar, and in RM you can work around it by setting the rule's private boolean and un-doing it after your desired period of time (a few seconds?) if there are no further "open"s.

2 Likes

Thanks ... I did most of the testing with just the Pixel 3XL being the notification and it was still sending multiple notifications, although just 2 vs. 3 messages. I'm going to change it back to just the Pixel 3XL for testing (and no text messaging). Also, my understanding is we're limited to 10 text message per day, right?

Thank you for the insight ... I didn't have logging setup on the device, but I do now. So I'll do some testing and see what happens. I'll also try your suggestions of extending the minutes in the Notifications App and trying RM again.
:slightly_smiling_face:

FYI, I just did some testing and this is the log, which shows the sensor saying it was closed twice.

I believe you are correct about the 10/day limit. As I live alone it's not something that has been a problem. Good luck with your testing.

1 Like

@bertabcd1234, I've been testing different methods, including variants of Notifications, Hubitat Safety Monitor and Rule Machine 4.0. All of the tests normally now yield 2 notifications. This is also shown in the logs.

I'm beginning to think, as you said, that the sensor is sending 2 duplicate events. Therefore, is there a way to find, or create, a specific device driver for the Aeotec Door/Window Sensor 6? I'm currently using the Generic Z-Wave Contact Sensor.

I've also attempted to use the private boolean, as you suggested. Although, I really am a novice and haven't been able to figure out how to set the rule's private boolean and un-doing it after a desired period of time.

Thanks

I’m having the same issues with the ecolink devices

I pulled down a smartthings driver and updated with help of somebody in the forum.

I’m now getting only one notification.

Maybe you can do the same ?

1 Like

Thanks @mik3. Hopefully that will work.

I looked and found a SmartThings driver that might work for the "Aeon Water Sensor (DSB45-ZWEU/DSB45-ZWUS)". I copied it over to my, newly created, Github account at ... Aeon-Labs-Water-Sensor-DSB45-SWUS/Existing Public Driver at master · olliesshop/Aeon-Labs-Water-Sensor-DSB45-SWUS · GitHub

We'll see how it goes. Maybe I'll even give it a try, but I'm a newbie to modifying a driver, so I would probably do more harm than good.

Update ... I modified the Existing SmartThings driver, by replacing "physicalgraph" with "hubitat". It works, but still gives 2 alerts per event.

So, I've now tried 3 different drivers; the "Generic Z-Wave Contact Sensor", the "Generic Z-Wave Water Sensor" and now the new "Aeon Water Sensor" I just created. Does that mean it's not the Driver causing the duplicate alerts?

This is the new/modified "Aeon Water Sensor" driver ... Aeon-Labs-Water-Sensor-DSB45-SWUS/Modified ST Driver for Hubitat at master · olliesshop/Aeon-Labs-Water-Sensor-DSB45-SWUS · GitHub

Thanks

But did you make the modifications krlaframboise suggested in the other thread? (I think that was for a different type of device, so you'd have to figure out what the equivalent is here, and this is assuming it's the same cause, but it's likely reporting the event multiple times via different Z-Wave command classes.)

Staff stated in the last Hubitat Live episode that they would look into this behavior, but I think they were only aware of it for the Ecolinks. If the same issue fixes it for you with the Aeon, they may want to know about that too (assuming it's a contact sensor).

1 Like

@bertabcd1234 ... I read through that thread before, but really didn't understand much, since I'm such a newbie. Although, now I'm a little more familiar with the code, so hopefully I'll be able to make the modifications. Thanks.

If you open logging, open the contact sensor, wait 10 seconds, close it, and then post the logs I'll be able to tell you which lines to comment out?

1 Like

That's great ... here's the log. I opened the sensor (put it in the water), waited 10 seconds, then closed the sensor (took it out of the water). Thanks!

This is the first log I did and it seemed to have it backward. As in Dry first, then wet.

So I ran the test again and I think it's correct, being wet first, then dry

It's creating 2 water events so receiving 2 text messages makes sense, but not 3... It looks like the notification app is also throwing an exception so maybe that has something to do with it, but I thought that error was fixed in update 2.1.2.

The Ecolink device sends a Notification Report and a Basic Report every time the contact changes so all you had to do to fix the problem for that device was prevent one of those reports from creating the event by commenting out some code.

Your device is sending 2 of the same type of report so there really isn't a simple solution, but using runIn to delay the creation of the water event by 1 second might solve the problem.

When runIn is used to schedule a method Hubitat should overwrite any existing schedules for that method which would eliminate the duplicate, but since the method would be scheduled twice within 20ms I'm not sure if the overwrite feature will work as expected.

You should have a block of code that starts with the following and ends with }:

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd) {

Try replacing that entire block of code with the 2 blocks of code below and see if that solves the problem:

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd) {
	log.debug "$cmd"
	runIn(1, createWaterEvent, [data:[value:cmd.value ? "wet" : "dry"]])	
	return []
}

def createWaterEvent(data) {
	log.info "water is ${data?.value}"
	if (data?.value) {		
		sendEvent(name:"water", value:data.value)
	}
}

If that doesn't work, another possible solution is to ignore one of the reports based on the isMulticast value since one is true and the other is false, but if that behavior changes at some point it could end up ignoring both reports so it's probably not worth risking.

The device might also have some association group related settings that could solve the problem, but I don't have time to look into that.

1 Like

This bug persists in 2.1.2. Fixed in 2.1.3, yet to be released.

4 Likes

@krlaframboise - You're Amazing ... It worked! Happy Day :smiley:

I put the RunIn code you provided into the driver code and it only gave 1 Alert on my Pixel 3XL and 1 text message, which is perfect. Thank you!

Also, here's the log from the last test. It always seems to give a Java error for some reason.

I'm glad to hear it worked, I really wasn't expecting it to.

That error message is a known bug that will be fixed in the next hub update.

1 Like

Thanks again, it sure is nice not having that issue anymore and about the Java error. I sure have learned a lot with this project, but still a long way to go.