Announcement

Collapse
No announcement yet.

Help with device page plugin tab options

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with device page plugin tab options

    Hi,

    I'm creating a plugin for HomeKit and want the the plugin device page tab to be different based on the type selected from a drop list.

    See screenshot.

    So based on what is selected other options are presented. For instance a Light build will have options like On/Off values and Dimable or not and a Temperature sensor will have the option to choose Fahrenheit or Celsius etc...

    All help is more than welcome.
    Attached Files
    Regards,

    Rien du Pre
    The Netherlands
    Using:
    Homeseer PRO 3.0.0.435 on MacOS - Running a Mac Mini
    Plugin's:
    RFXCOM, Caddx, BLShutdown, BLLogMonitor, BLRadar, BLBackup, Log2Text, BLLAN, Z-Wave

  • #2
    In the ConfigDevicePost would you just call divToUpdate on a named div in the ConfigDevice page?
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Originally posted by mrhappy View Post
      In the ConfigDevicePost would you just call divToUpdate on a named div in the ConfigDevice page?
      Can you be more specific?

      I have a routine:
      Code:
      Public Function ConfigDevice(ref As Integer, user As String, userRights As Integer, newDevice As Boolean) As String Implements IPlugInAPI.ConfigDevice
              Dim stb As New StringBuilder
              Dim cb_debug As New clsJQuery.jqCheckBox("cb_debug", "", HSPI.PageName, False, False)
              Dim dl_type As New clsJQuery.jqDropList("dl_type", HSPI.PageName, False)
              dl_type.style = "height:25px;width:200px;"
              Dim Textb As New clsJQuery.jqTextBox("Textb", "Text", "", HSPI.PageName, 20, False)
              dl_type.AddItem("(Not Set)", "0", True)
              dl_type.AddItem("Lightbulb", "1", False)
              dl_type.AddItem("Fan", "2", False)
              dl_type.AddItem("Switch", "3", False)
              dl_type.AddItem("Outlet", "4", False)
              dl_type.AddItem("Thermostat", "5", False)
              cb_debug.id = "oCB_debug"
              Dim cb_debug_checked As String = hs.GetINISetting("Settings", "cb_debug_checked", "0", INIFILE)
              cb_debug.checked = cb_debug_checked.Equals("1")
              Dim bSave As New clsJQuery.jqButton("Save", "Done", "DeviceUtility", True)
              stb.Append(clsPageBuilder.FormStart("frmTab1", "checkbox", "Post"))
              stb.Append("Enable this device for Apple HomeKit: " & cb_debug.Build() & "<br>")
              stb.Append("<br>")
              stb.Append("Set Homekit Accesoire Type:" & dl_type.Build)
              stb.Append("<br>")
              stb.Append("Accessoire on value: " & Textb.Build)
              stb.Append("<br>")
              stb.Append("Accessoire off value: " & Textb.Build)
              stb.Append("<br>")       
              stb.Append(bSave.Build & "</td>")
              '   stb.Append(BuildButton("Button_General") & " ")
              stb.Append(clsPageBuilder.FormEnd())
              Return stb.ToString
          End Function
      But how do I manage to show the "accessoire on and off value" or not based on the accessoire type section ?

      Many thanks in advance,
      Regards,

      Rien du Pre
      The Netherlands
      Using:
      Homeseer PRO 3.0.0.435 on MacOS - Running a Mac Mini
      Plugin's:
      RFXCOM, Caddx, BLShutdown, BLLogMonitor, BLRadar, BLBackup, Log2Text, BLLAN, Z-Wave

      Comment


      • #4
        Bump....
        Regards,

        Rien du Pre
        The Netherlands
        Using:
        Homeseer PRO 3.0.0.435 on MacOS - Running a Mac Mini
        Plugin's:
        RFXCOM, Caddx, BLShutdown, BLLogMonitor, BLRadar, BLBackup, Log2Text, BLLAN, Z-Wave

        Comment


        • #5
          Please guys any help is appreciated. I remember that I've seen this functionality in other plug-in

          Again thanks in advance.
          Regards,

          Rien du Pre
          The Netherlands
          Using:
          Homeseer PRO 3.0.0.435 on MacOS - Running a Mac Mini
          Plugin's:
          RFXCOM, Caddx, BLShutdown, BLLogMonitor, BLRadar, BLBackup, Log2Text, BLLAN, Z-Wave

          Comment


          • #6
            Have you tried http://forums.homeseer.com/showthrea...ht=divtoupdate - I don't have the time to test at the minute, looking at it I am not sure whether the call to add the div to configdevicepost is correct (shouldn't it be just in configdevice) as that only returns the integer as to whether you should stay on the page or it should save the data but I don't really know without trying it it is not the easiest thing to think of in your head.
            My Plugins:

            Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
            Yeelight 3P | Nanoleaf 3P

            Comment


            • #7
              Originally posted by mrhappy View Post
              Have you tried http://forums.homeseer.com/showthrea...ht=divtoupdate - I don't have the time to test at the minute, looking at it I am not sure whether the call to add the div to configdevicepost is correct (shouldn't it be just in configdevice) as that only returns the integer as to whether you should stay on the page or it should save the data but I don't really know without trying it it is not the easiest thing to think of in your head.
              I tried, and works with a button press on the same page. But I want to it to happen when I select an item from a dropdownlist. It's a bit silly that you first have to submit a dropdownlist selection with a button.

              Thanks again for your help.
              Regards,

              Rien du Pre
              The Netherlands
              Using:
              Homeseer PRO 3.0.0.435 on MacOS - Running a Mac Mini
              Plugin's:
              RFXCOM, Caddx, BLShutdown, BLLogMonitor, BLRadar, BLBackup, Log2Text, BLLAN, Z-Wave

              Comment

              Working...
              X