Announcement

Collapse
No announcement yet.

$$DVR operator using Global Variables and Math

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

  • $$DVR operator using Global Variables and Math

    I can't seem to find this in the forums, so I'd appreciate any help.

    I have a simple event that triggers if one of a group of locks changes state to unlocked. If that happens, I want to send the identification of the lock as well as the last code entered on the keypad. The keypad code is reported on a different device than the lock status, but the reference # of that device is always +1 to the reference number of the lock.
    So I have a simple event that triggers on the group, and then sends an email message using the following global variables to report on the lock itself:

    $$GLOBALVAR:ETDeviceLocation2:,
    $$GLOBALVAR:ETDeviceLocation1:
    $$GLOBALVAR:ETDeviceName:
    $$GLOBALVAR:ETDeviceStatus:

    In order to get the keypad code, I used $$GLOBALVAR:ETDeviceRef: and add +1 and try and get that value like:
    $$DVR:$$GLOBALVAR:ETDeviceRef: + 1:

    But the message ends up showing something like
    $$DVR:640 + 1:

    In other words, it doesn't do the math, add the two numbers, and use the resulting sum as the reference.

    Am I doing something wrong, or is this use of simply math in a $$DVR: : function just not allowed? If not, any simple workarounds that people know of?


  • #2
    I don't know how the $$DVR:: replacement variables are handled internally in Homeseer but I doubt you can use math inside them, or even recursively use them.
    So to do what you want I think you will need to use a script and the ReplaceVariable function: https://help.homeseer.com/help/HS3/s...placevariables

    Comment


    • #3
      Unfortunately, I don't think I can use that to modify the body of an email. But its still a big help to have it confirmed that I was on the wrong path. Much appreciated! I'll figure another way.

      Comment


      • #4
        Originally posted by jvm View Post
        Unfortunately, I don't think I can use that to modify the body of an email. But its still a big help to have it confirmed that I was on the wrong path. Much appreciated! I'll figure another way.
        It’s possible to modify the body of an email in a script. Alternately, I have a lock notification script that can notify you via email and pushover (https://forums.homeseer.com/forum/de...-events-script).
        Last edited by sparkman; November 19th, 2018, 07:38 PM.
        HS 3.0.0.548: 1976 Devices 1156 Events
        Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

        Comment

        Working...
        X