Announcement

Collapse
No announcement yet.

Problem with HAI_Counter_Set

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

  • Problem with HAI_Counter_Set

    I'm having a problem with HAI_Counter_Set. After it is called, the unit value is still the same as previously set. It eventually gets set correctly after quite a while(more than a minute). This is causing quite a problem with my program logic. Am I doing something wrong? Here is some test code I placed in an event:
    result = hs.plugin("HAI_System").HAI_Counter_Set(CInt(unit), CInt(deviceVal))
    s = hs.plugin("HAI_System").UnitValue(CInt(unit))
    hs.WriteLog "Info","UpdateSetPoint Set Unit: " & unit & " to " & deviceVal & " with result " & result & " New val: " & s

    After running this the result is true but s is equal to the previous value not deviceVal.

    Thanks,
    Kirby

  • #2
    Kirby,

    Thank HAI for that one. When you set a counter, there is no system event generated to tell the plug-in about the change, so it does not get picked up until the regular polling interval which can take quite a while. I expected a unit change event to be generated which would cause an immediate update, but apparently that is not the case. When I was testing that function, I was using the web page and I saw the change happen very quickly so I am not sure why I had different results from yours. I will, however, check that function and if I am not doing it already, I will modify it to do an explicit status request on that unit so that we can get the value back immediately. It might be that I am doing that with the HAI Units web page but not the script command. Since I am working on it currently I hope to have a version with this feature fix relatively soon.


    Regards,

    Rick Tinker
    HomeSeer Technologies

    Regards,

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

    Comment


    • #3
      Thanks Rick!

      Comment


      • #4
        The latest beta should address this.


        Regards,

        Rick Tinker
        HomeSeer Technologies

        Regards,

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

        Comment

        Working...
        X