[Solved] Android Alarm Clock Triggers Thing


#1

1) Give a description of the problem
I have 4 modes which are primarily intended to control my lights: 1) Away - lights are off. 2) Home Day - Lights are manual control only. 3) Home Night - Lights are triggered by motion sensor to turn on to 100% brightness. 4) Home Sleep - Lights are triggered by motion sensor to turn on to 10% brightness. Using presence and time I can swap between most of these modes as I need. The challenge is swapping to/from Home Sleep mode. As my bedtime varies, I have a button by my bed which turns the lights out and sets Home Sleep mode on. Currently I use the same button to change from Home Sleep mode to Home Day mode the next morning. Can this be linked to an alarm clock instead to automate this morning routine?

2) What is the expected behavior?
On android phone alarm clock going off the mode changes to Home Day.

3) What is happening/not happening?
Nothing is happening as I do not know how to do this.

**4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)
N/A


#2

See if you can find an Android alarm clock that has a tasker integration. you can have tasker make a webcall when the alarm goes off. The webcall would be to webcore piston that will execute your tasks or just plainly switch modes.

Edit: Out of curiosity I tried it with just plain tasker and the samsung alarm clock. There is an alarm clock event in tasker and you can make it do the webcall. I only tested it briefly and not too sure how to go about isolating just one alarm if you have multiple.


#3

So I have this working perfectly and thought I would share what I found. It seems there are two ways do do this: 1) Tasker or 2) Google routines. The latter is my preferred approach as you do not need to install any additional apps on your phone or paid subscriptions.

1) Tasker
Tasker includes an event trigger for the Alarm Clock. Unfortunately, I could not get it to work and from searching online it seems it no longer works with the default android alarm clock. I found another alarm app (Turbo Alarm) which is free and has a tasker plugin. This can be used to make a profile which is triggered when an alarm goes off. To manage the task side of things, I already had sharptools which offers tasker integration which allowed me to change the location mode.

2) Google Routines
The default android alarm clock allows each alarm to trigger a Google assistant routine. One of items your routine can contain is “adjust lights, plugs, and more.” Within the smartthings IDE I added a new device and set it as a virtual switch. Now, when the alarm goes a Google routine is triggered which turns on the virtual switch. From within webcore you can set up whatever actions you want to occur when this switch is turned on. Unfortunately, Google routines cannot toggle this switch so it is necessary to turn it off again at the end of the day for it to work again with the following alarm. I simply set it so that the virtual switch turns off when I enter Home Sleep mode.

I hope this helps someone else!

Here is the latest revision of the piston that toggles my modes, based on a combination of my location, time and the alarm clock. Switch 3 is the virtual switch turned on by the alarm clock. The keypad buttons are a remote control I have in the bedroom.