A little HELP for security SCRIPTING
A little HELP for security SCRIPTING
Hi all, i need you SCRIPTS GURUS![:D]
I use Blade security plugin for homeseer; what i need is a script that:
sends an email using voipbuster , I HAVE IT:
<font color="red">&hs.launch "iexplore.exe", "https://myaccount.voipbuster.com/clx/se ... lmn"</font id="red">
PROBLEM is in TEXT , here i'd like to insert STATUS OF MOTION SENSORS USED by the plugin: about status i have a vb script:
<font color="red">&For Each d As String In hs.Plugin("BLSecurity").GetSecurityDevicesInAlert()
hs.writelog("Info", "Device: " & d & " is a device in alert!")
Next</font id="red">
how can i insert this status in TEXT? THANKS GUYS
I use Blade security plugin for homeseer; what i need is a script that:
sends an email using voipbuster , I HAVE IT:
<font color="red">&hs.launch "iexplore.exe", "https://myaccount.voipbuster.com/clx/se ... lmn"</font id="red">
PROBLEM is in TEXT , here i'd like to insert STATUS OF MOTION SENSORS USED by the plugin: about status i have a vb script:
<font color="red">&For Each d As String In hs.Plugin("BLSecurity").GetSecurityDevicesInAlert()
hs.writelog("Info", "Device: " & d & " is a device in alert!")
Next</font id="red">
how can i insert this status in TEXT? THANKS GUYS
A little HELP for security SCRIPTING
Thats funny. I was also playing with this some days ago
The way I'm trying this was by making use of PHP (yes I have PHP communicating with Homeseer).
Give me some days and I will publish the code here when done.
An other way to do this (I think) is by adding the URL in the "run script" within the action.
When in the "run script" mode select Advanced, and the above URL in the "OR Script Statement: ie: &hs.speak "hello"" box.
You will need to do this for ever sensor, and change the "text=" to the name of the sensor.
<h6>Anyone interested in time travel meet me here last Thursday!!
Download todays latest spoken weather (in Dutch) here (MP3).</h6>
The way I'm trying this was by making use of PHP (yes I have PHP communicating with Homeseer).
Give me some days and I will publish the code here when done.
An other way to do this (I think) is by adding the URL in the "run script" within the action.
When in the "run script" mode select Advanced, and the above URL in the "OR Script Statement: ie: &hs.speak "hello"" box.
You will need to do this for ever sensor, and change the "text=" to the name of the sensor.
<h6>Anyone interested in time travel meet me here last Thursday!!
Download todays latest spoken weather (in Dutch) here (MP3).</h6>
A little HELP for security SCRIPTING
Wifi, i'll wait for you! I have already inserted in "script statement" the URL for sms and it works (it was an old post may be yours)but i can not change TEXT with informations coming from vb status script. Go on guru
A little HELP for security SCRIPTING
Just curious: what are those <b>&</b> in &hs and &for for?
A little HELP for security SCRIPTING
FROM HELP of BLADE SECURITY PLUGIN:
HomeSeer Triggers and Actions
The BLSecurity Plug-In For HomeSeer provides many triggers and actions which can be used in your HomeSeer events.
BLSecurity Triggers
Security Mode Changed to ARMED
Security Mode Changed to PERIMETER
Security Mode Changed to SLEEP
Security Mode Changed to DISARMED
Alert Status Reset
Security Alert Triggered
Security Device in Alert When Arming
Security Device in Communication Error When Arming
BLSecurity Actions
Set Security Mode to ARMED
Set Security Mode to PERIMETER
Set Security Mode to SLEEP
Set Security Mode to DISARMED
Reset Alert Status
--------------------------------------------------------------------------------
Scripting Methods
Here is a list of the scripting methods that can be utilized with this plug-in.
HomeSeer Triggers and Actions
The BLSecurity Plug-In For HomeSeer provides many triggers and actions which can be used in your HomeSeer events.
BLSecurity Triggers
Security Mode Changed to ARMED
Security Mode Changed to PERIMETER
Security Mode Changed to SLEEP
Security Mode Changed to DISARMED
Alert Status Reset
Security Alert Triggered
Security Device in Alert When Arming
Security Device in Communication Error When Arming
BLSecurity Actions
Set Security Mode to ARMED
Set Security Mode to PERIMETER
Set Security Mode to SLEEP
Set Security Mode to DISARMED
Reset Alert Status
--------------------------------------------------------------------------------
Scripting Methods
Here is a list of the scripting methods that can be utilized with this plug-in.
Code: Select all
SetSecurityModeArmed Method
Parameter Type Description
None
Return Values Type Description
None
Description
This method sets the security mode to ARMED mode.
VB.Net Scripting Example
hs.Plugin("BLSecurity").SetSecurityModeArmed()
SetSecurityModePerimeter Method
Parameter Type Description
None
Return Values Type Description
None
Description
This method sets the security mode to PERIMETER mode.
VB.Net Scripting Example
hs.Plugin("BLSecurity").SetSecurityModePerimeter()
SetSecurityModeSleep Method
Parameter Type Description
None
Return Values Type Description
None
Description
This method sets the security mode to SLEEP mode.
VB.Net Scripting Example
hs.Plugin("BLSecurity").SetSecurityModeSleep()
SetSecurityModeDisarmed Method
Parameter Type Description
None
Return Values Type Description
None
Description
This method sets the security mode to DISARMED mode.
VB.Net Scripting Example
hs.Plugin("BLSecurity").SetSecurityModeDisarmed()
ResetAlertStatus Method
Parameter Type Description
None
Return Values Type Description
None
Description
This method resets the alert status to NORMAL.
VB.Net Scripting Example
hs.Plugin("BLSecurity").ResetAlertStatus()
GetSecurityDevicesInAlert Method
Parameter Type Description
None
Return Values Type Description
Device Array Device String Array Returns a string array of devices.
Description
This method returns a Device string array of devices in alert.
VB.Net Scripting Example
For Each d As String In hs.Plugin("BLSecurity").GetSecurityDevicesInAlert()
hs.writelog("Info", "Device: " & d & " is a device in alert!")
Next
GetSecurityDevicesInError Method
Parameter Type Description
None
Return Values Type Description
Device Array Device String Array Returns a string array of devices.
Description
This method returns a Device string array of devices in communication error.
VB.Net Scripting Example
For Each d As String In hs.Plugin("BLSecurity").GetSecurityDevicesInError()
hs.writelog("Info", "Device: " & d & " is a device in communication error!")
Next
A little HELP for security SCRIPTING
Still don't know what the &'s are for, so i'll pretend they're not there. Have you tried something like this:
Another issue you'll have to solve is that when the text you want to send has spaces in them, you'll probably have to encode them (as in space becomes %20)
Code: Select all
dim cDIA
cDIA = ""
For Each d As String In hs.Plugin("BLSecurity").GetSecurityDevicesInAlert()
if cDIA = "" then
cDIA = d
else
cDIA = cDIA & "," & d
end if
Next
&hs.launch "iexplore.exe", "https://myaccount.voipbuster.com/clx/sendsms.php?username=xxxxxxxxx&password=xxxxxxxx&from=xxxxxxx&to=yyyyyyyyyy&text=" & cDIA
A little HELP for security SCRIPTING
maybe this example will help.
I'm using this for Plugwise control
Sub Main(ByVal strAppCmd As String)
Dim strReturn, strWebsite As String
Dim strApp As String = hs.stringitem(strAppCmd, 1, ";")
Dim strCmd As String = hs.stringitem(strAppCmd, 2, ";")
strWebsite = "http://localhost:8080/cc.html?applid=" & strApp & "&cmd=" & strCmd
strReturn = hs.URLAction(strWebsite, "GET", "", "")
End Sub
I'm using this for Plugwise control
Sub Main(ByVal strAppCmd As String)
Dim strReturn, strWebsite As String
Dim strApp As String = hs.stringitem(strAppCmd, 1, ";")
Dim strCmd As String = hs.stringitem(strAppCmd, 2, ";")
strWebsite = "http://localhost:8080/cc.html?applid=" & strApp & "&cmd=" & strCmd
strReturn = hs.URLAction(strWebsite, "GET", "", "")
End Sub
A little HELP for security SCRIPTING
OH oh, too difficult for me, i'm not good to accomplish that! Digit, i tried pasting your suggestion in script field but it doesn't work (from HS LOG "Running script, init error: Previsto 'In'").
i was quite sure, may be i must refine the script , but i don't understan anything of scripting......sorry ! you don't know how much i'd like to be able to code all what you can do!
Is someone so gentle to write a code to simply paste in my homeseer?
i was quite sure, may be i must refine the script , but i don't understan anything of scripting......sorry ! you don't know how much i'd like to be able to code all what you can do!
Is someone so gentle to write a code to simply paste in my homeseer?
A little HELP for security SCRIPTING
Ok; now i am wondering; both pieces of script you posted, you have actually seen them working?
If the answer is yes, i am lost since the error indicates i am trying to use a syntax that is not recognized.
(problem for me is that i am using to much different languages)
If the answer is no, there is still hope
If the answer is yes, i am lost since the error indicates i am trying to use a syntax that is not recognized.
(problem for me is that i am using to much different languages)
If the answer is no, there is still hope
A little HELP for security SCRIPTING
Answer is NO (let's hope..)the only one that works is the part
&hs.launch "iexplore.exe", "https://myaccount.voipbuster.com/clx/se ... yyyy&text="........
Now i write MANUALLY a text and it works
the other portion is taken from plugin's guide above. i tried to copy it in HS , but it doesn't work. i think this part needs something to work
&hs.launch "iexplore.exe", "https://myaccount.voipbuster.com/clx/se ... yyyy&text="........
Now i write MANUALLY a text and it works
the other portion is taken from plugin's guide above. i tried to copy it in HS , but it doesn't work. i think this part needs something to work
A little HELP for security SCRIPTING
Now i see, the 2nd piece with the foreach is vb.net code, not vbscript.
For each should work in vbscript. i think the "as string" is not recognized. Remove that part and try again, i can't test it here...
For each should work in vbscript. i think the "as string" is not recognized. Remove that part and try again, i can't test it here...
A little HELP for security SCRIPTING
removed "as string" then from HS LOG :
Error Running script, init error: Prevista istruzione
Error Running script, init error: Prevista istruzione
A little HELP for security SCRIPTING
I confirm that plugin is written in VB.NET 2.0
A little HELP for security SCRIPTING
I quickly read some things about HS scripting and understand a bit more now:
The "&" is used when you want to execute a one-liner.
If you need more then 1 line of code, you save the script in a file and add some extra code around it, like this:
(Maybe it was better to put this topic in HS forum
The "&" is used when you want to execute a one-liner.
If you need more then 1 line of code, you save the script in a file and add some extra code around it, like this:
Code: Select all
Sub Main()
dim cDIA
cDIA = ""
For Each d In hs.Plugin("BLSecurity").GetSecurityDevicesInAlert()
if cDIA = "" then
cDIA = d
else
cDIA = cDIA & "," & d
end if
Next
rs = hs.urlaction("https://myaccount.voipbuster.com/clx/sendsms.php?username=xxxxxxxxx&password=xxxxxxxx&from=xxxxxxx&to=yyyyyyyyyy&text=" & cDIA, "GET", "", "")
End Sub
A little HELP for security SCRIPTING
Thanks Digit, i'll try it later. Domotica forum is better because i know that all you good guys like to help not expertise people like me! Sometimes threads in HS forum are not followed to the end, While this is a family where you can get always something good!