Scheduling X10 Devices using the CM17A (FireCracker)
In my previous article, .NET X10 CM17A (FireCracker) Control, I described a library that I created that controls X10 devices. The result was a console application that can be used to send commands to individual X10 devices, as well as a .NET library that is reusable in other .NET applications.
While this article is more of an overview of the Windows Task Scheduler, it also describes one of the practical uses of the FirecrackerCtl.exe console application from the article.
For example purposes, I’d like to control my living room lights in the morning during the weekdays.
- X10 Device: C1
- Time On: 7:00 AM
- Time Off: 8:30 AM
Windows Vista/Windows 7
User Account
You first either need a user account that is a member of the Administrators group, or, if you create a new account that isn’t in this group, it needs to be granted the “Logon as batch job” permission on the local machine.
- Home Editions: Set the SeBatchLogonRight using the Ntrights.exe utility, ntrights -u LOCAL\your_new_user +r SeBatchLogonRight (http://support.microsoft.com/kb/315276)
- Other Editions:
- In the Control Panel, open Administrative Tools, then Local Security Policy.
- Beneath Security Settings, open Local Policies and highlight User Rights Assignment.
- Locate Log on as a batch job. Open the properties and add any users that need this right.
Task Scheduling
- In order to start the Windows Task Scheduler, click Start, type “Task Scheduler” in to the search box, and click “Task Scheduler”.
- Click “New Folder…”, name it X10, and click the folder on the left-hand side
- Click “Create Basic Task…”
- In the “Create Basic Task Wizard” enter the following:
- Name: Weekdays – Morning – Turn On Lights
- Description: Turn on lights in the morning during the week
- When do you want the task to start? Weekly
- Start: 6/9/2011 7:00 AM
- Recur every: 1 weeks on: Monday, Tuesday, Wednesday, Thursday, and Friday
- What action do you want the task to perform? Start a program
- Program/script: This points to the FirecrackerCtl.exe is located (ex. C:\FirecrackerCtl\FirecrackerCtl.exe)
- Add arguments (optional): 1 C 1 On
- The first argument, 1, will need to be replaced with the number of the COM port that the FireCracker is plugged in to.
- Check the box that says “Open the Properties dialog for this task when I click Finish”
- If you created a different user than the user that is currently logged in, click “Change User or Group…” to select that user
- Check “Run whether user is logged on or not”
- Check “Run with highest privileges”
- Click OK
- Follow steps 4-8 again, except for “Weekdays – Morning – Turn Off Lights” and when prompted to enter the argument, use “1 C 1 Off”
That’s it! The lights will now automatically turn on at 7:00 AM and off at 8:30 AM during the week.
This entry was posted on Wednesday, June 8th, 2011 at 10:11 pm and is filed under Life. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.