Skip to content

Instantly share code, notes, and snippets.

View gist:6386130
def switchMode{
def map = [:]
switch (cmd.mode) {
case zigbee.smartShield(text: "F,0").format()
break
case zigbee.smartShield(text: "F,1").format()
break
case zigbee.smartShield(text: "F,2").format()
break
}
View Mailbox.groovy
/**
* Garage Door Monitor
*
* Author: SmartThings
*/
preferences {
section("When the garage door is open...") {
input "multisensor", "capability.threeAxis", title: "Which?"
}
section("For too long...") {
View alarm-capability.groovy
metadata {
simulator {
// reply messages
["strobe","siren","both","off"].each {
reply "$it": "alarm:$it"
}
}
tiles {
standardTile("alarm", "device.alarm", width: 2, height: 2) {
View arduino-thingshield.groovy
metadata {
// Simulator metadata
simulator {
// status messages
status "ping": "catchall: 0104 0000 01 01 0040 00 6A67 00 00 0000 0A 00 0A70696E67"
status "hello": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A48656c6c6f20576f726c6421"
}
// UI tile definitions
tiles {
View lock-capability.groovy
metadata {
simulator {
status "locked": "lock:locked"
status "unlocked": "lock:unlocked"
reply "lock": "lock:locked"
reply "unlock": "lock:unlocked"
}
tiles {
View momentary-button-tile.groovy
/**
* Momentary Button Tile
*
* Author: SmartThings
*
* Date: 2013-05-01
*/
metadata {
// simulator metadata
simulator {
View momentary-capability.groovy
metadata {
// simulator metadata
simulator {
// status messages
// none
// reply messages
reply "'on','delay 2000','off'": "switch:off"
}
View smartsense-garage-door-multi.groovy
/**
* SmartSense Garage Door Multi
*
* Author: SmartThings
* Date: 2013-03-09
*/
metadata {
simulator {
status "open": "zone report :: type: 19 value: 0031"
status "closed": "zone report :: type: 19 value: 0030"
View smartsense-garage-door-sensor-button.groovy
/**
* SmartSense Garage Door Sensor Button
*
* Author: SmartThings
* Date: 2013-03-09
*/
metadata {
simulator {
status "acceleration": "acceleration: 1, rssi: 0, lqi: 0"
status "no acceleration": "acceleration: 0, rssi: 0, lqi: 0"
@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