Announcement

Collapse
No announcement yet.

How does one add graphic to Device

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

    How does one add graphic to Device

    I would like a plugin device to have a graphic that will be more indicative of the device than the default gear icon. This is straightforward for features, but methods do not appear to exist for devices. I tried the following. It executes, but does not have any effect on the device.

    Code:
    iRef = hs.CreateDevice(dd)
    Dim vgp As New HomeSeer.PluginSdk.Devices.StatusGraphic(PLUGIN_NAME & "/" & PLUGIN_NAME & ".png", -2147483648.0, 2147483647.0)
    Dim vgpList As New HomeSeer.PluginSdk.Devices.StatusGraphicCollection
    vgpList.Add(vgp)
    Dim vgpDictionary As New Generic.Dictionary(Of HomeSeer.PluginSdk.Devices.EProperty, Object)
    vgpDictionary.Add(HomeSeer.PluginSdk.Devices.EProperty.Statu sGraphics, vgpList)
    hs.UpdateDeviceByRef(iRef, vgpDictionary)

    #2
    From what I can tell, you can't. There are no properties exposed on the DeviceFactory class.

    Also I don't think it's supported. I have 100 devices and the icon is the gear for all of them whether they are devices created from ZWave plugin, out of the box plugins, or 3rd party plug ins. The only devices I see with a different icon are timers so far. I don't have a single device with a different icon other than the gear next to the name in the list view.

    Comment


      #3
      I can put icons on devices using the HS3 API, but that is a kludge. As you noted the HS4 API does no want to make this easy or perhaps not possible.

      Comment


        #4
        Jeez just another reason to stay on hs3
        HS3 Pro Edition 3.0.0.435 (Windows 10 vmware)
        BLOccupied:,UltraNetCam3:,weatherXML:,RFXCOM:,Current Cost 3P:,UltraGCIR3:
        DMMQTT:,Kodi:,Z-Wave:,BLRadar:,EasyTrigger:,MySensors:,BLBackup:

        Comment


          #5
          Unfortunately I can't comment on HS3.

          I owned a copy of HS3, never deployed it, decided to move to SmartThings, and now I have moved off and completely on HS4.

          So far, I've gotten HS4 to do everything I had before. The only thing left now is finding a good geofence app (when everyone leaves, turn everything off). Now that I've gotten my first plugin under my belt, I can crank out other custom plugins pretty quickly now. I wrote a garage door app to connect to the Garageio cloud service.

          The documentation for HS4 is terrible but I've managed to figure out all of the API's by writing massive amounts of debug logs to determine what everything does.

          Comment

          Working...
          X