Announcement

Collapse
No announcement yet.

Changing HAI Icon??

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Changing HAI Icon??

    How can we change the icon of the virtual devices that the HAI plugin creates? (i.e. "[1", "[2") When I query the device with hs.GetDeviceCode("Security Status") null or blank text is returned.

    #2
    Clever,

    You did not use GetDeviceCode correctly - you have to include the location name as well - e.g. HAI System Security Status. That will allow you to change the icon but be careful as you are likely to also get an icon set that you have to then change when the status changes. To have it change auto-magically, use the hs.DeviceValuesGraphicsAdd command along with the documented device values for that device from the HAI plug-in documentation.
    Regards,

    Rick Tinker (a.k.a. "Tink")

    Comment


      #3
      Thankx... For the most part I was just going to make it a static icon for all of the values. Is it possible to specify "all" as a value and make it static.

      Comment


        #4
        No, there must be a specification for each value. The special value of 999 and status of "Any Value" is used to trigger events when the device's value changes, but all of the other status/values/graphics must be unique for each value.

        The values that these special devices can have are outlined in the help file for the plug-in.
        Regards,

        Rick Tinker (a.k.a. "Tink")

        Comment


          #5
          I believe that I have figured some of this out but it needs more work. It seems that the DeviceValuesGraphicAdd function will not just allow one entry I had to list two (I attempted to just have the "Any Value" listed to always keep the same graphic no matter what the value), also Once I got this to work it was either the graphic or the status text not both, so it really doesn't seem to be just adding a graphic it is replacing the current status. One thing I did notice is that with all of the HAI statuses only the status text shows there is no default graphic shown for these devices. I am trying to add an hai gif to the status if it is OK and the troubled gif to the status if it is troubled, later I would like to change the Security Status icon to reflect the diffect status available for it, both I would also like to keep the Text Status as well.

          Comment


            #6
            Bringing Back to the top...

            Any Ideas??

            Comment


              #7
              Here is what I was using to make the changes:
              Sub Main()

              dim dev_count
              dim i
              dim device
              dim dev_code

              dev_count = hs.DeviceCount

              for i = 1 to dev_count
              hs.WaitEvents
              set device = hs.GetDevice(i)
              if device.location = "HAI System" then
              dev_code = device.hc & device.dc
              hs.DeviceValuesGraphicsAdd dev_code , "../hai.gif" & chr(2) & "OK" & chr(1) & "../troubled.gif" & chr(2) & "1"
              end if
              next
              End Sub

              Comment


                #8
                Clever,

                The graphics string is not correct - you have as the value for the first graphic the string "OK" - it should be a string representation of a number, such as "0" or "2" or something like that.

                If you look in the plug-in help file, there is information on the device values that the special devices will be set to. There are several different value settings, so you cannot use the same values for each device - in other words, value 0 means "Disarmed" for the security status device, but it means "OK" for the freeze alarm device. As an update to the device values that is not in the help file yet, I used 99 to indicate "Reset" which is the state many of the devices are placed into after a restart of the system. The help file will show all of the values for each device. In fact, the example in the HomeSeer help file for DeviceValuesAdd uses the Security Status device values - if you just replace the status strings (e.g. "Disarmed") with your graphic file names, then you would pretty much have your DeviceValuesGraphicsAdd string.
                Regards,

                Rick Tinker (a.k.a. "Tink")

                Comment


                  #9
                  Rick,

                  Thankx I realize it is hard for me to put every detail into my posts but I actually did realize that I can't use the same logic for every device, thankx for keying in on that though... Actually the script does work as it is, I mean with the "OK" in the first and the "1" in the second that was part of my test to see if the string value would return, but it didn't... Either way I still only get the icon if I was this...

                  Comment

                  Working...
                  X