I've never used one but I had a look at the PSH02's
spec sheet. It seems like it will sound 4 seconds after receiving a continuous ON/OFF sequence and cease 4 seconds after the sequence ends. What a goofy trigger ...
Search Premise Builder's Help docs for "
Using Timers to flash Lights on and off". You'll find examples using a
Logic Diagram and
Scripting. Based on the scripting example, here's how I'd tackle it:
Create a
Simple Timer in
Modules > Default (or in whatever Module you wish). The attached image shows a Simple Timer that triggers every 2 seconds and repeats 10 times. I wouldn't recommend an interval less than 2 seconds because X10 commands need time to propagate on the power lines. You can set the number of repetitions to suit your needs.
The
OnChangeTrigger script toggles the PSH02's PowerState and resets the timer after it has completed ten repetitions.
Code:
' Assume the X10 address of the PSH02 is A1
' Toggle its PowerState
with Devices.X10.CM11A.X10.House_A.X10_A_01
.PowerState = not .PowerState
end with
' Reset the timer after all repetitions have been completed
if this.TriggerCount = this.RepeatCount then
this.Enabled = false
this.TriggerCount = 0
end if
I don't know what you're using to trigger the siren. Assuming you have a
DoorSensor object, here's what you could put in its
OnChangeDoorOpened script:
Code:
' Activate siren only if the Door Sensor state is True and the Security System is Stay Armed
if sysevent.newval = true and Home.SecuritySystem.SecurityState = "StayArmed" then
Modules.Default.Timers.PSH02.Enabled = true
end if
All of a Simple Timer's parameters can be altered programmatically. For example, to change the number of repetitions:
Modules.Default.Timers.PSH02.RepeatCount = 20