So I have finished most of my code for my Niles GXR2 External App, and I have most everything working except the button press events in the homeseer web interface.
As below, I have generated device buttons via code, and they populate on the web interface. The issue I am having is with the callback in code to fire the ButtonPressEX, or ButtonPress events. My project is rather large, so I don't think posting the entire thing is appropriate.
I have:
PublicReadOnlyProperty SupportsHS2() AsBoolean
Get
ReturnTrue
EndGet
EndProperty
PublicReadOnlyProperty SupportsExtendedButtons() AsBoolean
Get
ReturnFalse
EndGet
EndProperty
PublicSub ButtonPressEx(ByRef button_name AsString, ByRef dv AsObject)
MessageBox.Show("Pressed") 'just for an event to raise
EndSub
I have the HSEvents sub working fine, and have parsed the 5 different event types out, but I have been racking my brain for a week trying to make the web interface button press trigger in code.
Here is my new device code (I have if statements determining if the device is needed or not)
Dim NewDV
NewDV = hs.NewDeviceEx(zone1.ZNName)
NewDV.dc = 1 'placeholder value
NewDV.hc = "N"
NewDV.dev_type_string = "GXR2"
NewDV.misc = "&h4000"
NewDV.misc = "&h8000"
NewDV.misc = "&h2000"
NewDV.Interface = "GXR2"
NewDV.Location = "GXR2"
NewDV.location2 = "Source"
NewDV.status_support = "TRUE"
'NewDV.buttons = "GXR2" & Chr(2) & "On" & Chr(1) & "GXR2" & Chr(2) & "Off"
hs.SetDeviceValue("N1", "99")
hs.SetDeviceString("N1", "Source")
hs.DeviceButtonAdd("N1", "GXR2", slot1.SLName) 'HD Radio
hs.DeviceButtonAdd("N1", "GXR2", slot2.SLName) 'Sirius
hs.DeviceButtonAdd("N1", "GXR2", slot3.SLName) 'IM-NET
hs.DeviceButtonAdd("N1", "GXR2", slot4.SLName) 'Sonos1
hs.DeviceButtonAdd("N1", "GXR2", slot5.SLName) 'Sonos2
hs.DeviceButtonAdd("N1", "GXR2", slot6.SLName) 'iPod
next
Any help or insight would be greatly appreciated, I'm quite stuck, and can't find any information that seems to work. My homeseer trial is ending today, so i'll probably have to test on a new machine before I decide to take the HS plunge and convince my old lady to spend the cash. I'd consider myself a fairly novice coder, so I could very easily be trying to describe something incorrectly as well :\
As below, I have generated device buttons via code, and they populate on the web interface. The issue I am having is with the callback in code to fire the ButtonPressEX, or ButtonPress events. My project is rather large, so I don't think posting the entire thing is appropriate.
I have:
PublicReadOnlyProperty SupportsHS2() AsBoolean
Get
ReturnTrue
EndGet
EndProperty
PublicReadOnlyProperty SupportsExtendedButtons() AsBoolean
Get
ReturnFalse
EndGet
EndProperty
PublicSub ButtonPressEx(ByRef button_name AsString, ByRef dv AsObject)
MessageBox.Show("Pressed") 'just for an event to raise
EndSub
I have the HSEvents sub working fine, and have parsed the 5 different event types out, but I have been racking my brain for a week trying to make the web interface button press trigger in code.
Here is my new device code (I have if statements determining if the device is needed or not)
Dim NewDV
NewDV = hs.NewDeviceEx(zone1.ZNName)
NewDV.dc = 1 'placeholder value
NewDV.hc = "N"
NewDV.dev_type_string = "GXR2"
NewDV.misc = "&h4000"
NewDV.misc = "&h8000"
NewDV.misc = "&h2000"
NewDV.Interface = "GXR2"
NewDV.Location = "GXR2"
NewDV.location2 = "Source"
NewDV.status_support = "TRUE"
'NewDV.buttons = "GXR2" & Chr(2) & "On" & Chr(1) & "GXR2" & Chr(2) & "Off"
hs.SetDeviceValue("N1", "99")
hs.SetDeviceString("N1", "Source")
hs.DeviceButtonAdd("N1", "GXR2", slot1.SLName) 'HD Radio
hs.DeviceButtonAdd("N1", "GXR2", slot2.SLName) 'Sirius
hs.DeviceButtonAdd("N1", "GXR2", slot3.SLName) 'IM-NET
hs.DeviceButtonAdd("N1", "GXR2", slot4.SLName) 'Sonos1
hs.DeviceButtonAdd("N1", "GXR2", slot5.SLName) 'Sonos2
hs.DeviceButtonAdd("N1", "GXR2", slot6.SLName) 'iPod
next
Any help or insight would be greatly appreciated, I'm quite stuck, and can't find any information that seems to work. My homeseer trial is ending today, so i'll probably have to test on a new machine before I decide to take the HS plunge and convince my old lady to spend the cash. I'd consider myself a fairly novice coder, so I could very easily be trying to describe something incorrectly as well :\
Comment