Announcement

Collapse
No announcement yet.

Alarm clock screen

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Alarm clock screen

    I've been working on a design for a touchpanel by the side of my bed to serve as my alarm clock. I've posted a few screengrabs of it in various other threads as I've been working through the issues I've encountered along the way. A number of people have PM'd me to ask me to share the design & scripts that make it work etc... so here it is...

    Please note the following:

    1) It isn't finished yet, not all elements are working 100%
    2) various elements are dependent on plugins that you may not have (E.G. pjcComfort)
    3) the RSS data are also (obviously) specific to my location - London, UK.
    4) It isn't finished yet!

    I'll post up various components over the next few posts.... included in this one is the project XML file, I'll try & do the custom graphics shortly.

    Enjoy, improve, and share any progress back here please!

    Paul G.
    Attached Files

    #2
    Alarm clock scripts

    Here are the current scripts that drive things behind the alarm clock functions..

    Decrease wakeup alarm time - This script is associated with the down arrow beneath the alarm set time in the top-left corner. It decreases the time the the alarm is set to go off by 5 minutes each time it is run.

    Increase wakeup alarm time - This script is associated with the up arrow beneath the alarm set time in the top-left corner. It increases the time the the alarm is set to go off by 5 minutes each time it is run.

    Snooze.txt - this script is associated with the "snooze" button. It adds 10 minutes to the snooze time each time it is run, - up to a maximum of 30 minutes, when it cycles back round to zero. If left at zero, this is equivalent ot the snooze function being turned off, as it will disable the countdown event

    Snoozecountdown - this script is run by a recurring event that is set to run once every minute. each time it fires it takes 1 minute off of the snooze value, - so the display on the touchscreen counts down the remaining minutes.

    Pauls wakup-up script - pretty self explanatory I should think. This is the script that runs when the wake-up alarm finally goes off, - including after any snooze periods. Put in this script the things you want to happen, like the bedroom lights coming on etc.

    Next post will contain the DEVICES and EVENTS in homeseer that are required.

    enjoy!

    Paul G.

    EDIT: I made changes in the increase & decrease alarm scripts to cater for the mechanism I put in place to have 2 different alarm times at weekends & weekdays. The new scripts are now attached..
    Attached Files
    Last edited by pgordon; November 25, 2008, 12:17 PM.

    Comment


      #3
      Devices & events required

      The alarm touchscreen obviously requires a number of devices & events in Homeseer, as follows. Note that my scripts from the previous post refer to devices by housecode/unitcode, not by name, so you can call them what you like if you stick to the same codes.

      Devices: (see screengrab)

      v6 - next scheduled alarm time - this device exists purely to hold the time for the wake up alarm in its device string. The touschreen element that shows the alarm time in the top-left corner is associated with this.
      v7 - Weekday alarm time - this device exists purely to hold the time that the alarm will go off Monday-Friday inclusive
      v8 - Weekend alarm time - this device exists purely to hold the time that the alarm will go off on Saturdays & Sundays
      v11 - snooze duration - this device exists to hold the number of minutes of "snooze time" in its device string. It is associated with the text element on the screen that sits just to the right of the snooze button. This value is modified by the "snooze" & "snooze countdown" scripts.

      Events: (see screengrab)

      Decrease weekday alarm time - type: manual - Action: run script decrease wakeup alarm time - This is the event that is actually associated with the touch element

      Increase weekday alarm time - type: manual - Action: run script increase wakeup alarm time - This is the event that is actually associated with the touch element

      Snooze Countdown - type: recurring, every 1 minute - Action: run script SnoozeCountdown This event is disabled most of the time. it is enabled only when "snooze" is active, and counts down the minutes until it reaches zero, at which point it re-runs the wake-up alarm, and then disables itself.

      Snooze - type: manual - Action: run script snooze. This event is what is actually associated with the "snooze" button on the touchscreen.

      Cheers.

      Paul G.

      EDIT: changed the screenshot fot the devices I have to reflect the new mechanism for dual weekend/weekday alarms, which utilises more devices to hold the different set times.
      Attached Files
      Last edited by pgordon; November 25, 2008, 12:27 PM.

      Comment


        #4
        A word about the events

        Currently, and mainly because I found it easier for testing, many of the touschreen element associations are as follows:

        Touch element------>HS Event------->HS Script

        Clearly, the bit in the middle is unneccesary, since it could just as easily go:

        Touch element------>HS Script

        Which presumably should be more efficient, and is what I plan to change to later on...

        Paul G.
        Last edited by pgordon; November 21, 2008, 07:44 AM.

        Comment


          #5
          Explanantion of the elements

          refer to the image below:

          1: - Alarm time - the time that the wake up alarm is set to go off. This is held in the device string of HS device v7

          2: - Down arrow button. This decreases the alarm time by 5 minutes each time it is pressed. This is associated with the SCRIPT "Decrease wakeup alarm time"

          3: - Up arrow button. This increases the alarm time by 5 minutes each time it is pressed. This is associated with the SCRIPT "increase wakeup alarm time"

          4: - Snooze button. This cycles the snooze time by adding 10 to the current value each time it is pressed, until the value becomes >= 30 minutes, at which point it sets it to zero. This is associated with the SCRIPT: "Snooze"

          5: - Snooze time. This shows the current number of minutes of remaining snooze time. This will count down until it reaches zero, at which point the wake alarm event will fire again. this is associated with the device string of HS device v11
          Attached Files

          Comment


            #6
            Not yet implemented:

            The "Alarm Off" button doesn't yet do anything. My intent is that this will enable/disable the following days wakeup alarm by disabling the event "Pauls wakeup alarm". It will indicate the status by:
            - Hiding the little alarm clock icon to the left of the alarm time
            - Changing the alarm time font colour to something fainter
            I haven't decided whether or not I want the alarm to auto-re-enable after a day, or wheterh it's a "hard" alarm off function, whereby it stays of unless & until I enable it again..

            Different alarm times for weekdays/weekends
            It was always my intention to have multiple alarm schedules, - at least two, so I'd have a later wake up at weekends. I already have a device in HS with the later time in its string, and an event that is scheduled for weekend days only. I just haven't decided how to bring this into the touchscreen management yet. - I don't want to have to do anything from a user perspective, - I want the touchscreen to "just know" if the following day is a weekday or weekend day, & display the alarm time accordingly... I have a couple of ideas how to do this, but I'm open to suggestions!

            Paul G.

            Comment


              #7
              You're fast Paul, many thanks! Will let you know how it worked out. I'm sure many will benefit from your contributions.

              Comment


                #8
                Current issues & oustanding fixes required

                I've noticed an issue when setting the snooze time, which Ive figured out is due to the fact that when the countdown event is enabled from its disabed state, it fires immediately, and thus the snooze time goes to 9 minutes rather than 10. Subsequent presses though correctly add 10 minutes, as the event is already enabled & doesn't get enabled again...
                so currently, instead of going: 0-10-20-30-0 <repeat>, it goes: 0-9-19-29-0

                This isn't really a big problem, but I'd like to code round it at some point, to get back to my intended cycle...

                P.
                Last edited by pgordon; November 23, 2008, 10:51 AM.

                Comment


                  #9
                  That's funny,
                  We've been trying to get this for MainLobby 2 for a while and you just whip it up. Nice! thank you!


                  ~Bill

                  Comment


                    #10
                    Changes for dual alarm times

                    I made a change to the mechanism I've been using in order to accomodate having a different alarm time at the weekend.

                    In essence, I now use an additional virtual device, making 3 in total, defined as follows:
                    v6 = the actual time of the next alarm event - this is now the device that the touchscreen element tracks.
                    v7 = Weekday alarm time
                    v8 = weekend alarm time

                    I've changed the device that the touch element is associated with from v7 to v6. I Also changed it in the scripts run by the up & down arrow buttons. The increase & decrease scripts now set the time on two out of the three devices: it always sets v6, and it additionally sets either v7 OR v8, depending on whether the next scheduled alarm event occurs on a weekend or weekday...
                    To ensure that when a weekend comes around, the schedule automatically changes to the weekend time, I added some extra script to my "daily reset" event, which I happen to run every day at 04:30. This checks if it is a weekend or weekday and updates the device string of v6 (by copying it from either v7 or v8) and reshedules the alarm event as appropriate.
                    Thus I can set 2 different alarm times, and Homeseer will automatically fire the alarm event at the right time for a weekday vs a weekend...

                    Paul G.
                    Attached Files

                    Comment


                      #11
                      I think you should have included the graphices that you used. On the buttons with the missing graphics all the assoc actions are also missing.
                      Thanks,

                      T.
                      _________________________________
                      Staying on the cutting edge is EXPENSIVE

                      Comment


                        #12
                        I will endeavour to in the next couple of days. Things are a bit hectic just now.

                        Paul G.

                        Comment


                          #13
                          Hello, I have attempted to implement your HSTouch Alarm Clock. It is very impressive and I think I understand what you are doing. The issue I am having right now is that I am unable to initially set the V6, V7, and V8 values. They all are default, and the up and down arrows have no effect. The snooze button does increment the V11 variable from 10 to 20 to 30 and then back to 0, and the snooze countdown script also decreases V11 as it should. So that is working, but the other scripts are not doing anything. I can see the "Last ran:" time changing as I press the buttons in HSTouch, but execuing the script does not do anything to V6, 7 or 8.

                          Any help would be appreciated.

                          Keith

                          Comment


                            #14
                            Hi Keith.

                            Good point! - I forgot to mention that when I set up all those virtual devices, I did knock up & run a quick one-off script just to set the initial values of them to something sensible... I guess it wouldn't be a bad idea to put a couple of extra lines in the main script to cater for that situation, but for now, just make yourself a one-off script with a bunch of .SetDeviceString commands in it to get them initially set to a suitable value, e.g:

                            hs.setdevicestring "v6", "08:30"
                            hs.setdevicestring "v7", "08:30"
                            hs.setdevicestring "v8", "08:30"

                            run that once, and you should be good to go!

                            Paul G.

                            Comment


                              #15
                              Paul,
                              I seem to have every thing working except that the alarm never triggers. Am I supposed to set up an event to run "Pauls wakeup script"? If so could you show me what the trigger will be.
                              Thanks,

                              T.
                              _________________________________
                              Staying on the cutting edge is EXPENSIVE

                              Comment

                              Working...
                              X