Announcement

Collapse
No announcement yet.

Create a virtual device with 4 values.

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

    Create a virtual device with 4 values.

    I want to create a virtual device with 4 values.
    In HS3 I did this by adding lines with New Single Value. In HS4 this does not appear to work.

    How do I do this in HS4?

    #2
    Use the HS3 screens till they get the HS4 issues worked out.


    http://192.168.2.184/deviceutility

    Substitute you HS4 IP.


    Sent from my iPhone using Tapatalk

    Comment


      #3
      In HS4 API use AddGraphicForValue. For example:
      Code:
      Dim ff As HomeSeer.PluginSdk.Devices.FeatureFactory = hsNewFeature("Feature Name")
      Dim sGraphicPath As String = "images/HomeSeer/status/"
      ff.AddGraphicForValue(sGraphicPath & "red.png", 0, "Offline")
      ff.AddGraphicForValue(sGraphicPath & "green.png", 1, "Online")
      ff.AddGraphicForValue(sGraphicPath & "yellow.png", 2, "DontKnow")
      ff.AddGraphicForValue(sGraphicPath & "blue.png", 3, "Oops")Dim fd As HomeSeer.PluginSdk.Devices.NewFeatureData = ff.PrepareForHsDevice(iParentDeviceRef)
      iFeatureChildRef = hs.CreateFeatureForDevice(fd)
      If you are creating controls rather than status then use Add the type of control such as button as shown below

      Code:
      ff.AddButton(0, "Suspend", Nothing, HomeSeer.PluginSdk.Devices.Controls.EControlUse.Off)
      ff.AddButton(1, "Resume", Nothing, HomeSeer.PluginSdk.Devices.Controls.EControlUse.On)
      If you already have the feature created then use hs.AddStatusControlToFeature or hs.AddStatusGraphicToFeature

      Comment


        #4
        Thanks for the responses - got it now :-)

        Comment

        Working...
        X