Example: Alarm Clock (Working Example)

Hi all-

I wanted to highlight a working example of the alarm clock function I’ve been using for over a year without any issues. Hopefully it will help someone wanting to do this or something similar to trigger a rule at a specific time. My dashboard for the alarm clock functionality looks like this:

I’m happy to share any details of exactly how this works, but the basic functionality is this:

  • each room has its own alarm clock with an on/off switch
  • there is an ‘alarm time’ which can be entered directly into the tile
  • the alarm can be manually triggered with the ‘wake up’ button
  • Alarm times resert daily with the ‘default time’ (in case you set it for a different time, it will reset each day to the default)
  • the default can be changed as well via a tile
  • defaults can be switched based on weekday vs weekend.
  • an ‘override’ switch which won’t set the alarms to the default (think: over christmas break, kids alarms won’t reset every night)

The way the timing works is:

  • I have an automation in smartthings (not sharptools), which runs every minute and triggers a simulated switch to turn on every minute
  • a rule (‘alarm clock trigger’) rule runs when the simulated switch turns to true. the rule checks to see if a) today is a holiday, b) the alarm clock is turned ‘on’, and c) if the current time is equal to the alarm time:

  • a rule (‘alarm clock’) runs if the trigger has been set to true in the trigger rule – or if ‘wake up’ has been manually turned on.

Again, happy to provide more details if anyone wants them. The structure has been working flawlessly for over a year.

Hope this helps.