Announcement

Collapse
No announcement yet.

How to detect event enable/disable?

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

  • Guest
    Guest replied
    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.

    Leave a comment:


  • mrslother
    replied
    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.

    Leave a comment:


  • alexbk66
    replied
    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".

    Leave a comment:


  • TC1
    replied
    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

    Leave a comment:


  • mrslother
    replied
    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.

    Leave a comment:


  • Uncle Michael
    replied
    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.

    Leave a comment:


  • mrslother
    started a topic How to detect event enable/disable?

    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.
Working...
X