"Off as Toggle" -- Co-purpose your off switch to something useful!

Due to cloud processing, I found Double Tap to be unusable. I made an app called “Better Double Tap” that works a little better, but it’s still not very reliable. I wanted something 100% reliable. Well, this is it! (As long as you have a switch/dimmer with a discrete “off” button, like GE ones)

This app allows you to co-purpose the “off” switch on your switch/dimmer to toggle other light(s). In my case, I have some track lights on a Zwave Dimmer and a GE Link Bulb in a corner lamp. I wanted to be able to control the corner lamp bulb reliably. With this app, when my Zwave Dimmer is off, pressing off will toggle the corner lamp. My source code includes detailed information regarding adjustments you may need to make to your device type to make this work as well as a word about performance. Enjoy!

I actually am using this exact same idea on a SmartApp I’m working on for a door swing counter at a retail location that factors in employee proximity based off their smartphone presence and the open/close schedule. This lets me handle all of the logic in SmartThings and let ITTT handle the Google Docs updates so I can graph true customer door swings and base a proper schedule off of that. I thought I was so smart using the SmartSwitch as semiphore to flag ITTT :wink:

Good morning,
I am trying to use your code but I keep getting an error and wont let me save the code.

× startup failed: script1462195694261423278166.groovy: 31: unexpected token: name @ line 31, column 8. 31 name: " Off as a Toggle ", ^ 1 error

I have checked and everything seems to be fine. I can’t figure out why it keeps telling me this. Can you help me out. Thanks…