[RELEASE] Alexa Notifications Driver

This driver allows you to setup a notification device for use with the NotifyMe Alexa Skill (Notify Me - Thomptronics). When you send a notification to it, your Alexa devices will chime and show a notification from "NotifyMe" and will contain the text of your notification. This is NOT a TTS service.

Installation:

  1. Go to the Alexa Skills Store (or ask Alexa ) to enable the Notify Me skill.
  2. After you enable the Notify Me skill, you'll get an email with your access code.
  3. Go to Drivers Code and create a new Driver.
  4. Import or copy the code.
  5. Create a new virtual device with a type of Alexa Notifications Driver.
  6. In the driver settings, set your access code.
  7. Use like other notifications drivers.
/**
 *  Alexa Notifications Driver
 *  https://raw.githubusercontent.com/code-in-progress/hubitat-drivers/master/alexa-notifications/alexa-notifications.groovy
 *
 *  Copyright 2019 CoreRootedXB
 *
 *  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.
 *  
 *  Change History:
 *
 *    Date        Who             	What
 *    ----        ---             	----
 *    2019-03-25  CoreRootedXB   	Original Creation
 * 
 */

metadata {
    definition (name: "Alexa Notifications Driver", namespace: "corerootedxb", author: "CoreRootedXB") {
        capability "Notification"
    }
}

preferences {
    input name: "accessCode", type: "string", title: "Access Code", description: "Visit Notify-Me before using this", required: true
	input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
}


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

def installed() {
    updated()
}

def updated() {
	if (logEnable) {
		runIn(1800,logsOff)
		log.debug "Updated access code: $accessCode"
	}
}

def parse(String description) {
}

def deviceNotification(String msg) {
	if (logEnable) log.debug "sending message: $msg"
	
	def params = [
    	uri: "https://api.notifymyecho.com/v1/NotifyMe",
    	body: [
        	notification: "$msg",
			accessCode: "$accessCode"
    	]
	]

	try {
		httpPostJson(params) { resp ->
			resp.headers.each {
				if (logEnable) log.debug "${it.name} : ${it.value}"
			}
			if (logEnable) log.debug "response contentType: ${resp.contentType}"
		}
	} 
	catch (e) {
		log.error "something went wrong: $e"
	}
}
3 Likes

Interesting, but I'm not sure what this would be used for in a Hubitat environment?

Along the same lines as Pushover, just goes to Alexa as a notification. It doesn't require cookies or anything like that and will show the "Orange" light (on non-Show/Spot) devices. I use it from NodeRed for my wife to get "home reports". So, I figured I'd port it over to a notification driver on HE.

For example, when my mail gets delivered (because we all have contact sensors on our mailboxes, RIGHT?!), rather than getting a TTS that I might miss, I can send it as a notification and see it when I get in front of one of my Echos and/or to Pushover.

It was just something I wanted to throw together. :smiley:

Ah ok, I missed the part where the ring turns orange. I assume at that point you just ask Alexa to read you your notifications? I could see some potential uses for this...(and by the way, I too have a sensor in my mailbox....lol!)

Thanks for putting the time in to bring this to Hubitat!

1 Like

Yup: "Alexa, what's my notification?"

I'm thinking about throwing together the actual skill (and lambda code) because the notification title is "From NotifyMe, [text]". I want to customize it (because why wouldn't I???).

1 Like

Please do! I'd like to learn how to program Alexa skills :wink: .

I have an inventory program with a shopping list, and I want to integrate the shopping list with the Alexa shopping list, just started setting up the skill for that and WAY over my head right now!

1 Like

Wow. This was exactly what I was looking for to trigger Amber Light Notifications on all my Alexa devices at once, no grouping necessary. I must admit that the thread is a bit older and didn’t gain much traction so I was thinking it wouldn’t work. Simple, however it works great. I like that the co-app is called “Notify Me” which makes the intent clear by name alone before each message.

Thanks very much!

-Travis

Whoah, this is so awesome! We're very Alexa-centric around here and when I ran across the Notify Me skill from Thomptronics I knew it was going to fill out the big gap in functionality with respect to Hubitat notifications on Alexa - starting with, of course, my mailbox delivery notifier, but also "garage door open" reminders, appliances left on...etc etc.

Awhile back I got my own Notify Me access code and had just tonight kludged up a RM rule with an HTTP Push action to test it, and was impressed that it worked the first time. While I started to think about how I could package this up for general purpose use I realized I'd better check the forums (because I'm rarely the first one with a good idea) and ran across your device driver - I'm not a groovy programmer yet and would not have been able to craft this general-purpose of a solution myself. Now if only HE's built-in Notification app was able to recognize this notification device...

Thanks for putting this together! Please consider adding it to the Hubitat Package Manager so we can stay abreast of any improvements you make to it.

Download the Hubitat app