Announcement

Collapse
No announcement yet.

Device Name Without Room/Floor

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

  • Device Name Without Room/Floor

    Is there a way to get the device name without the room and floor information?

  • #2
    To get the Name of a device 123 use:
    Code:
    Dim Device As HomeSeer.PluginSdk.Devices.HsDevice
    Device = hs4.GetDeviceByRef(123)
    hs4.WriteLog(ELogType.Info, "HS Device Name is " & Device.Name, "Test")
    and feature 1234 use
    Code:
    Dim Feat As HomeSeer.PluginSdk.Devices.HsFeature
    Feat = hs4.GetFeatureByRef(1234)
    hs4.WriteLog(ELogType.Info, "HS Feature Name is " & Feat.Name, "Test")
    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
    Scripts =
    Various

    Comment


    • #3
      hs,getpropertybyref(1234,.pluginsdk.devices.eproperty.name) works for both cases. To use it you need to get the case correct as I just used lower case in the example

      Comment


      • #4
        Originally posted by Michael McSharry View Post
        hs,getpropertybyref(1234,.pluginsdk.devices.eproperty.name) works for both cases. To use it you need to get the case correct as I just used lower case in the example
        Does that work in a script, or only in a plugin?
        tenholde

        Comment


        • #5
          It is part of the API so will work for anything that is able to grasp ahold of the HomeSeer.PluginSdk object, including scripts.

          Comment


          • #6
            Originally posted by Michael McSharry View Post
            It is part of the API so will work for anything that is able to grasp ahold of the HomeSeer.PluginSdk object, including scripts.
            Thanks for the reply. I'm just starting down the HS4 path and trying to understand the scripting environment. Most of the documentation refers to plugin development.

            Here is how I understand it, and probably incorrectly. GetPropertyByRef is a method in PluginSDK.IHScontroller. Available to a plugin.

            The hs object that is instantiated for a script run under HomeSeer (at least version 3) is of a class IHsApplication in HomeSeerAPI, and does not contain the method GetPropertyByRef. I'm hoping there is a way for a script to get access to the PluginSDK.IHScontroller object, but I need some help here.
            tenholde

            Comment


            • #7
              Rich confirmed that the HS4 Plugin SDK will NOT be available via scripts so the hs4 object cannot be used.

              As you say, scripts access the IHScontroller object which does include hs.GetPropertyByRef in HS4 (as per Michael's example). Documentation for HS4 IHScontroller methods can be found here.

              Jon

              Comment


              • #8
                To clarify, I thought scripts could only reference IHSappliCation
                tenholde

                Comment


                • #9
                  Rich told me that HS4 scripts can access IHScontroller and it seemed to work when I tried adding a new category via scripting: hs.CreateCategory("TestCounter", "counter.svg").
                  Jon

                  Comment


                  • #10
                    I am confused as to what the hs object available to HS4 scripting is. hs.CreateCategory does indeed work, which is a method of IHSController. But, hs.DeviceValue also works, which is NOT a member of PluginSDK.IHSController, but IS a member of HomeSeerAPI.IHsApplication. This has been troubling me. How does HS support scripts written for HS3 and scripts written for HS4 at the same time, both via the same hs object?
                    tenholde

                    Comment

                    Working...
                    X