Announcement
Collapse
No announcement yet.
Trying to set a device string to another device's string
Collapse
X
-
Got it to work after much learning about scripting. Thanks for the ideas and direction.
-
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.
Leave a comment:
-
You cannot use replacement variables in scripting. I think you can use "hs.DeviceString(972)". Scripting is not one of my strengths.
Leave a comment:
-
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
Tags: None
Leave a comment: