How to handle default behavior after power loss

The title is misleading but what I am trying to accomplish is simply having a z-wave external plug adapter turn on regardless of it’s previous state once power is restored to it and it connects to Smartthings hub after loss of power to the plug. The reason I want to do this is I have two lamps connected to a single zwave external plug in the bedroom that I turn off and on via the app. There’s also a switch on the wall that controls power to the receptacle that the z-wave plug is connected to. If I turn the switch on I want the lamps to always turn on- but say I left it on, and I turned off the lamps using the app. So when I end up leaving the bedroom and coming back in, I’d like to be able to turn the switch off, turn it back on and have the z-wave plug recognize it has lost power and re-connected to Smartthings and turn on automatically. I’ve built several of my own smartapps but am looking for the variable that I can subscribe to that would show a re-connect. eg. switch.connect or something… Thanks for your help!

I know, I know- why don’t I just get a switch and replace it… I would but I am moving soon, and don’t want to replace that switch too! I have already changed out three in the house that I have to switch back in a few months. I just got started with Smartthings and are in love with this technology- :slight_smile:

Hm, that’s a tricky one. The Z-Wave plug doesn’t actually send our hub a message when it’s “plugged” back in, so you’ll have to wait for a poll to notice that the switch is connected again. Right now, that could be 5 minutes. In the next version of firmware, the hub polls Z-Wave switches more frequently, like 6 seconds, but even then if the device is unresponsive for a while it slows down the polling of it.

Thank you @duncan for the explanation, I was afraid of that- and noticed on the logs this behavior as well. No worries- I’ll work it out. :slight_smile: