Announcement

Collapse
No announcement yet.

Event Delays

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

    Event Delays

    Hi all,

    One of the things that used to use for the FEW events I programmed NOT using code, was delays. That is, do something, wait some time, do something else.

    This is especially useful for my REAR spot light. It is one of those "flip the switch on/off" to tell it to be OFF-Wait for motion, JUST ON, or I guess you can include powered off (switch off!).

    I use UPB. Not that it matters, but I thought I would explain. With HS2, I found that to toggle the light switch with a 1.5 second delay between actions was exactly right. I never timed it, to know that 1.5 seconds IS the timing. Just that putting that number as a delay in the event seemed happy. Anything more or less and at least with Homeseer 2 interacting with it, the light fixture did not accept the "command". I found that funny as a HUMAN would probably be waiting a variable amount of time. I guess that is why my father-in-law replaced his "toggle" fixture as it would never understand what he was trying to tell it!

    Anyway, 1.5 seconds, anything more or less and the light does not respond. I noticed in HS3, you can only choose seconds of delay. I tried 1, that did not work. I can go back and try 2 seconds, but thinking that I have other events that use 100's of milliseconds of delay to offset a "second or two" of delay from other things going on, I would ask. Is there a way - WITHOUT FULL UP SCRIPTING to add this level of details for a delay? (Immediate commands would be ok).

    I suppose worst case, I can always perform an immediate script execution with &hs.waitsec(1500) or something similar??

    In the mean time, I'm going to try 2 seconds between commands as well as start to consider just moving all the rest of those events (3 or so) which use the event delays into my updateEvent script...which means I would have full control to do whatever I want with the timing.

    FWIW in updateEvent, I have a function that creates a home-brew timer. I have been looking into replacing those with a built in HS3 timer.
    Anyway, a WHILE loop is executed subtracting a value from the initial variable value. Then the wait event function runs a thread sleep for 10mS, then runs hs.waitEvent (or similar, I'd have to look), which gives UP the thread to something else. The loop repeats until the subtraction is less than or equal to 0. Doing this causes a bit of overhead, but that way my events have really tight delays. I typically only do this for anything over 2 seconds...as the probability of trying to re-execute updateEvent because of some other action with in that window is so small...

    Anyway, just thought I'd ask!

    --Dan
    Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

    #2
    Originally posted by drozwood90 View Post

    I suppose worst case, I can always perform an immediate script execution with &hs.waitsec(1500) or something similar??
    I'd love to know if you have success with this. In HS2 I also used millisecond delays to make sure the right picture was sent in an email, etc. Can't seem to do that too easily in HS3.
    Last edited by jono; February 15, 2017, 07:21 PM.

    Comment

    Working...
    X