GARY D, I just wanted to say, “Bravo!” I’ve only been “live” with SmartThings for two days now and am extremely pleased with my lighting automation (I installed several GE in-wall dimmers and toggles). However, I was more than a little annoyed that the Linear GD00Z-4 was not yet fully supported. I really wanted to set up presence detection open/close and now I can thanks to your code. After a little trial and error on my part, I can report that it works brilliantly!