Skip to content

Instantly share code, notes, and snippets.

@mckeed
mckeed / intermatic-switch
Created August 1, 2014 01:19
Intermatic Switch SmartThings Device Type
metadata {
// Automatically generated. Make future change here.
definition (name: "Intermatic Switch", namespace: "mckeed", author: "Duncan") {
capability "Actuator"
capability "Switch"
capability "Refresh"
capability "Sensor"
fingerprint inClusters: "0x25"
}
@mckeed
mckeed / intermatic-dimmer.groovy
Created July 31, 2014 22:04
Intermatic Dimmer SmartThings Device Type
metadata {
// Automatically generated. Make future change here.
definition (name: "Intermatic Dimmer", namespace: "mckeed", author: "Duncan") {
capability "Switch Level"
capability "Actuator"
capability "Switch"
capability "Refresh"
capability "Sensor"
}

Keybase proof

I hereby claim:

  • I am mckeed on github.
  • I am mckeed (https://keybase.io/mckeed) on keybase.
  • I have a public key whose fingerprint is C586 8290 56ED AE14 3C01 04ED 41E1 CC39 AA4E D6B6

To claim this, I am signing this object:

@mckeed
mckeed / toggle-button
Created January 16, 2014 05:03
Toggle Button SmartApp to toggle a switch when you press a button on an Aeon remote control.
preferences {
section("When I push a button on this remote") {
input "button", "capability.button", title: "Button"
}
section("Which button:") {
input "whichButton", "number", defaultValue:1
}
section("Toggle these switches") {
input "switches", "capability.switch", multiple: true, required: false
}
@mckeed
mckeed / mode-button.groovy
Created January 16, 2014 05:00
Mode Button SmartApp to change modes or turn on/off lights from Aeon remote controls.
preferences {
section("When I push a button on this remote") {
input "button", "capability.button", title: "Device"
input "whichButton", "number", defaultValue:1, title: "Which button"
}
section ("When I push the button") {
input "pushMode", "mode", title: "Change mode to", required: false
input "switchOn", "capability.switch", title: "Turn on switches", required: false, multiple: true
input "switchOff", "capability.switch", title: "Turn off switches", required: false, multiple: true
}
@mckeed
mckeed / zwave-smoke-alarm.groovy
Created October 10, 2013 15:48
SmartThings device type handler for the BRK First Alert ZSMOKE
metadata {
simulator {
}
tiles {
standardTile("smoke", "device.smoke", width: 2, height: 2) {
state("clear", label:"clear", icon:"st.alarm.smoke.clear", backgroundColor:"#ffffff")
state("detected", label:"SMOKE", icon:"st.alarm.smoke.smoke", backgroundColor:"#e86d13")
state("tested", label:"TEST", icon:"st.alarm.smoke.test", backgroundColor:"#e86d13")
}
@mckeed
mckeed / zigbee_catchall
Last active November 3, 2020 18:06
Catchall ZigBee packet format
FIELD BYTES
profile ID: 2
cluster ID: 2
source EP: 1
dest EP: 1
options: 2
type: 1
source: 2
clustersp: 1
mfgsp: 1
@mckeed
mckeed / telscan
Last active December 18, 2015 00:49
Script that uses nmap to look for local devices that respond to broadcast ping and have open telnet ports
#!/usr/bin/env ruby
# Looks for local devices that respond to broadcast ping and have open telnet ports
`ifconfig`.scan(/broadcast ([\d.]+)/) do |b,|
next unless b[/^(192|10)\./]
puts "Scanning #{b.gsub(/255/, '*')}"
`ping -c2 #{b}`.scan(/from ([\d.]+)/).uniq.sort_by {|a,|
a.split('.').map {|p| p.to_i }
}.each do |a,|
@mckeed
mckeed / dark_sky_growler.rb
Created April 21, 2013 20:07
My script to use the DarkSky API to tell me when it's going to start raining in the next hour. When I bike to work, I run this on a launchd job every 10 minutes from 4:00-6:00.
#! /usr/bin/env ruby
# encoding: UTF-8
require 'rubygems'
require 'active_support/core_ext'
require 'rest_client'
require 'json' unless defined?(JSON)
require 'growl'
API_KEY = ENV["DARKSKY_API_KEY"]
@mckeed
mckeed / post-merge
Created June 8, 2012 20:05
A useful post-merge git hook for Rails projects. Automatically runs bundle install and rake db:migrate. Put it in .git/hooks
#!/bin/bash
if [ ! -z `git diff --name-only HEAD@{1}..HEAD Gemfile` ]
then
echo -e "\033[0;31m*** Gemfile change detected, running bundle install ***\033[0m"
bundle install
fi
if [ ! -z `git diff --name-only HEAD@{1}..HEAD db/migrate` ]
then