# Most basic app, but doesn't work

**URL:** <https://community.smartthings.com/t/most-basic-app-but-doesnt-work/68956>\
**Category:** Writing SmartApps\
**Created:** [December 19, 2016, 10:52pm UTC](https://community.smartthings.com/t/most-basic-app-but-doesnt-work/68956 "2016-12-19T22:52:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![randyscott777](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/randyscott777/32/44341_2.png) [@randyscott777](https://community.smartthings.com/u/randyscott777)\
**Post date:** [December 19, 2016, 10:52pm UTC](https://community.smartthings.com/t/most-basic-app-but-doesnt-work/68956/1 "2016-12-19T22:52:54Z")

</div>

preferences {  
section {  
input “switch1”, “capability.switch”, title: “Where?”, multiple: true, required: true  
}  
}

def installed() {  
log.debug "Installed with settings: ${settings}"  
initialize()  
}

def updated() {  
log.debug "Updated with settings: ${settings}"  
unsubscribe()  
initialize()  
}

def initialize() {  
subscribe(switch1, “switch”, switchOnHandler)  
}

def switchOnHandler(evt) {  
switch1.on()  
log.debug “switch turned on!”  
}

I can’t the simulator to turn the switch on (even though it should be on from the very beginning)  
I’m thinking that the switch device handler I tried writing, but subsequently deleted is somehow still involved

---

<div class="post-metadata">

**Author:** ![caglar10ur](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/caglar10ur/32/44320_2.png) [@caglar10ur](https://community.smartthings.com/u/caglar10ur)\
**Post date:** [December 20, 2016, 12:26am UTC](https://community.smartthings.com/t/most-basic-app-but-doesnt-work/68956/2 "2016-12-20T00:26:58Z")

</div>

I believe there is something going on with the simulator as it is not working for me, too. Already created a support ticket and will let you know if I hear something from them.

---

<div class="post-metadata">

**Author:** ![tgauchat](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/tgauchat/32/49516_2.png) [@tgauchat](https://community.smartthings.com/u/tgauchat)\
**Post date:** [December 20, 2016, 12:42am UTC](https://community.smartthings.com/t/most-basic-app-but-doesnt-work/68956/3 "2016-12-20T00:42:14Z")

</div>

Never **_trust_** the Simulator.

Publish “for me” and test on your phone saves a lot of headaches, even if it takes a little longer.

---

<div class="post-metadata">

**Author:** ![randyscott777](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/randyscott777/32/44341_2.png) [@randyscott777](https://community.smartthings.com/u/randyscott777)\
**Post date:** [December 20, 2016, 2:27pm UTC](https://community.smartthings.com/t/most-basic-app-but-doesnt-work/68956/4 "2016-12-20T14:27:58Z")

</div>

OK, that is what I’ll do for now on.

---

<div class="post-metadata">

**Author:** ![IvanR](https://avatars.discourse-cdn.com/v4/letter/i/46a35a/32.png) [@IvanR](https://community.smartthings.com/u/IvanR)\
**Post date:** [December 26, 2016, 11:02am UTC](https://community.smartthings.com/t/most-basic-app-but-doesnt-work/68956/5 "2016-12-26T11:02:24Z")

</div>

Never trust Smartthings to get it right
