Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
metadata {
// simulator metadata
simulator {
// status messages
// none
// reply messages
reply "'on','delay 2000','off'": "switch:off"
// UI tile definitions
tiles {
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {
state "off", label: '${name}', action: "switch.on", icon: "", backgroundColor: "#ffffff", nextState: "on"
state "on", label: '${name}', action: "", icon: "st.switches.switch.on", backgroundColor: "#79b821"
main "switch"
details "switch"
def parse(String description) {
def pair = description.split(":")
createEvent(name: pair[0].trim(), value: pair[1].trim())
def push() {
['on','delay 2000','off']
def off() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment