Hi guys,
I am new to scripting and struggling with the example script provided in the Sage documentation below.
Public Sub mcShowDoorbell(ByVal host As String)
Dim mcc As Object
Try
mcc = hs.Plugin("Sage MC Control")
Catch Ex As Exception
mcc = Nothing
End Try
If mcc Is Nothing Then
hs.WriteLog("Error", "ERROR - could not get a reference to the “ & _
“Media Center Controll Plug-In.")
Exit Sub
End If
Dim respStr As String = mcc.richMsg(host, "HomeSeer", _
"There is someone at the door", 30, "Done;Unlock", "modal", _
"\\basement\netcam\Front Door_latest.jpg")
If respStr = "Unlock" Then
' Code to unlock the door
End If
End Sub
Now the first thing that is wrong or I think with this is that the example mcc = hs.Plugin("Sage MC Control") needs to be mcc = hs.Plugin("SageMCControl").
My media centre name is IWYN. Do I change the mcShowDoorbell to IWYN? Do I need to create this script in VB.net or can I copy and paste it in the new event Advanced option for scripts? Do I need to save it as .vb or .txt?
For testing and learning purposes I only want my kitchen light to come on when choosing the unlock on Media Centre, it's a X10 light and on number A5.
Any help will be much appreciated!
thanks
I am new to scripting and struggling with the example script provided in the Sage documentation below.
Public Sub mcShowDoorbell(ByVal host As String)
Dim mcc As Object
Try
mcc = hs.Plugin("Sage MC Control")
Catch Ex As Exception
mcc = Nothing
End Try
If mcc Is Nothing Then
hs.WriteLog("Error", "ERROR - could not get a reference to the “ & _
“Media Center Controll Plug-In.")
Exit Sub
End If
Dim respStr As String = mcc.richMsg(host, "HomeSeer", _
"There is someone at the door", 30, "Done;Unlock", "modal", _
"\\basement\netcam\Front Door_latest.jpg")
If respStr = "Unlock" Then
' Code to unlock the door
End If
End Sub
Now the first thing that is wrong or I think with this is that the example mcc = hs.Plugin("Sage MC Control") needs to be mcc = hs.Plugin("SageMCControl").
My media centre name is IWYN. Do I change the mcShowDoorbell to IWYN? Do I need to create this script in VB.net or can I copy and paste it in the new event Advanced option for scripts? Do I need to save it as .vb or .txt?
For testing and learning purposes I only want my kitchen light to come on when choosing the unlock on Media Centre, it's a X10 light and on number A5.
Any help will be much appreciated!
thanks
Comment