PDA

View Full Version : Newbie trying to understand



khun
September 13th, 2006, 12:05 PM
Hi!

I am considering Girder for a "control everything"-system in my house, but so far I'm not convinced.

I am starting with a W800RF32, a CM11 and some X10-receivers and motion sensors. But I haven't quite gotten the grasp of how Girder works. Beeing a C++-programmer I want to now _exactly_ what's happening.

I have defined G9 as beeing a motion sensor named "Stair Movement" and G2 to be the "Stair Light". Then I have a macro triggered by G9:ON on the W800RF32, which runs "Stairlight on", "Wait 1 minute", "Stairlight off".
I'd by happy for any answers to the following:

1. In my log, I have something like:

Time Date Source Details Payloads
20:28:02:067 9/13/2006 X10 Stair Light:OFF
20:28:02:067 9/13/2006 X10 Stair Light:ON
20:28:02:067 9/13/2006 Stairlight off treescript ok
20:28:02:067 9/13/2006 Wait Ready.
20:27:02:061 9/13/2006 Stairlight on treescript ok
20:27:02:051 9/13/2006 W800RF32 G9:ON
20:27:02:051 9/13/2006 X10 Stair Movement:ON

This shows the "X10 Stair Light:ON" 1 minute after the "Stairlight on treescript ok". The light turns on right away, so this is obviously wrong, but why does the log "lie"?

2. I tried to replace the "Wait", "Stairlight off" with "Restore to previous state" in the "Stairlight on"-action. I was expecting this to send "X10 Stair Light:OFF" after 1 minute, but that didn't happen. Should it? If not, what is this "Restore..." option?

3. After turning off the light, it seems that the motion sensor sometimes detects the change of light as motion, restarting the whole macro. How can I program it to ignore "G9:ON" for 10 secs after sending a "G2:ON"?

4. What happens if a new "G9:ON" is received while the macro is in the "Wait 1 minute"-part. I would like it to interrupt the "Wait" and restart the macro without executing the "G2:OFF".

Hoping this is all easily solvable! :D

Promixis
September 14th, 2006, 08:34 AM
How are you doing the Wait? You should not block lua or the action tree for that period of time. To turn the light off, use a timer (ie simple timer).

khun
September 14th, 2006, 08:45 AM
I used a "Wait" action, but have now realized that this is not very wise. After I took it away I noticed that everything was more responsive, so I was sort of concluding that a "Wait" action locks things up.

I reprogrammed with a Scheduler, which worked sort of, but the resolution of time intervals wasn't good enough.

I think I see how to use a timer, but if I have armed one and then receive a new G9:ON, how do I prolong the time of an already armed timer? I would want to trigger the timer after e.g. 10min after the last G9:ON if there are several arriving.

As to the disable question, I see how I can use a timer to disable the whole group which handles the G9:ON for a couple of seconds.

khun
September 14th, 2006, 11:50 AM
I have gotten the on/off to work in a stable way by using the intelligence in the motion sensor itself. I have 2 macros: "Stairlight on" and "Stairlight off".

The first reacts on the motion sensor ON and then turns on the light and disables itself. This prevents Girder from having to react to a lot of new ON signals.

"Stairlight off" reacts to the motion sensors OFF, turns off the light and reenables "Stairlight on".

It seems the motion sensor itself takes care of not registering the light change right after the OFF as a motion, triggering a new ON.

Only drawback is that to change how long the lights should be on, I have to open the motion sensor and program it.

I was able to get things to work with SimpleTimer as well (Thanks for the tip, I hadn't realized it was in there!). But that called for 4 different macros to get everything working properly.

It's starting to get fun :-)

I will post any remaining questions in new posts

Promixis
September 14th, 2006, 12:13 PM
glad its working... there are many ways to do what you want.

the x10 devicemanager also has a option to change a device after a certain amount of time. did you see that action?

khun
September 14th, 2006, 12:31 PM
No, where is that located? Are you referring to the "Reset to previous state" in the "Device Command" action under "X10"? I can't get that to work properly.

Axeman
October 1st, 2006, 10:44 AM
No, where is that located? Are you referring to the "Reset to previous state" in the "Device Command" action under "X10"? I can't get that to work properly.

The function does not work for me either. I believe its a bug.

I have the same setup with the motion detectors. I use the following code to turn on my devices.


if LavaLampTimer then
LavaLampTimer:Destroy(); LavaLampTimer = nil
end

LavaLampTimer = gir.CreateTimer("", "Insteon.DeviceCommands.SetLevel ('04.B0.39',0); LavaLampTimer:Destroy(); LavaLampTimer = nil", "", true)
LavaLampTimer:Arm(600000)
Insteon.DeviceCommands.SetLevel ('04.B0.39',255)


I attach the Motion Detector:ON event to this script. It turns on my Insteon device, and after 10 minutes it turns it off. The timer gets reset every time the Motion Detector:ON event is received.

I also have other events shorten the time based on predictability of what is happening in my house. You can use the same code with other events and conditionals. ALWAYS remember to kill your timer before you make a new one, as in the first 3 lines.

Jim