Announcement

Collapse
No announcement yet.

Time script help

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

    Time script help

    Can someone help me or give me an example of a script for something as follows...

    If
    time is between "??:?? To ??:??"
    Then run event "???"

    Or if
    Time is between "??:?? To ??:??"
    Then run event "???"

    #2
    Originally posted by cpd5899 View Post
    Can someone help me or give me an example of a script for something as follows...

    If
    time is between "??:?? To ??:??"
    Then run event "???"

    Or if
    Time is between "??:?? To ??:??"
    Then run event "???"
    David

    I think you will find that if you tried this, your event would run every second between those times. This is the reason that the native HS event engine doesn't have a trigger for between times.

    Spud has created a plugin (Easy Trigger) that allows you to set up schedules and trigger events from the start or end of a schedule.

    Perhaps if you can elaborate a little more on what you are specifically trying to achieve someone will be able to help

    Cheers
    James
    cheeryfool

    Comment


      #3
      Or perhaps create two virtual devices for those times and use to trigger running your event?

      Comment


        #4
        Originally posted by cheeryfool View Post
        David

        I think you will find that if you tried this, your event would run every second between those times. This is the reason that the native HS event engine doesn't have a trigger for between times.

        Spud has created a plugin (Easy Trigger) that allows you to set up schedules and trigger events from the start or end of a schedule.

        Perhaps if you can elaborate a little more on what you are specifically trying to achieve someone will be able to help

        Cheers
        James
        I have events that do what I need them to do.... But I was hoping to not have so many events and was hoping to accomplish with a script...

        I want HS to speak only on certain clients during certain times of the day when the door is open. I have kids, and when they are napping or sleeping don't want it to speak on the clients on the second floor. I have accomplished it with multiple events, just was hoping for a one shot solution.

        My event is as follows...
        If alarm is off
        And time is after....
        And time is before....
        Speak "door is open" on client 1,2&3

        Then... When I want on all clients
        My event is as follows...
        If alarm is off
        And time is after....
        And time is before....
        Speak "door is open" on client 1,2,3,4,5&6




        Event:
        when alarm is Off
        and
        door sensor change and becomes open
        Run a script

        Script:
        If
        The time if after ??:??
        And
        The time is before ??:??
        THEN
        run event?????

        Or if
        The time if after ??:??
        And
        The time is before ??:??
        THEN
        run event???

        Comment


          #5
          I think your event trigger should be:

          IF door sensor changes and becomes open

          Then you restrict when that matters by adding one or more conditions:

          AND IF Alarm is off
          AND IF time is after xx
          AND IF time is before yy

          THEN speak "door is open" to clients 1,2,3

          A 2nd similar event with different time parameters and different speaker clients.

          Another way to tackle this is to set up a virtual device "Kids Sleeping". You can set that manually or with simple time parameters in one or more events to On, then use that as the condition instead of explicit time parameters in your speak events.

          I use a combination of events like this, mostly using virtual devices to run all sorts of lighting, speak and other actions.

          I haven't quite understood the need for a script on this yet, but happy to be educated further.

          Cheers
          cheeryfool

          Comment

          Working...
          X