How can I make this better?

Hi all,

I have a pleg device setup to do two things.

  1. Turn off my office lamp if it’s on at midnight.
  2. Turn off the power room fan after it’s been on for 30 minutes or 60 minutes if it was double clicked on (turn on/off/on within 1 minute).

1 is okay I think. But I think 2 is kind of ugly. Do you have any suggestions on how to clean it up?

Thanks.

Where is your status report ?

He had it posted up but has since removed it for some reason.

My license key was in the report so I removed it. I will post again without the license key.

Your license key can’t be used by anyone else.

This can be simplified as follows:

AutoOff OfficeLampOn and Midnight
cPowderRoomFanDblClick pPowderRoomFan @ 2 < 1:00

Replace references to cPowderRoomFanOn with pPowderRoomFan

Okay, I’ve reattached my report.

So a property value of 1 equals true when evaluating conditions? That’s good to know.

Do you have any suggestions for the cPowderRoomFanAutoOff condition?

Parenthesis problem:

cPowderRoomFanOn and (((cPowderRoomFanOn; Now > 30:00) and !cPowerRoomFanDblClickOn) or (cPowerRoomFanDblClickOn and
(cPowerRoomFanDblClickOn; Now > 60:00)))

There are other ways to do this with self triggered schedules … but this is OK.

It’s common practice to post with key as it only works with (tied to) your VERA serial. No Vera serials are the same so it won’t help anyone but the owner of that VERA… Your good to go.

[quote=“RichardTSchaefer, post:8, topic:185800”]Parenthesis problem:

cPowderRoomFanOn and (((cPowderRoomFanOn; Now > 30:00) and !cPowerRoomFanDblClickOn) or (cPowerRoomFanDblClickOn and
(cPowerRoomFanDblClickOn; Now > 60:00)))

There are other ways to do this with self triggered schedules … but this is OK.[/quote]

I’ve tried to do it with the timers but I can’t seem to understand it. Can you provide an example?

To replace the NOW with timers, you need to create a schedule and start it via one condition, and then check its status in another.

So create a timer sPowderRoomFanOn as a Self Retrigger with 30 minute interval. Then as the action for cPowerRoomFanOn, start the timer via Advanced, Choose PLEG Stuff Control in the drop-down, and then start timer. You could do the same with a sPowerRoomFanDblClickOn Self Re-Trigger with a 1 hour interval, starting the timer as an action of cPowerRoomFanDblClick.

Then your cPowderRoomFanAutoOff would be:

cPowderRoomFanOn and ((!sPowderRoomFanOn and !cPowerRoomFanDblClickOn) or (cPowerRoomFanDblClickOn and
!sPowerRoomFanDblClickOn))

In some of mine, I have had to check to make sure the timer actually started though, cause I would find I turned something off right after I turned it on…

cPowderRoomFanOn and ((!sPowderRoomFanOn and (cPowderRoomFanOn; sPowderRoomFanOn) and !cPowerRoomFanDblClickOn) or (cPowerRoomFanDblClickOn and
!sPowerRoomFanDblClickOn and (cPowerRoomFanDblClickOn; sPowerRoomFanDblClickOn)))