123
Senior Member
That's good news. The script I posted earlier will have to be modified in order to send alternating ALL LIGHTS ON/OFF commands instead of toggling the PowerState... The All Lights On/Off did work!! ...
The following code sends ALL LIGHTS ON when TriggerCount is an even number and ALL LIGHTS OFF when it is odd. The ALLLightsOn property is a Momentary Boolean (i.e. it automatically returns to its default state of False) so there's no need to ever set it to False.
Code:
' Assume the X10 House Code of the PSH02 is A
' Alternate between sending ALL LIGHTS ON and ALL LIGHTS OFF
if this.TriggerCount mod 2 = 0 then ' Even number
Devices.X10.CM11A.X10.House_A.AllLightsOn = true
else ' Odd number
Devices.X10.CM11A.X10.House_A.AllLightsOff = true
end if
' Reset the timer after all repetitions have been completed
if this.TriggerCount = this.RepeatCount then
this.Enabled = false
this.TriggerCount = 0
end if