Announcement

Collapse
No announcement yet.

programmatically determine whether an Event is disabled?

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

  • programmatically determine whether an Event is disabled?

    Is there a script statement to determine whether a particular HS3 event has been manually enabled or disabled?

    Several of my scripts are set to run at scheduled times each day. I would like to manually enable or disable just one event that each of the scripts could check to determine whether or not they should run.

    Thank you!

  • #2
    Yes, it is possible via the scripting interface to identify whether a event is enabled or disabled. If I remember, it is even possible to determine the last time it ran. It is not just one command, but a series of commands. Depending on your level of scripting background, you could also just create a virtual device that you can turn on/off if you want the event to trigger. Just don't forget to add that virtual device as part of the dependency.

    To help you, it may be helpful to get more information from you in terms of exactly what you want to do. Keep in mind that with HomeSeer there are usually more than one option to screw in a light bulb. If you understand what I mean...


    HomeSeer 2, HomeSeer 3, Allonis myServer, Amazon Alexa Dots, ELK M1G, ISY 994i, HomeKit, BlueIris, and 6 "4k" Cameras using NVR, and integration between all of these systems. Home Automation since 1980.

    Comment


    • #3
      Easy Trigger...

      Click image for larger version

Name:	Capture1.PNG
Views:	5
Size:	29.4 KB
ID:	1256183
      Click image for larger version  Name:	capture.png Views:	1 Size:	25.8 KB ID:	1256182
      Randy Prade
      Aurora, CO
      Prades.net

      PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

      Comment


      • #4
        Thanks Krumpy.

        Yes, I understand about "more than one way...". And using a series of script commands would be fine. I also considered creating a virtual device that I could manually turn on and off and then having each of the "event controlled scripts" check its value. I've done that before.

        I have a number of events that are scheduled to run seasonally. Each of these events actually run somewhat lengthy scripts. What I have done thus far is to manually disable one of the events from running. And rather than disable all of the events from running, I would like to just modify each of their associated scripts such that each script check the status of the "first" event so they will each know what action they should take.

        I'd prefer not to manually disable all of the events because I will have to remember which ones to re-enable after a number of months from now. And I will be fortunate if I can even remember where my PC is "a number of months from now." And I would rather disable an event rather than to set a virtual device to a value of "0" (e.g.) because it will be easier for me to find the disabled event 6 months from now.

        Thanks again Krumpy.

        Comment


        • #5
          thanks rprade,

          I'd prefer to allow my event-driven scripts to run to allow them to post appropriate log entries and in two cases, emails to state whether for example, they successfully ran or that they didn't perform their standard activity because of the seasonal setting of the disabled event.

          It appears your solution would be very appropriate if I wanted to just prevent an event from triggering. Which would disallow the associated script from triggering. Nice!

          Comment


          • #6
            Originally posted by frankc View Post
            thanks rprade,

            I'd prefer to allow my event-driven scripts to run to allow them to post appropriate log entries and in two cases, emails to state whether for example, they successfully ran or that they didn't perform their standard activity because of the seasonal setting of the disabled event.

            It appears your solution would be very appropriate if I wanted to just prevent an event from triggering. Which would disallow the associated script from triggering. Nice!
            Or you can use a pair of events as I do to set a virtual device as to whether a plug-in is running. With the recurring trigger at 1 second and the virtual device as a condition, it is very quick. The virtual device can be used in a script or either event can send a text, pushover or email. Here is a sample.

            Click image for larger version  Name:	capture.png Views:	1 Size:	93.9 KB ID:	1256201
            Randy Prade
            Aurora, CO
            Prades.net

            PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

            Comment


            • #7
              Interesting!

              I am wondering whether a "status" parameter could be sent to a script when it is run that would indicate whether the "plug-in" was running per the logic of your example. But rather than check the status of a "plug-in", could it instead check whether an event was enabled? That way, all the script would have to do is read the parameter sent to it rather than to utilize a series of commands to determine an event's status.

              You see, the "email" I mentioned sending contains a lot of information that takes several minutes to calculate. That is why the scripts always have to run.

              Comment

              Working...
              X