Turn on smartplug when power is restored to outlet?


#1

1) Give a description of the problem
I’m using a: HAOZEE Z Wave Plus Mini Smart Power Plug to control a lamp. The outlet it is plugged into is also controlled by a standard (non-smart) switch. So when the switch is physically turned off the smart plug will show as disconnected in smartthings after some time. Switch on and the device reconnects and can be controlled by webcore/smartthings again. I’d like to create a piston that says when the smartplug is reconnected to smartthings turn the power on (regardless of previous state).

2) What is the expected behavior?
Flip the physical switch on, and regardless of the previous state of the smart plug turn it on.

3) What is happening/not happening?
The smartplug defaults to its previous state. So I’ll turn off the light via smartthings at night. Then the next day my wife will flip the switch off and on again and the plug stays in the off state. I’m trying to get it so flipping the switch off and back on again will turn the smartplug back on without needing to turn it on manually via smartthings again. I’ve tried to use a few different triggers in webcore but none trigger when the device reconnects to smartthings.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)


#2

Try logging the events from Outlet 1 for now and watch for the correct attribute and value to use in your piston.

On events from Outlet 1
Log $currentEventAttribute : $currentEventValue

#3

I’m pretty new here. Have no idea how to do what you’re suggesting :frowning_face:

I was able to add ‘on event from outlet 1’ but then it makes me specify a value. I am thinking you mean for it to trigger on any event and then that event name and value would be logged?


#4

Your mileage may vary, but usually it takes SmartThings many seconds to realize that an old device now has power running to it… This means if you kill power to the outlet, the turn on will never be as snappy as you want.

An easy solution (if you have Alexa or Google Home) is to program, err, teach the wife to use her voice to toggle the lamp. (Alexa, turn on lamp) This way, the outlet keeps power, your pistons can still run, as well as your routines.

The general rule of thumb is that smart devices (such as your smart outlet) should always have power running to it.


#5

You’re right, I didn’t think that one through :smiley:

Try this… make a duplicate of the on event and use healthStatus in place of $status.


#6

Thanks for the help. Now I guess I’ll see if it reports anything when power is restored, and will just cycle through the different options to see if any of them make sense.


#7

I have a piston that watches $status for one of my presence sensors and the values come back as ACTIVE or INACTIVE, so take note of that since the comparison is case sensitive.


#8

Yeah I was afraid of that. I have some smart bulbs that behave like I want this to behave (when power is restored the bulb always turns back on by default), and figured it would be easy to trigger on device reconnection but I guess nothing is easy! As for the wife it doesn’t matter what I tell her, she’ll stand there and flip the switch on and off a bunch of times and say its not working again… why do you have to make things so complicated, and they never work right??? Lol.


#9

Don’t laugh, but I have actually used black electrical tape to FORCE a wall switch to stay in the ON position. (since we are creatures of habit) Usually after a week or two (and new habits have formed) I can remove the tape.

Someone even created a fancy gadget with the same principles: https://www.amazon.com/dp/B00DTXKOTM/

(Although the next time she scolds you by saying, “its not working again” you can tell her that when she manually toggled the wall switch, it was her actions that ‘broke’ the outlet)