How can I detect fast ON OFF

Can someone help me with PLEG to detect a fast ON/OFF of a switch to then toggle another device switch state.

Many thanks

Problem Solved so I thought i’d share it.

My problem is that I have two lamps that are only switchable via the Micasa app for a remote. I wanted to make one of the light switches also double as a way to switch on the two lamps as well as the current function of switching on ceiling and accent lighting. They have a fibaro relay.

Here’s what I did:

Device Trigger

LoftLightOn When ever the ceiling lights are switched on

Condition

LampTrigger LoftLightOn; !LoftLightOn<1

Action

LampTrigger LampOne Toggle State
LampTwo ToggleState

The result of the PLEG code is that when the ceiling light switch LoftLightOn is switched on and then off in less than 1 second the lamps power state is toggled between on and off. Its working perfectly for me.

When I toggle the state the lamps are either 100% or 0%

How can I toggle the state between 0% and 40%

Many thanks

Don’t know how much it would slow response but you could probably have 2 conditions/actions, where each looks at the lamp on/off status as well as the lamp trigger and have the actions as SetLoadLevelTarget = 40 and 0.

Thanks.

I tried adding a Property

GetStatus LampOne

Then I thought based on this being a 1 or 0 or would know if the toggle is turn the Lamps on or off

I changed the condiiton logic from this

LampTrigger LoftLightOn; !LoftLightOn<1

to this

LampTrigger GetStatus==1 and (LoftLightOn; !LoftLightOn<1)

This worked in that if LampOne was already on then the toggle action would switch it on.

However, when I switched LampOne off using the app with a single press, the amp went off then two seconds later came on again. Im not sure what that happens

Any help?

Has anyone any ideas what Im doing wrong?

Many thanks in advance.

A status report might help us understand the problem.

How do I generate a status report?

In the PLEG edit screen…Editor Option > Status Report.

When the window pops up, try to save it as a PDF. Easier to read. Attached is an example.