Announcement

Collapse
No announcement yet.

How to detect event enable/disable?

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

    How to detect event enable/disable?

    I have registered for all events but I see nothing calling HsEvent when I change the state of an event or event trigger. Please tell me we can detect such changes.

    #2
    Can you say more about your use case? "Disabling" an event only stops its trigger from firing the event. The event can still be run if called by another event, for example.
    The most useful way to control an event programmatically that I have found is to include a dedicated condition for that purpose.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      My plugin has logic to decide if any event of my plugin's event triggers are enabled. If true then it runs code to monitor state changes and fires events as necessary. However if allof these event triggers have been disabled then I need to terminate the monitoring.

      So the question is whether there is a way to detect when an event trigger's flag_enabled state changes.

      Comment


        #4
        Originally posted by mrslother View Post
        My plugin has logic to decide if any event of my plugin's event triggers are enabled. If true then it runs code to monitor state changes and fires events as necessary. However if allof these event triggers have been disabled then I need to terminate the monitoring.

        So the question is whether there is a way to detect when an event trigger's flag_enabled state changes.
        Have you checked the SDK? I believe there's HS.Event object and method that provides what you are looking for, partly discussed here:
        HSEvent - HomeSeer Message Board

        Comment


          #5
          Originally posted by mrslother View Post
          So the question is whether there is a way to detect when an event trigger's flag_enabled state changes.
          I don't think there's any event for triggers...

          Probably the only way is to have another background thread checking the triggers (for specific TAN/subTAN), but I'm not sure if HS reports the triggers if they are "disabled".

          Comment


            #6
            TC1 : Per previous message I have registered to all of those events but see none fired for this specific scenario.

            alexbk66: I think you are right. My backup plan is a timer based check of all of my triggers. This polling seems like a massive waste of time and was hoping/expecting something more complete.

            Thanks to both of you guys for your responses.

            Comment


              #7
              I use virtual switches to "disable" events, the virtual switch check being one of the event conditions (like Uncle Michael suggested above). It is easy to check the status of those virtual switches.

              Comment

              Working...
              X