Have your HiFi switch on and off in sync with your SliMP3 or Squeezebox using X10 - XPLProject

Contents

Introduction

This HowTo guide explains how you can use xPLHal in conjunction with the xPL support in SlimServer to automatically turn your HiFi on and off in sync with your SliMP3 or SqueezeBox, using an X10 appliance module.

In this article we will present two methods of controlling your CM11/CM12 computer interface.

  1. If you are an existing Homeseer user, and are currently using Homeseer to control your X10 devices, you can use the hsc.exe command-line tool to send X10 commands to Homeseer from within xPLHal.
  2. If you are not a Homeseer user, or you want to enjoy the benefits of a fully xPL-enabled CM11/CM12, you can use the xPL CM12 Gateway service.


What You Need

  • A Windows PC running xPLHal, xPLHal manager and an xPL Hub as described in the HowTo guide Get Started on Windows.
  • SliMP3 or Squeezebox using SlimServer version 5.2 or greater, with xPL support enabled as described in the HowTo guide Enable xPL support in SlimServer
  • A CM11 or CM12 X10 computer interface and an appliance module (e.g. AM12U)
  • Either

Note: SlimServer can be running on any PC on your network, using any of the operating systems supported by SlimServer. The Windows-based PC is only required for xPLHal.


Configuring xPLHal to control your X10 module

Once everything is in place, we need to tell xPLHal that whenever your SliMP3 is switched on, it should switch on your appliance module, and when it is switched off, the appliance module should be switched off.

Switching on the appliance module

  • Click Start -> Programs -> xPLHal -> xPLHal Manager
  • In xPLHal Manager, right-click on the Determinators node and click New Determinator.
  • On the Welcome page of the wizard, click Next.
  • Enter a name for the determinator, e.g. "Switch on Hifi when SliMP3 switches on", then click Next.
  • On the Conditions screen, click Add.
  • When the new condition window appears, enter a name for the condition, e.g. "SliMP3 switched on".
  • From the list of xPL devices, select your SliMP3 player.
  • In the list of triggers, select "Button pressed".
  • In the Button Name box, enter power_toggle
  • Click OK.
  • You should now see your new condition appear in the list. Click on it, then click Edit.
  • In the Message Parameters section, click the Add button.
  • In the Name box, enter "power"
  • In the Operator dropdown, select Equal To
  • In the Value box, type "on"
  • Click OK.
  • The list of Message Parameters should now show two items, as follows: "keys = power_toggle" and "power = on".
  • Click OK.
  • Click Next to move on to the list of actions.
  • Click Add, and enter a name for the action, like "Switch on HiFi".
  • If you are using the xPL CM12 gateway service:
    • Select your CM12 from the list, and select "Transmit X10 command" from the list of actions.
    • Select the command as "On", and enter the X10 module to be switched on, e.g. A1.
  • If you are using Homeseer:
    • Select xPLHal in the list of devices, then select "Run a program" from the list of actions.
    • In the Program Name box, enter the full path to hsc.exe. In the Parameters box, enter the parameters needed to switch on your X10 module, e.g. -X A1 on
  • Click OK. Your action should now be listed.
  • Click Next, then click Finish to complete the wizard.

Switching off the appliance module

  • In xPLHal Manager, right-click on the Determinators node and click New Determinator.
  • On the Welcome page of the wizard, click Next.
  • Enter a name for the determinator, e.g. "Switch off Hifi when SliMP3 switches off", then click Next.
  • On the Conditions screen, click Add.
  • When the new condition window appears, enter a name for the condition, e.g. "SliMP3 switched off".
  • From the list of xPL devices, select your SliMP3 player.
  • In the list of triggers, select "Button pressed".
  • In the Button Name box, enter power_toggle
  • Click OK.
  • You should now see your new condition appear in the list. Click on it, then click Edit.
  • In the Message Parameters section, click the Add button.
  • In the Name box, enter "power"
  • In the Operator dropdown, select Equal To
  • In the Value box, type "off"
  • Click OK.
  • The list of Message Parameters should now show two items, as follows: "keys = power_toggle" and "power = off".
  • Click OK.
  • Click Next to move on to the list of actions.
  • Click Add, and enter a name for the action, like "Switch off HiFi".
  • If you are using the xPL CM12 gateway service:
    • Select your CM12 from the list, and select "Transmit X10 command" from the list of actions.
    • Select the command as "Off", and enter the X10 module to be switched off, e.g. A1.
  • If you are using Homeseer:
    • Select xPLHal in the list of devices, then select "Run a program" from the list of actions.
    • In the Program Name box, enter the full path to hsc.exe. In the Parameters box, enter the parameters needed to switch off your X10 module, e.g. -X A1 off
  • Click OK. Your action should now be listed.
  • Click Next, then click Finish to complete the wizard.


Testing

  • Ensure your X10 appliance module is set to the correct house and unit code.
  • Right-click on each of your determinators and select Execute Determinator. Your X10 module should turn on and off as appropriate.
  • Then try turning on/off your SliMP3 player. The appliance module should operate in sync with your SliMP3.

You can expand this system to perform more complex tasks like setting lighting scenes, operating the curtains, or in fact anything you want.


Want to discuss this article?

If you have questions or comments about this article, you can join the mailing list enabled xPL forums

This page was last modified on 2 December 2005, at 22:58. This page has been accessed 5,015 times.