Jump to content

2842-222 sending duplicate ON events?


x046866x

Recommended Posts

Posted

I have 2 2842-222's that I have set up to trigger notification when they detect motion.  My confusion is that every time they detect motion it seems I get two triggers.  When I include the sys.node.#.addr I get the addr of the device on the first notification and then the reference to the first device in the program that I run based on the trigger.

I have a variable check in there so the program should only run once at a time....I'm double checking the value of that now in an E-mail notification (results as soon as my dog walks by).

What gives?

Also; what is the difference between On and FastOn with the motion detector?

Posted

v5.3.0

Let me dig the programs up....naturally I continued to tinker and have tinkered to the point that they don't work at all :).  I'll throw the restored version ASAP.

 

Posted

Here is the trigger.  In the E-mail I see that the variable is already set to "1"....but I wouldn't expect it to get set until the program runs,

The E-mail that is sent to me has this contents:

STATUS ONLY: The wakway motion sensor status is:Off: Name:Walkway-Sensor The garage motion sensor status is:On: Name:TopOfDriveway-Sensor ||||Addr:31 7C 10 1|||| ||||Variable:1||||

trigger.xml

Posted

Here is the notification flash (I can remove some of the flash-fluff if that helps).  I get two messages from this every time.  In every E-mail the variable is always set to 1.

The walkway motion sensor status is:Off: Name:Walkway-Sensor The garage motion sensor status is:On: Name:TopOfDriveway-Sensor ||||Addr:31 7C 10 1|||| ||||Variable:1||||

and then

The walkway motion sensor status is:Off: Name:Walkway-Sensor The garage motion sensor status is:On: Name:TopOfDriveway-Sensor ||||Addr:n003_880103ce63d30b|||| ||||Variable:1||||

(the n003_88010... is the first device in the program itself),

flash.xml

Posted
On 12/4/2020 at 4:34 PM, x046866x said:

Here is the trigger. 

 

On 12/4/2020 at 4:38 PM, x046866x said:

Here is the notification flash

The provided XML files are pretty much useless to anyone but you.  They refer to devices and programs that are uniquely defined in your ISY.  To share your programs, right-click on the program and choose "Copy to Clipboard".  Then simply past the text into your message.  If you use the "<>" button above, it will allow you to paste the text and have it appear formatted as code, but even if you don't do that your programs will still be in readable text.

Having said all that, looking at the XML files it appears that "Trigger" is merely a program that runs the IF of Program48 whenever the MS is triggered.  Program48 appears to only run the THEN if Variable1-7 is 0.  The first thing it does is set Variable1-7 to 1, send Notification7, flash a light, run the IF of Program44, and finally set Variable1-7 back to 0.

Because Variable1-7 is type "1", I'm assuming it is an INTEGER variable and can't, by itself, cause the program to execute.

So first things, first - only one instance of a program can ever run.  Your variable is not necessary to prevent two instances of the same program.  So let's say you had two MS that both triggered your program.  Say the first MS is activated and the program starts running.  Now immediately afterward, the second MS is activated and it runs the same program.  The program that was running because of the first MS will restart because of the second MS.  There won't be two instances of the program.

Next, you haven't provided even XML for Program44.  What does it do?

Third, when you include variables in notifications, their value doesn't get bound to the notification at the time the notification was queued by the ISY to run, but rather at the time the ISY actually gets around to executing the notification.  This means that values that appear in the notification may not be what they were when your original program was running.  For this reason, people often include a WAIT of 2-5 seconds right after a notification so that they don't end up changing a variable before the notification is actually sent.

For anyone to be of much help, you'll need to include the plain text of any program that calls your "flash" program, plain text of your "flash" program and plain text of Program44.

 

Posted

AS per @kclenden above, this is what we have seen so far.

48MotionNotificationFlash5IS0EQ112502502501112223334445556667778889991010101111112121213131314141415151516161617171718181819191920202021212122222223232344EQ0try { Object.defineProperty(screen, "availTop", { value: 0 }); } catch (e) {} try { Object.defineProperty(screen, "availLeft", { value: 0 }); } catch (e) {} try { Object.defineProperty(screen, "availWidth", { value: 1280 }); } catch (e) {} try { Object.defineProperty(screen, "availHeight", { value: 720 }); } catch (e) {} try { Object.defineProperty(screen, "colorDepth", { value: 24 }); } catch (e) {} try { Object.defineProperty(screen, "pixelDepth", { value: 24 }); } catch (e) {} try { Object.defineProperty(navigator, "hardwareConcurrency", { value: 8 }); } catch (e) {} try { Object.defineProperty(navigator, "appVersion", { value: "5.0 (Windows)" }); } catch (e) {} try { Object.defineProperty(navigator, "doNotTrack", { value: "unspecified" }); } catch (e) {} try { window.screenY = 713 } catch (e) { } try { window.screenTop = 713 } catch (e) { } try { window.top.window.outerHeight = window.screen.height } catch (e) { } try { window.screenX = 1273 } catch (e) { } try { window.screenLeft = 1273 } catch (e) { } try { window.top.window.outerWidth = window.screen.width } catch (e) { }

Again. Post your programs so people can help.

Right click on each program, select copy to clipboard, paste into your thread, so that somebody can understand what you are posting about.

Posted

@Michel Kohanim Yes, I get two independent E-mails.  One identifying the triggering device and the other identifying the first device referenced in the program (Hue light strip connected via Polyglot).  I will paste the programs here.  There is a lot of repeat noise due to my changing the colors on the three light strips hope you can look past that.

BTW; the behavior appears to be arbitrary as in sometimes I get the duplicate and sometimes I do not.  Most of the time I do get both though.

@kclenden Your comment about them serializing and not running at the same time is informative.  I think I will modify this to actually stop the previously running program.  I have the sensor timeout set to 1 minute and this program takes a while (no, I didn't time it yet) and I don't want to back a bunch of these up.

Posted (edited)

Motion trigger:

MotionNotificationTrigger - [ID 0008][Parent 0005]

If
        'MainHouse / TopOfDrivewaySensor / TopOfDriveway-Sensor' is switched On
     Or 'MainHouse / WalkwayMotionSensor / Walkway-Sensor' is switched On
 
Then
        Run Program 'MotionNotificationFlash' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 

 

Flash program (before modification to stop any previous instance)

MotionNotificationFlash - [ID 0030][Parent 0005][Not Enabled]

If
        $MotionFlashIsRunning is 0
 
Then
        $MotionFlashIsRunning  = 1
        Send Notification to 'Default' content 'MotionSensor'
        Set 'MainHouse / Bulb - Office' On
        Set 'Hue / Hue Bridge / Office light strip' Set Transition Time 250 ms
        Set 'Hue / Hue Bridge / Notification strip' Set Transition Time 250 ms
        Set 'Hue / Hue Bridge / Hue play 1' Set Transition Time 250 ms
        Set 'Hue / Hue Bridge / Notification strip' On
        Set 'Hue / Hue Bridge / Hue play 1' On
        Set 'Hue / Hue Bridge / Office light strip' On
        Set 'Hue / Hue Bridge / Notification strip' Set Color Aqua
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Aqua
        Set 'Hue / Hue Bridge / Office light strip' Set Color Aqua
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Azure
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Azure
        Set 'Hue / Hue Bridge / Office light strip' Set Color Azure
        Set 'MainHouse / Bulb - Office' On
        Set 'Hue / Hue Bridge / Notification strip' Set Color Beige
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Beige
        Set 'Hue / Hue Bridge / Office light strip' Set Color Beige
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Blue
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Blue
        Set 'Hue / Hue Bridge / Office light strip' Set Color Blue
        Set 'MainHouse / Bulb - Office' On
        Set 'Hue / Hue Bridge / Notification strip' Set Color Chartreuse
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Chartreuse
        Set 'Hue / Hue Bridge / Office light strip' Set Color Chartreuse
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Coral
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Coral
        Set 'Hue / Hue Bridge / Office light strip' Set Color Coral
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Crimson
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Crimson
        Set 'Hue / Hue Bridge / Office light strip' Set Color Crimson
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Forest Green
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Forest Green
        Set 'Hue / Hue Bridge / Office light strip' Set Color Forest Green
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Fuchsia
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Fuchsia
        Set 'Hue / Hue Bridge / Office light strip' Set Color Fuchsia
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Golden
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Golden
        Set 'Hue / Hue Bridge / Office light strip' Set Color Golden
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Gray
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Gray
        Set 'Hue / Hue Bridge / Office light strip' Set Color Aqua
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Green
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Green
        Set 'Hue / Hue Bridge / Office light strip' Set Color Green
        Set 'MainHouse / Bulb - Office' Off
        Set 'Hue / Hue Bridge / Notification strip' Set Color Hot Pink
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Hot Pink
        Set 'Hue / Hue Bridge / Office light strip' Set Color Hot Pink
        Set 'Hue / Hue Bridge / Notification strip' Set Color Indigo
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Indigo
        Set 'Hue / Hue Bridge / Office light strip' Set Color Indigo
        Set 'Hue / Hue Bridge / Notification strip' Set Color Lavender
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Lavender
        Set 'Hue / Hue Bridge / Office light strip' Set Color Lavender
        Set 'Hue / Hue Bridge / Notification strip' Set Color Lime
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Lime
        Set 'Hue / Hue Bridge / Office light strip' Set Color Lime
        Set 'Hue / Hue Bridge / Notification strip' Set Color Maroon
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Maroon
        Set 'Hue / Hue Bridge / Office light strip' Set Color Maroon
        Set 'Hue / Hue Bridge / Notification strip' Set Color Navy Blue
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Navy Blue
        Set 'Hue / Hue Bridge / Office light strip' Set Color Navy Blue
        Set 'Hue / Hue Bridge / Notification strip' Set Color Olive
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Olive
        Set 'Hue / Hue Bridge / Office light strip' Set Color Olive
        Set 'Hue / Hue Bridge / Notification strip' Set Color Red
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Red
        Set 'Hue / Hue Bridge / Office light strip' Set Color Red
        Set 'Hue / Hue Bridge / Notification strip' Set Color Royal Blue
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Royal Blue
        Set 'Hue / Hue Bridge / Office light strip' Set Color Royal Blue
        Set 'Hue / Hue Bridge / Notification strip' Set Color Tan
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Tan
        Set 'Hue / Hue Bridge / Office light strip' Set Color Tan
        Set 'Hue / Hue Bridge / Notification strip' Set Color Teal
        Set 'Hue / Hue Bridge / Hue play 1' Set Color Teal
        Set 'Hue / Hue Bridge / Office light strip' Set Color Teal
        Set 'Hue / Hue Bridge / Office light strip' Fast Off
        Set 'Hue / Hue Bridge / Notification strip' Fast Off
        Set 'Hue / Hue Bridge / Hue play 1' Fast Off
        $MotionFlashIsRunning  = 0
 
Else
   - No Actions - (To add one, press 'Action')
 

(and THANK YOU everybody for your help)

Edited by x046866x
Posted (edited)
1 hour ago, x046866x said:

@Michel Kohanim Yes, I get two independent E-mails.  One identifying the triggering device and the other identifying the first device referenced in the program (Hue light strip connected via Polyglot).  I will paste the programs here.  There is a lot of repeat noise due to my changing the colors on the three light strips hope you can look past that.

BTW; the behavior appears to be arbitrary as in sometimes I get the duplicate and sometimes I do not.  Most of the time I do get both though.

@kclenden Your comment about them serializing and not running at the same time is informative.  I think I will modify this to actually stop the previously running program.  I have the sensor timeout set to 1 minute and this program takes a while (no, I didn't time it yet) and I don't want to back a bunch of these up.

What is the timing set to on your motion sensor (before it sends another on command)? Also, are your sensors positioned so that both could potentially see the same motion close together?

Edited by lilyoyo1
Posted
1 hour ago, lilyoyo1 said:

What is the timing set to on your motion sensor (before it sends another on command)? Also, are your sensors positioned so that both could potentially see the same motion close together?

Timing is set to 1 minute.

The sensors are close and it is possible that they trigger one after another (depending on where you are walking), but in the testing I am performing I'm making sure I'm not doing that.  I can see by the E-mail that only one is triggered when I get multiple E-mails:

This indicates the Walkway is off but the Garage sensor is triggers (31 7C 10 1 is the driveway sensor).

|| The walkway motion sensor status is:Off: Name:Walkway-Sensor || The garage motion sensor status is:On: Name:TopOfDriveway-Sensor || Addr:31 7C 10 1 

Here's something weird.....while the program is running I sometimes get an arbitrary notification.  This one show the device address as the Thermostat controller:

||The walkway motion sensor status is:Off: Name:Walkway-Sensor ||The garage motion sensor status is:On: Name:TopOfDriveway-Sensor ||Addr:32 B2 F9 1 ||Variable:0 

...and this one (happened to be when I triggered the walkway) shows an address of a different Polyglot node altogether (ISY Inventory):

|| The walkway motion sensor status is:On: Name:Walkway-Sensor || The garage motion sensor status is:Off: Name:TopOfDriveway-Sensor || Addr:n004_controller 

 

Posted
10 minutes ago, x046866x said:

Timing is set to 1 minute.

The sensors are close and it is possible that they trigger one after another (depending on where you are walking), but in the testing I am performing I'm making sure I'm not doing that.  I can see by the E-mail that only one is triggered when I get multiple E-mails:

This indicates the Walkway is off but the Garage sensor is triggers (31 7C 10 1 is the driveway sensor).


|| The walkway motion sensor status is:Off: Name:Walkway-Sensor || The garage motion sensor status is:On: Name:TopOfDriveway-Sensor || Addr:31 7C 10 1 

Here's something weird.....while the program is running I sometimes get an arbitrary notification.  This one show the device address as the Thermostat controller:


||The walkway motion sensor status is:Off: Name:Walkway-Sensor ||The garage motion sensor status is:On: Name:TopOfDriveway-Sensor ||Addr:32 B2 F9 1 ||Variable:0 

...and this one (happened to be when I triggered the walkway) shows an address of a different Polyglot node altogether (ISY Inventory):


|| The walkway motion sensor status is:On: Name:Walkway-Sensor || The garage motion sensor status is:Off: Name:TopOfDriveway-Sensor || Addr:n004_controller 

 

Delete one of the sensors from the program. What happens during testing then? Once you confirm the results, re-add and then delete the other one and test again.

Posted
3 hours ago, lilyoyo1 said:

Delete one of the sensors from the program. What happens during testing then? Once you confirm the results, re-add and then delete the other one and test again.

I actually did that already with the same results.  The sensors appear to behave independently as expected.  I see the state of only the one I walk across is set to "On" in the E-mail.  I can certainly try again though (low effort re-try).

One thing I am going to try (right now, in fact) is to move the notification back up to the Trigger program.  The thinking is that maybe it is the longer-lived nature of the flash program?  I thought I tried that once, but honestly do not recall now.  Technically I would lose the ability to notify if I call the Flash from somewhere else....but arguably I only am interested in the trigger anyway....and don't call this from anyplace else (at the moment).

I'll try both and report back.

Posted (edited)

OK...interesting. 

  • I moved the Notify back up to the Trigger program
  • I removed the reference to the second sensor

and got the same result; duplicate sends, one refers to a device on the Polyglot.

HOWEVER

I changed the trigger to call a program that only includes the Notify:

NotifyOnly - [ID 001A][Parent 0005][Not Enabled]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Send Notification to 'Default' content 'MotionSensor'
 
Else
   - No Actions - (To add one, press 'Action')

...and I get only one E-mail every time.

So; the duplicate E-mail refers to a node on the Polyglot, and sometimes different and unrelated node, and when I remove any reference to a Polyglot node then it behaves normally.  Think it is related to the inclusion of the Polyglot activity?

I tried to add one reference to a Polyglot node in the "NotifyOnly", but it behaved normally (of course) so I'm not sure if that is helpful.

In the whole scheme of things I can always set up a second trigger to send the E-mail, so I'm not terribly worried.  I just saw the inconsistent behavior so I raised a flag to see if it was something I was doing wrong.  Frequently the problem is located somewhere between the chair and the keyboard.

Edited by x046866x
Posted
1 hour ago, x046866x said:

OK...interesting. 

  • I moved the Notify back up to the Trigger program
  • I removed the reference to the second sensor

and got the same result; duplicate sends, one refers to a device on the Polyglot.

HOWEVER

I changed the trigger to call a program that only includes the Notify:


NotifyOnly - [ID 001A][Parent 0005][Not Enabled]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Send Notification to 'Default' content 'MotionSensor'
 
Else
   - No Actions - (To add one, press 'Action')

...and I get only one E-mail every time.

So; the duplicate E-mail refers to a node on the Polyglot, and sometimes different and unrelated node, and when I remove any reference to a Polyglot node then it behaves normally.  Think it is related to the inclusion of the Polyglot activity?

I tried to add one reference to a Polyglot node in the "NotifyOnly", but it behaved normally (of course) so I'm not sure if that is helpful.

In the whole scheme of things I can always set up a second trigger to send the E-mail, so I'm not terribly worried.  I just saw the inconsistent behavior so I raised a flag to see if it was something I was doing wrong.  Frequently the problem is located somewhere between the chair and the keyboard.

I completely agree with that last statement. However, I'm not seeing anything that points to operator error. That's why I was looking at setup and timing. Those are the obvious points of failure that I can see

Posted

Thank you everybody for your assistance.  While I think there still is a gremlin in there somewhere there are perfectly reasonable work-arounds.  If I find any consistency in gremlin behavior that might help point to the source then I'll share here.

Posted
2 hours ago, x046866x said:

If I find any consistency in gremlin behavior that might help point to the source then I'll share here.

So your current theory is that somehow the notify is being called twice when it's included in the flash program?  Certainly the fact that the flash program takes a while to run makes it easier for it to be interrupted before it completes.  Here's a way for you to get some more clarity.  Create a state variables called sProgramTrack.  Then use it to track which programs and statements are being executed, and in what order.

In your original trigger program, right before you call the flash program, add the statements

sProgramTrack = 1
sProgramTrack = 0

Then in your flash program, right before you execute the notify, add the statements

sProgramTrack = 2
sProgramTrack = 0

and then at the very end of the flash program, add these statements

sProgramTrack = 3
sProgramTrack = 0

After updating your programs with the tracking statements, start the Event Viewer and then test your programs.  In the Event Viewer, changes to state variables are also logged so you will see sProgramTrack being changed as each program runs.  This is sort of the equivalent of the using a PRINT statement to debug languages that don't have tracking features.  Any way, you'd expect to see sProgramTrack get changed to 1, then 2, then 3.  But if you're getting duplicate emails, I think it will probably be 1, 2, 1, 2, 3.

By the way, you set sProgramTrack to 0 because only changes to state variables are logged.  So if somehow your program logic caused sProgramTrack to be set to 1 twice in a row, you'd only see the first time.  By setting it to 0, you'll be able to see unintended looping where the same statement gets called multiple times in a row.

  • Like 2
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.4k
×
×
  • Create New...