Skip to content

Instantly share code, notes, and snippets.

@aurman
aurman / exampleOauth.php
Last active Apr 6, 2019
SmartThings .php example authenticating and controlling SmartThings API endpoints
View exampleOauth.php
<?php
//client id and client secret
$client = '';
$secret = '';
//hardcode the full url to redirect to this file
$url = "";
//STEP 1 - Get Access Code
@aurman
aurman / enpointExample.groovy
Created Mar 27, 2014
SmartThings API Endpoint Example
View enpointExample.groovy
/**
* App Endpoint API Access Example
*
* Author: SmartThings
*/
preferences {
section("Allow Endpoint to Control These Things...") {
input "switches", "capability.switch", title: "Which Switches?", multiple: true
input "locks", "capability.lock", title: "Which Locks?", multiple: true
@aurman
aurman / on-off-shield-example.groovy
Last active May 27, 2018
Device Handler Code for On/Off Shield (example)
View on-off-shield-example.groovy
/*
* On/Off Shield (example)
*
* Author: urman
* Date: 2013-03-14
* Revision: 2014-07-10
* Capabilities:
* Switch
* Custom Attributes:
* greeting
@aurman
aurman / read_from_arduino.groovy
Last active Apr 12, 2017
Read string from Arduino
View read_from_arduino.groovy
/**
* Read From Arduino
*
* Author: urman
* Date: 2013-03-14
* Revision 2014-07-10
*/
// for the UI
metadata {
@aurman
aurman / ge-link-bulb.groovy
Last active Jan 30, 2017
GE Link Bulb Device Handler (Beta)
View ge-link-bulb.groovy
@aurman
aurman / Shield_on_off_hello.ino
Last active Sep 20, 2016
Arduino On Off Hello
View Shield_on_off_hello.ino
//*****************************************************************************
/// @file
/// @brief
/// Arduino SmartThings Shield LED Example
//*****************************************************************************
#include <SoftwareSerial.h> //TODO need to set due to some weird wire language linker, should we absorb this whole library into smartthings
#include <SmartThings.h>
#define PIN_THING_RX 3
@aurman
aurman / centralite-dimmer.groovy
Created Oct 15, 2013
centralite-dimmer.groovy
View centralite-dimmer.groovy
metadata {
// simulator metadata
simulator {
// status messages
status "on": "on/off: 1"
status "off": "on/off: 0"
// reply messages
reply "zcl on-off on": "on/off: 1"
reply "zcl on-off off": "on/off: 0"
View aeon-door-window-sensor.groovy
/**
* Aeon Door/Window Sensor
*
* Author: SmartThings
* Date: 2013-04-23
*/
// for the UI
metadata {
// simulator metadata
View gist:6720308
metadata {
// simulator metadata
simulator {
// status messages
status "on": "on/off: 1"
status "off": "on/off: 0"
// reply messages
reply "zcl on-off on": "on/off: 1"
reply "zcl on-off off": "on/off: 0"
View gist:6616375
/****
* Mode Change AWAY
* Bon Voyage with some minor additions
*
* Author: SmartThings
* Date: 2013-03-07
* Mods by Carl Aydelotte
*
* Monitors a set of presence detectors and triggers a mode change when everyone has left plus an indicator light to display when
* the mode is set to AWAY