No announcement yet.

Alarm clock with early event triggering and no HST programming

  • Filter
  • Time
  • Show
Clear All
new posts

    Alarm clock with early event triggering and no HST programming


    Hello everyone,

    I have been looking for alarm clock that
    • can easily be set from default HSTouch client
    • (don't want to get into HST programming or use Web UI; something simple that my wife can use as well)
    • can start some events early (e.g. turn on heat/increase temp) pre-set time before the "bell rings" (e.g. 30 minutes)
    • can have multiple copies (one for each person/room)
    Could not find anything so I built my own. I am guessing many people would find this useful as I was stumped by lack of ability to do this with existing HS capabilities (i.e. one cannot change event time from HST, you need to go to HS Web but try explaining that to you spouse! ).

    For now initial setup up requires few manual steps. If anyone can suggest how to package this that would be good.

    Using it is trivial - you select clock device in HST and then scroll to your selected time. That is all. It will stay on that time until you change it (every day same time) or you turn it OFF. Just like alarm clock on your night stand. You can tune the event to run only on particular days if you want to have different clock for weekday vs. weekend.

    You can create as many clocks as you want (e.g. for you, child, entire family etc.) and each can run different (or same) set of events.

    Here is how it looks in HST (again no HST coding required):

    1) Build virtual device that will be alarm clock itself. Changing its value will determine what the wakeup time is.

    2) Create two events: first one that "rings the bell"; second one that I call early event that can turn on heat or start dimmer with slow ramp rate (anything you want to start up to 12 hours before you actually wake up).

    3) Save the script provided as .vb on your homeseer PC

    4) Build event that triggers any time alarm clock device is set to any value that runs the script which in turn adjusts time for two events (or turns them off if you set alarm off)

    To build another alarm clock repeat 1,2 and 4. You can use the same script as it is parameterized.

    STEP BY STEP for #1
    Here is virtual device example

    You will need to set the value/status pair for devices and include any times you want to see. Value must be in 24 hour format but you can do anything you want with status (AM/PM, 24 hour format etc). Script does not use status. This clock supports AM/PM or 24 hour settings on your computer automatically - don't worry about requirement to use 24 hour format for the virtual device value.

    Also notice last row with value=9999. The script uses that as "alarm off" and it will disable alarm events from triggering.

    Warning that if you share events between multiple clocks then you need to disable the one you don't want first and THEN set/enable the one you want - otherwise the shared event will be disabled since last change wins. For now fixing this is beyond my capabilities. Best solution is to have unique events for each clock and they can all call single shared event that is only manually triggered if you want to share events.

    STEP BY STEP for #2

    Here is example of my wakeup and wakeup early events. Set them to any time, it will be the clock that will determine actual times.

    Note: you can choose for these events to run every day or only on weekend and/or weekdays. The script only adjusts *time* and if the event is enabled or not (9999 value) - it does not touch days the events run.

    STEP BY STEP for #3
    Save this script to your homeseer PC scripts directory(C:\Program Files (x86)\HomeSeer HSPRO\Scripts\wake_up_zora.vb)

    STEP BY STEP for #4
    Build event that triggers any time alarm clock device is set to any value. The event should call the vb script with the following parameters: Alarm device ID,Wake up event name,Early event offset in minutes,Early wake up event name. Those should match items you created in 1,2,3. Here is an example.

    Early offset in minutes must be less than 720 (12 hours)
    If early offset is set to zero then only wake up event exists. Put zero for offset *and* early event.

    That is it ... enjoy !

    ============================================================ ============================================
    Attached Files
    Last edited by Person; February 11, 2013, 05:00 PM. Reason: Add even more detail on setup/usage