Announcement

Collapse
No announcement yet.

Differentiating features for a device

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

    Differentiating features for a device

    My plugin supports TPLink wifi plugs, bulbs, etc. The devices currently only have 1 control feature that controls on/off/dim/color. I have some devices for which I would like to include an additional feature for watts to allow triggers based on how many watts are being consumed.

    Is there a straightforward way to differentiate features when they don't conform to the EGenericFeatureSubType? I want to update that watts feature as needed and to react to triggers.
    I know I can iterate through the device's features but want to ensure in my code that I have the correct feature.

    James

    Running HS 3 on Win10 .

    #2
    DeviceAPI and related properties is one technique. You could mark the new one as an energy type. Using the PED is a generic way to store whatever you want to differentiate. I think DeviceType (String) was undepreciated, but had been editable by user. You could also use Display priority where 1 will be the switch and 2 for the wattage.

    Comment


      #3
      There's EFeatureType.Energy and EEnergyFeatureSubType.Watts, etc

      Comment


        #4
        Originally posted by alexbk66 View Post
        There's EFeatureType.Energy and EEnergyFeatureSubType.Watts, etc
        Thank you. I didn't dig enough into the subtype
        James

        Running HS 3 on Win10 .

        Comment


          #5
          Originally posted by Michael McSharry View Post
          DeviceAPI and related properties is one technique. You could mark the new one as an energy type. Using the PED is a generic way to store whatever you want to differentiate. I think DeviceType (String) was undepreciated, but had been editable by user. You could also use Display priority where 1 will be the switch and 2 for the wattage.
          Thank you. I had stopped using the PED due to some self-inflicted issues. I think using the energy type is the way to go. And if needed I will take a look at using the PED again.
          I appreciate the quick response.
          James

          Running HS 3 on Win10 .

          Comment


            #6
            Originally posted by Michael McSharry View Post
            You could also use Display priority where 1 will be the switch and 2 for the wattage.
            Display priority is also editable by user, which will break the plugin

            Comment


              #7
              Thanks Alex, I had never looked at the ability to edit the parent device to change the priority. It did seem odd to me that the property was added without a corresponding edit capability on the Device UI.

              Comment


                #8
                I have everything working as I wanted. Thank you both for the help.
                James

                Running HS 3 on Win10 .

                Comment


                  #9
                  Originally posted by Michael McSharry View Post
                  Thanks Alex, I had never looked at the ability to edit the parent device to change the priority. It did seem odd to me that the property was added without a corresponding edit capability on the Device UI.
                  HS added this UI relatively recently - user can set priority for each feature and also mark the feature as "Important"

                  https://github.com/HomeSeer/Plugin-S...ent-1081817844

                  Comment

                  Working...
                  X