Announcement

Collapse
No announcement yet.

Trying to set a device string to another device's string

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

    Trying to set a device string to another device's string

    I am trying to execute the following immediate script command. There are two devices. The target is named "OLD_WAN_IP_ADDRESS". The second device has a ref id of 972.

    &hs.SetDeviceStringByName("OLD_WAN_IP_ADDRESS",$$DTR:972:,Tr ue))

    The following error shows in the log and the string does not get set
    Nov-06 17:52:00 Error Running script(1) &hs.SetDeviceStringByName("OLD_WAN_IP_ADDRESS",$$DTR:972:,Tr ue)), init error: Invalid character

    What am I doing wrong? Is it OK to use the $$DTR substitution as the second parm in the hs.SetDeviceStringByName function?

    Thanks,
    Robert

    #2
    You cannot use replacement variables in scripting. I think you can use "hs.DeviceString(972)". Scripting is not one of my strengths.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Thanks. I'll keep working on it.

      Comment


        #4
        Hs.setdevicestring(ref,hs.devicestring(ref2)).

        I do not have my reference with me, but it could be setdevicestringbyref and/or devicestringbyref. There could also be a third parameter for setdevicestring which is Boolean that is true to raise event trigger.

        From HS3Help.pdf. Name includes Location (Room), but don't know if it also includes Location2 (Floor)
        SetDeviceString
        SetDeviceStringByName
        DeviceString
        DeviceStringByName

        hs.SetDeviceStringByName("ItsLocation OLD_WAN_IP_ADDRESS",hs.DeviceString(972),true)

        If LastUpdateDate is to be updated use true. If not use false.

        Comment


          #5
          Got it to work after much learning about scripting. Thanks for the ideas and direction.

          Comment

          Working...
          X