Thoughts for alarm clocks?

I just setup Gentle Wakeup and Circadian Daylight (hope they work well together!). I'm trying to find an easy way to be able to adjust my alarm time easily. You know, some days I need to get into work early, I have an appointment on a weekend, etc. I'm wondering, how have others tackled this problem?

Glad you’re liking CD! I’ve been working on a regular alarm clock that you can adjust the time normally on. I’ve got a contact sensor attached to the piezo buzzer on it, and when it buzzes, the lights start to dim. I plan to use it for guests, but need to finish cleaning it up :sweat_smile:

1 Like

Getting married doesn't mean you can slack off, you know :rofl::rofl:

Just kidding, not sure if I congratulated you before, so accept my congratulations now!

1 Like

Don’t tell my wife that—she’ll have me working to no end :sweat_smile:

Thanks a ton!! It’s been one heck of a celebration, and I couldn’t be more grateful for everything about marriage. :slight_smile:

3 Likes

I have a very convuluted way of being able to set this through a voice command to Google Home. First thing I did was to create a Global Variable and a Global Variable connect of the "string" type in Rule Machine. I then added that GV connector to the Maker API.

Next, I created an IFTTT applet to allow me to speak a command with a number component to Google home. This is the applet I created.

You can see that I speak to the command with the number to google home and then it sends that value over to the GV connector. The only limitation is that you cannot sue the term TIME anywhere in your command. This will totally screw up Google Home, making it think you want to set an alarm rather than a number value. You have to use a decimal instead. So, instead of saying twelve o'clock, i say twelve point zero.

I then have a rule that is triggered based off this variable being set. This rule parses out the time and calculates the number of minutes from the current time until the the time I have spoken to GH will occur.

I also have the rule reset this value if I speak zero (unset) the GV.

This passes a custom command off to a driver I wrote.

/*
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import groovy.transform.Field

metadata {
    definition(name: "Wake Up Switch", namespace: "ryan780", author: "Ryan780") {
        capability "Switch"
		capability "Refresh"
		command "wakeUpTime", ["minutes"]
        attribute "onTime", "string"
        attribute "offTime", "string"
    }
}

preferences {
    section() {
        input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
		input name: "gapTime", type: "integer", title: "Gap between on and Off", defaultValue: "60"
	}
}

def logsOff() {
    log.warn "debug logging disabled..."
    device.updateSetting("logEnable", [value: "false", type: "bool"])
}

def initialize(){
}

def installed(){
    initialize()
}

def refresh(){
    unschedule()
	sendEvent(name: "onTime", value: "----", displayed: True)
	sendEvent(name: "offTime", value: "----", displayed: True)
}

def updated() {
    log.info "updated..."
	state.gapTime = settings.gapTime.toInteger()
}


def on() {
    if (logEnable) {log.debug "Turned On"}
    sendEvent(name: "switch", value: "on")
    sendEvent(name: "onTime", value: "----", displayed: True)
}

def off() {
	unschedule()
	sendEvent(name: "switch", value: "off")
    sendEvent(name: "onTime", value: "----", displayed: True)
	sendEvent(name: "offTime", value: "----", displayed: True)
}


def wakeUpTime(delay){
	unschedule()
	def offDelay= (delay.toInteger())*60
	def onDelay = offDelay - (state.gapTime*60)
	if (logEable) log.debug ("Turning on in $onDelay seconds and off in $offDelay seconds")
	runIn(onDelay, onP)
	runIn(offDelay,offP)
    def onTime = new Date(now() + (onDelay * 1000)).format('h:mm a',location.timeZone)
	def offTime = new Date(now() + (offDelay * 1000)).format('h:mm a',location.timeZone)
	sendEvent(name: "onTime", value: onTime, displayed: True)
	sendEvent(name: "offTime", value: offTime, displayed: True)
}


def onP() {
    if (logEnable) log.debug "Turned On-Delayed"
    sendEvent(name: "switch", value: "on", type: "physical")
    sendEvent(name: "onTime", value: "----", displayed: True)
}

def offP() {
    if (logEnable) log.debug "Turned Off-Delayed"
    sendEvent(name: "switch", value: "off", type: "physical")
    sendEvent(name: "offTime", value: "----", displayed: True)
}

This driver's switch will turn on at the time spoken to GH minus the number of minutes entered in the "Gap Time" setting and then off at the time spoken to GH. Also, in order to determine if the change was by the software or by me, the automatic changes are destinguished as physical while changes to the switch made by me in the edit device or dashboard are not detected as physical. That way I can write a rule that will only trigger off the automatic changes the driver does and not if I have to manually intervene.

I too have a very, VERY variable schedule and I am using this to activate my heat 30 minutes before I wake up in the morning. It hasn't failed me yet in over a week of working with it. There are many limitations, only works from 12pm to the am the next morning. You could not, for example, set an alarm for 3pm tomorrow at 9pm. You would have to speak in military time and say 15.0 to google home to get that to work. But this is one way I've gotten around RM not dealing with time at all.

2 Likes

I use two options for this. I have an echo dot near my bed, and an ifttt rule that turns on a virtual switch triggering my rule machine good morning routine. My backup oversleep insurance is an alarm clock app that I set for an hour later. That app integrates with tasker and kicks off a series of http requests to the maker api that escalate actions until things get to the point where if you're not out of bed, you probably never will be. Sirens blaring, lights flashing chaos.

They are annoying and ruin a weekend.