Announcement

Collapse
No announcement yet.

Help with global variable ETDeviceName not being updated

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with global variable ETDeviceName not being updated

    I am trying to send an email when any device in a group has not changed for a set period of time (battery status not updated in a week). I updated to EasyTrigger beta 3.0.0.69 and everything looks great and the trigger works except the email does not replace the global variables with the current values. (This is the first time I have tried to include EasyTrigger global variables in an email)

    Here is the test event:
    Click image for larger version

Name:	Screen Shot 2019-09-19 at 1.30.24 PM.jpg
Views:	355
Size:	62.9 KB
ID:	1327719
    The email I get has the following body (no replacements):

    Device Name:
    $$GLOBALVAR:ETDeviceName:
    Floor:
    $$GLOBALVAR:ETDeviceLocation1:
    Room:
    $$GLOBALVAR:ETDeviceLocation2:
    Ref Number:
    $$GLOBALVAR:ETDeviceRef:
    Last Reported Value:
    $$GLOBALVAR:ETDeviceValue:
    Last Reported Status:
    $$GLOBALVAR:ETDeviceStatus:


    So I looked at the Tools>Global variables tab and saw this:

    Click image for larger version

Name:	Screen Shot 2019-09-19 at 1.16.43 PM.jpg
Views:	366
Size:	42.3 KB
ID:	1327720

    OK - so I disabled the ET plugin, then deleted the variables and restarted the plugin and they were recreated again as shown above.

    Then I deleted the variables again and manually created them with dummy data (using the add new variable at the bottom of the page. it then looked like this:
    Click image for larger version

Name:	Screen Shot 2019-09-19 at 1.16.04 PM.jpg
Views:	347
Size:	44.4 KB
ID:	1327721

    and the next time the email sent it had a body like this:

    Device Name:
    name test
    Floor:
    location 1 test
    Room:
    location 2 test
    Ref Number:
    1
    Last Reported Value:
    100
    Last Reported Status:
    status test



    So the global variables are now replaced in the email but the values are not updated when the event runs. I set EasyTrigger to debug and saw no errors when the event triggered (after I set the variables to the test values).

    So what am I missing? Any thoughts of what I should try next?

    Thanks
    Attached Files

    #2
    It's a bug, I forgot to set the variables for this specific trigger. I will fix it ASAP.

    Comment


      #3
      Thanks for the quick reply! I'll wait for the update and try again.

      Comment


        #4
        Originally posted by johnpeterson View Post
        Thanks for the quick reply! I'll wait for the update and try again.
        Please test version 3.0.0.70 which is in the Beta section.

        Comment


          #5
          Thanks for the new version but I think there is still a problem (different one):

          The device that triggered the event was the "Stove Light"

          The global variables tab shows the stove light:
          Click image for larger version

Name:	Screen Shot 2019-09-19 at 4.39.42 PM.jpg
Views:	351
Size:	32.6 KB
ID:	1327750

          But the email says bathroom light:

          Device Name:
          Light
          Floor:
          Bathroom
          Room:
          1st Floor
          Ref Number:
          337
          Last Reported Value:
          0
          Last Reported Status:
          Off



          The bathroom light happens to be the first device in the 1stFloorLights group

          Click image for larger version

Name:	Screen Shot 2019-09-19 at 4.39.10 PM.jpg
Views:	323
Size:	44.8 KB
ID:	1327751

          Thoughts?

          Comment


            #6
            Update - the information is wrong for just the first time the event runs. I ran it 3-4 more times and it worked fine.

            I then disabled the plugin, deleted the global variables, enabled the plug in and ran it again. The first email had the wrong information (still the bathroom light) but the next 3-4 times were correct.

            Comment


              #7
              Maybe add a few second Wait before the send email action.
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #8
                Originally posted by sparkman View Post
                Maybe add a few second Wait before the send email action.
                Adding a 5 second delay does resolve the issue.

                So as I understand the issue as it stands (with beta version 3.0.0.70): When the global variables etdevicename, etdeviceref, etdevicestatus, etdevicevalue, etdevicelocation1, etdevicelocation2 have not been previously set to any value, which would happen after a HS3 restart, an event that sets those variables and then sends an email that uses those variables may be grabbing those values before they have been properly set. Adding a short delay before creating the email resolves this. Any additional status changes that run the event again do not seem to have any issues and there is not need for any delay.

                Thanks Spud for all your work! Love the EasyTrigger plugin.

                Comment


                  #9
                  I'm thinking the initial delay may be because those global variables need to be initialized the first time they are used. Ideally spud would do that during plugin initialization so that this type of situation won't occur.
                  HS 4.2.8.0: 2134 Devices 1252 Events
                  Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                  Comment


                    #10
                    According to your event screenshot, here is what I think happen: when you start the EasyTrigger plugin if none of the 4 device values change during the next 2 minutes, then your event will be triggered 4 times (once for each device in the group), since this is happening almost at the same time and in parallel, the global variables are updated 4 times too, so an email action triggered by one device may use the global variables set to another device.
                    This is only a real problem at startup because after that there is little chance that 2 of your devices in the group trigger the event at the same time.

                    Comment

                    Working...
                    X