Announcement

Collapse
No announcement yet.

Issue with GlobalVar and SetDeviceValueByRef

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

    Issue with GlobalVar and SetDeviceValueByRef

    Can someone tell me what the issue is with the syntax of: &hs.SetDeviceValueByRef(1419, $$GLOBALVAR:ifttt_AQI:, True)

    Log File: Error Running script(2) &hs.SetDeviceValueByRef(1419, $$GLOBALVAR:ifttt_AQI:, True), init error: Invalid character

    I am trying to set the Value of a Virtual Device. I have tried several changes and can't come up with the solution. I have the same GlobalVar syntax in an email inside this event that works just fine. The String a 1 to 3 digit number with an AQI reading.

    Thanks,

    Mark


    Click image for larger version

Name:	IMG_5404.jpg
Views:	64
Size:	66.7 KB
ID:	1427940

    #2
    I am not much of a scripting person but I recall having used tenScripting and it helps a lot. You might want to check it out. Btw, do you really need the double dollar sign?

    Comment


      #3
      You can't use replacement variables in any scripting function. They are not automatically replaced except in emails and TTS: http://help.homeseer.com/help/HS3/st...ment_variables

      So in a script you would need to use the ReplaceVariables function or directly get the value of the global var from your script.

      Comment


        #4
        Thanks Spud!

        This worked perfectly: &hs.SetDeviceValueByRef(1419, hs.replacevariables("$$GLOBALVAR:ifttt_AQI:"), True)

        Mark

        Comment

        Working...
        X