Trigger event when item is online?


I have a few smart plugs which I occasionally have to plug out when they are spotted by my 1-year-old twins.
If I forget to plug them back in until late in the evening then my smart lighting routing will not switch them on as the “on” event has already happened.

Is it possible for me to do something like this:
If smart plug comes online AND it is after sunset, switch on the smart plug?
Ideally, this would mean that they would automatically switch on when plugged in after sunset.


If you use webCore you could probably trigger that based upon the Health Status returning to online.

Hi Bryan,

I don’t use webCore, but I just came across Device Monitor SmartApp which I think I could use.

This will alert me when the device comes back online, but not sure how I can then trigger an event or equivalent?
Would this be the way to go, or would you suggest webCore as a better method going forward?


I’m not familiar with that app, so you’d have to load it or post over in that thread to see if something can be triggered from a raised notification.

Regarding your webCore question, my answer would be that’s how I would do it, but the beauty of this forum is that you can often find multiple solutions. Someone else may have an alternative.

webCore exposes every capability of a device and lets you act on it. It can be a bit overwhelming at first, but there is a separate forum with plenty of people that will help. I haven’t done what you are trying so I can’t say with 100% certainty that it will work, but I did take a quick look to see what capabilities would be exposed by a pocket socket, and it seems like it would.

This is all based on the presumption that when the device is unplugged, ST will recognize that and update the device’s health status as offline. You can check that first pretty easily in the IDE.

Your smart plugs are definitely not child safe, and their removal from the outlet leaves it as a child hazard as well.

I suggest instead a lockable outlet cover. Home Depot will have a bunch of these to protect outdoor outlets. You have many years ahead of the kids exploring the house. I suggest going for electrical safety now, and it will have the added bonus of keeping the plugs online. :sunglasses:

For signal strength, it’s best to choose grey or clear plastic. For some reason the blue plastic seems to block more signal.

Here’s just an example, there are many different models and styles.

There are also some made specifically for baby proofing which typically cost a little more but may be more aesthetically acceptable:

1 Like

Thanks for suggestion @JDRoberts.
I am using UK plug sockets which I believe are inherently safe by construction of the shutter mechanism.
This would be the equivalent for me (although I’m not sure it would have enough space for my smart plug) :

Since they discovered the socket for hall lamp (there is really only one which they have access to as the rest are behind furniture) we have just plugged it out each morning.
I will use webCore as suggested by Bryan to trigger it to switch on when it is plugged back in and the time is after sunset.


1 Like