This works perfectly for a single device. I have VERY limited scripting knowledge and would like to enhance this script to include up to 5 devices. What do I need to add?
Thanks
Sub Main(parm as object)
dim aVal() as string
dim sVal as string
sVal = hs.deviceString("[2")
aVal = split(sVal, ">")
hs.writelog ("Test",aVal(1))
' You can assign the aVal(1) to a virtual device
hs.setDeviceString("V1", aVal(1))
End Sub
Announcement
Collapse
No announcement yet.
Virtual field without graphic
Collapse
X
-
OK.
Struggling more with this than I thought...
I need to run this script each time the status of the device "DooMotion Plugin Last Motion" changes. How do I set the trigger????
Leave a comment:
-
Sorry about that.
Code:Sub Main(parm as object) dim aVal() as string dim sVal as string sVal = hs.deviceString("[2") aVal = split(sVal, ">") hs.writelog ("Test",aVal(1)) ' You can assign the aVal(1) to a virtual device hs.setDeviceString("V1", aVal(1)) End Sub
Leave a comment:
-
oops...
I have attached the scrip (.txt was added to load into message board)
OK changed to .vb and get the following in the log....
Event Trigger "Last Motion"
1/10/2010 8:30:16 PM Event Running script in background: xLobby Last Motion.vb
1/10/2010 8:30:16 PM Error Script compile error: Method arguments must be enclosed in parentheses.on line 22
1/10/2010 8:30:16 PM SCR Option Strict Offimports Schedulerimports SystemPublic Module scriptcode7#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin Public WithEvents hs As Scheduler.hsapplication Public WithEvents hsp As scheduler.hsp Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionSub Main(parm as object)dim aVal() as stringdim sVal as stringsVal = hs.deviceString("[2")aVal = split(sVal, ">")hs.writelog ("Test",aVal(1))' You can assign the aVal(1) to a virtual devicehs.setDeviceString "x20", aVal(1)End SubEnd ModuleAttached FilesLast edited by gelessor; January 10, 2010, 08:48 PM.
Leave a comment:
-
Getting this error in the log....
1/10/2010 6:17:03 PM Event Event Trigger "Last Motion"
1/10/2010 6:17:03 PM Event Running script in background: xLobby Last Motion
1/10/2010 6:17:03 PM Error Running script, script run or compile error in file: xLobby Last Motion1006:Expected ')' in line 1 More info: Expected ')'
1
Leave a comment:
-
Try this.
Code:Sub Main(parm as object) dim aVal() as string dim sVal as string sVal = hs.deviceString("[2") aVal = split(sVal, ">") hs.writelog ("Test",aVal(1)) ' You can assign the aVal(1) to a virtual device hs.setDeviceString "V1", aVal(1) End Sub
Leave a comment:
-
OK. Here you go...
<img alt=""src="/Images/DooMotion/hspi_doomotion.gif align="absmiddle">Kitchen Motion
Leave a comment:
-
Try this command. I need to see the actual html and not the image
Go to the control tab and run this:
&msgbox(hs.deviceString("[2"))
Leave a comment:
Leave a comment: