Ofcourse, but I don't have a nice screen yet.
I'm testing the functionallity first.
I use the code from the standard file "test.aspx" in the html directory.
Code: Select all
<%@ Page Language="VB" %>
<script runat="server">
' Insert page code here
'
Dim hs As Scheduler.hsapplication
Dim plugin As HomeSeerAPI.PluginAccess
Sub Page_Load(Sender As Object, E As EventArgs)
' for use with the HS web server
hs = Context.Items("Content")
' get a reference to the Z-Wave plugin
plugin = New HomeSeerAPI.PluginAccess(hs, "Z-Wave", "")
If plugin.Connected Then
Label2.Text = "Connected to Z-Wave plugin, name=" & plugin.Name
End If
Label1.text = "HomeSeer Ver: " & hs.version
Dim EN As Scheduler.Classes.clsDeviceEnumeration
Dim dv As Scheduler.Classes.DeviceClass
EN = hs.GetDeviceEnumerator
Do
dv = EN.GetNext
If dv Is Nothing Then Continue Do
Loop Until EN.Finished
end sub
Sub ButSpeak_Click(sender As Object, e As EventArgs)
hs.speak(txtspeak.text,false,"")
Dim EN As Scheduler.Classes.clsDeviceEnumeration
Dim dv As Scheduler.Classes.DeviceClass
EN = hs.GetDeviceEnumerator
Do
dv = EN.GetNext
If dv Is Nothing Then Continue Do
' hs.WriteLog("SAMPLE", "Found device from aspx: " & dv.Name(Nothing))
' If dv.Interface(Nothing) IsNot Nothing Then
' If dv.Interface(Nothing).Trim = "Sample Plugin" Then
' hs.WriteLog("SAMPLE", "Found device from aspx: " & dv.Name(Nothing))
' End If
' End If
Loop Until EN.Finished
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'hs.ExecX10("L1", "on")
'hs.GetURL("http://192.168.1.96","/JSON?request=controldevicebyvalue&ref=76&value=50",true,8082)
hs.CAPIControlHandler(hs.CAPIGetSingleControl(76, true ,"off", false, true))
hs.WriteLog("Test", "Button 1 from aspx")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'hs.ExecX10("L1", "off")
'hs.GetURL("http://192.168.1.96:8082/JSON?request=controldevicebyvalue&ref=76&value=50","",true,8082)
hs.CAPIControlHandler(hs.CAPIGetSingleControl(76, false ,"on", false, true))
hs.WriteLog("Test", "Button 2 from aspx")
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'hs.ExecX10("L1", "off")
'hs.GetURL("http://192.168.1.96:8082/JSON?request=controldevicebyvalue&ref=76&value=50","",true,8082)
hs.CAPIControlHandler(hs.CAPIGetSingleControl(76, false ,"99", false, true))
hs.WriteLog("Test", "Button 3 from aspx")
End Sub
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'hs.ExecX10("L1", "off")
'hs.GetURL("http://192.168.1.96:8082/JSON?request=controldevicebyvalue&ref=76&value=50","",true,8082)
hs.CAPIControlHandler(hs.CAPIGetSingleControl(76, false ,"7", false, true))
hs.WriteLog("Test", "Button 4 from aspx")
End Sub
Private Function GetHeadContent() As String
Try
Return hs.GetPageHeader("", "Test Page", "", "", False, False, True, False, False)
Catch ex As Exception
End Try
Return ""
End Function
Private Function GetBodyContent() As String
Try
Return hs.GetPageHeader("", "Test Page", "", "", False, True, False, True, False)
Catch ex As Exception
End Try
Return ""
End Function
</script>
<html>
<head runat="server">
<!-- <%response.write(GetHeadContent())%> -->
</head>
<body>
<!-- <% response.write(GetBodyContent()) %> -->
<form runat="server">
<p>
<asp:Label id="Label1" runat="server" width="210px">Label X</asp:Label>
</p>
<p>
<asp:Label id="Label2" runat="server" width="400px">Label plugin</asp:Label>
</p>
<p>
</p>
<p>
<asp:Button id="ButSpeak" onclick="ButSpeak_Click" runat="server" Text="Speak"></asp:Button>
<asp:TextBox id="TxtSpeak" runat="server"></asp:TextBox>
</p>
<br><br><br>
<p>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Light off" Width="300" Height="50" font-size="32px" />
</p>
<br><br>
<p>
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Light last dim state" Width="300" Height="50" font-size="32px" />
</p>
<br><br>
<p>
<asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Light 99%" Width="300" Height="50" font-size="32px" />
</p>
<br><br>
<p>
<asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="Light 7%" Width="300" Height="50" font-size="32px" /> </p>
<!-- Insert content here -->
</form>
</body>
</html>