submission By: Marcus Warrington introduction like practically all the currently available UK X10 modules, the LD11 does NOT support status response. This coupled with the fact that X10 commands can in some cases “go astray” and seemingly disappear into the electrical ether before reaching the chosen device, implies that the tracking of the current status of a device is very error prone.
Intelligent controllers like HomeVision and software like Homseer make a valiant effort to track the current status of devices by listening for the X10 signals on the wire but commands are in some cases not heard or can be misheard and any device that is locally controlled will have its state changed without the status change being announced on the wire. This last point was a real bug bear for me, I just didn’t know if someone had switched on a light by hand.
The possible service One new service to this problem is the use of Frank McAlinden’s Probe System. This system was originally developed to allow Homevision to obtain the current status of A/V equipment in multiple zones (see This Article), but Frank has now expanded on this with a probe that uses a very bright white LED and detector developed to read the status of an LD11 unit.
The Hardware
Probe zone Hub (PZH) – This connects either directly to the HV units internal ports , or through Franks HomeVision I/O Expander (to the HomeVision internal bus) or through the serial interface (9600 baud). The Probe zone Hub offers the power (12v) and retrieves the status of any of the Probe zone monitors attached probes. up to 8 Probe zone monitors can be attached to a single Probe zone Hub. This gives a potential total 48 devices that can be queried.
* It ought to be noted that the system does require the user to supply their own 12v power supply (centre pin positive).
Probe zone monitor (PZM) – Each Probe zone monitor can monitor 6 different devices or 4 devices and 2 Dallas thermometer probes. Each Probe zone monitor connects to the PZH through a single piece of conventional Cat5 cable. This offers power and communications with the Probe zone Monitor, and allows the Probe zone monitors to be distributed around the home at convenient points.
LED Probe – This detects when the device is on (usually by detecting the on/off LED of the device, but in our case they discover the very bright white LED connected to the LD11). You need one of these per LD11. Each probe is roughly 1 meter long with a stereo jack on one end and a mono jack on the other. The stereo jack plugs into the back of the Probe zone monitor while the mono jack plugs into the LED Module.
Super bright LED Module – This connects to the output of the LD11, and you will need one of these per LD11 module. The LED (and detector) are housed in a 16mm screw together plastic cylinder. This efficiently gives opto isolation between the LD11 (High voltage output) and the Probe system (12 Volt).
Frank also sells these in kit form for you to make up yourself.
HomeVision IO Expander
connects directly to HV bus (or through the serial interface) and allows HV to communicate with the PZH unit through the IC2 bus.
Mutli Probe Adaptor – A easy black box that allows you to monitor several LD11’s through a single probe input on the PZM. This can be helpful if you have several banks of lights in a room (scene lighting) and you don’t care to know which banks of lights are actually on, only that at least one of them is on.
Build quality – The first thing that strikes you about the hardware is the highly professional finish and build quality of the units. Each unit is professionally engraved with whitened lettering on its front panel detailing the ports and status lights. The units have a strong and functional feel about it, each unit even has its own serial number, barcode and warranty information label attached.
Fitting the very bright white LED modules – Each module requires the drilling of a small 16mm hole in the consumer unit above each LD11. The LED modules are composed of two plastic halves that screw together. One side of the unit holds the very bright LED and has two wires (live and neutral) for connection to the LD11 module. The other half houses the LED detector and has a jack socket for connection to the PZM unit.
This method keeps the low voltage components separated from the high voltage components inside the consumer units. I would recommend using a 16mm wood drill to make the required holes in the consumer units, as the spiked suggestion allows you to accurately position where the hole will be
My Installation – My X10 installation is a retrofit affair and as such the LD11’s are housed in 3 different locations around the house, attic cupboard, cupboard on first floor landing and above the suspended dining room.
Since each PZM is connected to then PZH through conventional cat5 (for both power and status) this implied that I could place the PZM’s at each ofthese locations and connect them back to the PZH which was located at separate location convenient for my HomeVison. eventually the HomeVison and PZH will be moved to my Node0 (when I finish it).
To start the project rolling I chose to concentrate on just one location and see how things went. The cupboard under the stairs on the first floor includes four consumer units housing 13 LD11 modules; these feed all the first floor bedrooms, bathroom, hallway and landings, and front rooms. I have so far mounted 6 of the probes covering the main bedrooms and hallways
Attaching to HomeVision – This is a fairly easy procedure but does involve opening up the HomeVision unit to attach the HV IO ribbon cable television to the HV Bus through a push on block connector. anybody who has ever connected an IDE drive to a PC ought to have no problem doing this. The other end of this ribbon cable television then needs connecting inside the HV IO expander in a similar procedure. The HV IO expander then simply plugs onto the DB9 male connector on the rear of the PZH. There is also an rj12 connector on the front of the unit that is actually a serial connector for communicating with the device through a serial port (more on this later)
Once everything is connected (and everything double checked) its time to write some code and test everything. testing the probes from HomeVision software Frank’s HV IO Expander uses the Homevison IC2 bus and requires a registry patch to enable access to it, but if your using HomeVisionXL instead of the HomeVisions original software then the setting ought to be changed in the HomeVisionXL .ini file instead.
The probes status is evaluated by polling the HV IO Expander using the code specified in the documentation. once code is entered, testing a probe status is simply a matter of setting a couple of variables (Probe Number and zone Number) , calling the macro and then testing the flag (Probe status). This whole process seemed to take roughly ½ a second from start to finish.
Initial test was to simply to test the status of a single light, by running the macro to poll the status of a particular probe. The LED probes are very sensitive and are able to discover that a light is on even when it is at its lowest dim setting.
Initially the PZM (and PZH) reported the light as continuously on, its LED light showing red, until I understood I had connected the probe the wrong way around. The stereo jack plugs into the PZM and the mono jack end plugs into the LED Module.
Second test was to continually run this macro every 3 seconds to update a status flag within HomeVision and reflect the status of the light to ourbedside table lamps. This worked brilliantly and allowed the table lamps to come on automatically (within 3½ seconds) of someone switching on the main light.
Scream if you want to go faster – having seen how helpful it was to be able to track a lights status and mirror it to a table lamp, I set about trying to use the serial connection to offer a quicker revitalize of probe statuses. The reason why this would be faster is that the serial protocol allows testing of all probes on a zone in one request and reaction message.
The Probe unit uses a easy but effective serial protocol that consists of a few ASCII characters, terminated by a single carriage return character.
e.g. “#QA1(cr)” = query status of all probes on zone 1
e.g. “#Q14(cr)” = query status of probe 4 on zone 1
The PZH responds with ;
e.g. “#RA1:ynyyyn(cr)”. Where ynyyyn is the status of each probe 1 – 6.
e.g. “#R14:y(cr)”
Not having a second serial port on my HomeVision unit, I setup a easy procedure whereby a IR remote could toggle the inbuilt HV comms port between being used to query the HV on a consistent basis (at a baud rate 9600) and reverting to a normal control port connected to the PC (at a baud rate 19200).
The code to toggle the inbuilt serial port is pretty simple; on the receive of a known IR signal.
If
Timer #8 (ProbeHub_SerialScanningTimer) is stopped
Then
; turn ON – probe hub serial scanning
; ——————————————
Controller command: Disable Master report Mode
Controller command: set Baud rate to 9600
;
; set bit0 to flag that LasteState is unknown and ought to be initialised
; This implies that an event will fire for each probe for the first call
Set bits 0 in Var #5 (ProbeScan_Zone1_LastState)
;
Load Timer #8 (ProbeHub_SerialScanningTimer) With 0:00:01:00 and Start
;
Controller command: turn user LED On
Else
; turn OFF – probe hub serial scanning – revert back to HV control
; ——————————————————————————
Stop and clear Timer #8 (ProbeHub_SerialScanningTimer)
Stop and clear Timer #9 (ProbeHub_FailSafe_QA#)
Controller command: set Baud rate to 19200
Controller command: enable Master report Mode
;
Controller command: turn user LED Off
End If
The code to request the PZH to send the status of all probes on zone 1 is automatically ran every 3 seconds through TIMER #8: ProbeHub_SerialScanningTimer ;
; Trasnmit “Query all Probes on zone 1”
Stop and clear Timer #9 (ProbeHub_FailSafe_QA#)
Serial port 1: Transmit string ‘#QA1’
Serial port 1: Transmit bytes ‘0D’
;
; fail safe.. if Hub not repsonded in 10 seconds then resend query
Wait 0:00:10:00 with timer #9 (ProbeHub_FailSafe_QA#), Then:
If
Timer #8 (ProbeHub_SerialScanningTimer) is not stopped
Then
Load Timer #8 (ProbeHub_SerialScanningTimer) With 0:00:00:01 and Start
End If
End Wait
Once a request is sent, nothing else will be sent until a reaction to the query is received. The “ProbeHub_FailSafe_QA# timer” is used in case a reaction is missed, and will simply send the request again if no reaction is received within 10seconds.
The reaction to the query is captured in the “Data Input” event of SerialPort 1 of the HomeVision. The code check each probe status against the last known status and calls macro “#5 (ProbeStatusChange)” if the probe status has changed. The code has been shortened to only show the testing of probe 1 for the sake of conciseness. To test the other probes simply duplicate the “TEST PROBE 1” code changing the project of “VAR #2” and the “bit test” each time
; bit 0 set = initialise the LastState i.e.call macro for probe state change regardless
; bits 1 -6 are flags to store last known status so only call macro if probe state changed
If
Timer #8 (ProbeHub_SerialScanningTimer) is not stopped
And Serial port 1: Serial input characters number 1 through 3 are ‘#RA’
Then
Serial port 1: put value of received char 4 into result Value
Var #1 (Zone Buffer) = result Value
;
; test PROBE 1———————————————
Var #2 (Probe Buffer) = 1
If
Serial port 1: Serial input characters number 6 through 6 are ‘y’
Then
; Probe is ON
If
Var #5 (ProbeScan_Zone1_LastState) bit 1 is not set
Or Var #5 (ProbeScan_Zone1_LastState) bit 0 is set
Then
; Probe has changed state because last scan
Set Flag #6 (ProbeScan_State)
Do Macro #5 (ProbeStateChanged) once
End If
Set bits 1 in Var #5 (ProbeScan_Zone1_LastState)
Else
; Probe is OFF
If
Var #5 (ProbeScan_Zone1_LastState) bit 1 is set
Or Var #5 (ProbeScan_Zone1_LastState) bit 0 is set
Then
; Probe has changed state because last scan
Clear Flag #6 (ProbeScan_State)
Do Macro #5 (ProbeStateChanged) once
End If
Clear bits 1 in Var #5 (ProbeScan_Zone1_LastState)
End If
; ——————————————————–
;
; guarantee that initialise bit is now clear
Clear bits 0 in Var #5 (ProbeScan_Zone1_LastState)
;
; start the sequence again by sending request for all status’
Load Timer #8 (ProbeHub_SerialScanningTimer) With 0:00:00:50 and Start
;
End If
MARCRO #5 ProbeStateChanged – This macro can then be used to do what ever you want to do. I have setup the code so that a the shelf lighting comes on and off with the main light.
If
Flag #6 (ProbeScan_State) is set
Then
; ‘New status is ON
If
Var #1 (Zone Buffer) = 1
Then
If
Var #2 (Probe Buffer) = 1
Then
; 1=Bedroom 1 (Front Box Room)
X-10: A 7 (Bedroom1 shelf lighting) On
End If
End If
Else
; new status is OFF
If
Var #1 (Zone Buffer) = 1
Then
If
Var #2 (Probe Buffer) = 1
Then
; 1=Bedroom 1 (Front Box Room)
X-10: A 7 (Bedroom1 shelf lighting) force Off
End If
End If
End If
Using this method has implied that all 6 probes in a zone can be scanned in roughly 1 second. This compares to roughly ½ a second per probe (i.e.3+ seconds total) using the HV IO Expander method.
Multi Probe Adaptor In my restroom I have 6 recessed ceiling lights organized in 3 banks of two lights. Each bank of lights is wired back to an LD11 module, with the single main light switch being wired to each of the 3 LD11’s. The reason for this is that (eventually) I plan on having scene lighting in the restroom controlled by IR or WiFi form a PocketPC. The idea is that I could have the lights over the bath dimmed to 50% while the rest of the room is dimmed to 10-20% giving a much more unwinded atmosphere while bathing and viewing the restroom TV (that I