SmartPlug Timer

Extending the system, interesting uses and API twiddling.
Post Reply
Posts: 34
Joined: Fri Nov 25, 2011 11:27 pm
Location: Oxfordshire

SmartPlug Timer

Post by phil4 »

Ok, a very quick and simple application to turn the smartplugs on or off. Perhaps useful if like me you want to use your computer's timer to turn them on/off at certain times, or perhaps trigger from something occuring on your PC (turn a lamp on when you get an email for example).

(Yes, it's called SmartPlugTimer, but there's no need to use it with a Timer). And no, there's no built in timer functionality either.... so a completely misleading name. Sorry, was trying to hint at a use.

As with the other applications I've done, this is very simple and so has no timer... instead I suggest you use the Windows Task Scheduler on a PC that's left on.

If when it runs you need to pass it two parameters, first whether you want the plug on or off, the second is the ID of the plug... more in a second.

In Task Scheduler this would look like this:

"C:\Program Files\SmartPlugTimer\SmartPlugTimer.exe" on 00-0D-6E-00-00-1B-2C-C2

The above turns my smartplug on. Switch the word "on" to "off" to switch it off.

As before you'll need the .net framework 3.5 installed.

You'll need to edit the SmartPlugTimer.exe.config file, in it put your Alertme username and password.

In order to find the unique IDs of your smartplugs you'll need this little program:

run the program, enter your alertme username and password in the two boxes and click Go!

You'll then get a long list of all the devices hooked up to your hub. The devices are listed in a slightly strange way.... your name, device id, device type...

So we're looking for any "Power Controller" devices, the ID is the thing immediately preceding it... so if you have some lines like this:

Contact Sensor,TV
PowerController,Living Room 2
Motion Sensor,Dining Room

In this case the SmartPlug IDs are:

Enter these into the correct places in your run command as required.

Apologies for it not being blindingly simple to use, happy to give a few pointers if needed, but would rather not act as your home PC tech support

All warranties express or implied are null and void. The product is suitable for nothing, and is not fit for any purpose. Use at your own risk. No refunds.
Post Reply