TUTORIAL: Controlling house lights from a driveway X10 senso

Tutorials & Guides

TUTORIAL: Controlling house lights from a driveway X10 senso

Postby wysocki » Thu Feb 04, 2016 9:05 pm

I'm pretty new to EventGhost and I admit it's been a bit of a struggle trying to learn it from the forum posts. I'm an old programmer and I understand how tedious it is to write documentation! However, I've finished a little automation project with EG and thought that I'd submit it for all the other newbies to hopefully learn from. I suspect that my approach could certainly be made better by one of the EG pros, but hey, at least it's a start! I'm starting off with an X10 CM11A unit on the computer to hear and talk to my X10 devices. Before you start this, you should have some understanding of how to add macros, plugins, actions, etc. to the EventGhost system by reading the startup docs.

Basically, I have an X10 driveway sensor that rings a bell in the house when someone crosses the IR beam. What I wanted to do was to ALSO have my outside lights come on for a while so I could walk from the garage to the house with lights on. I started by creating a Folder called "Driveway Lights" and put two macros in it: one that would hear my driveway sensor (CM11A.D1.On) and simply turn the light on (CM11A:A2.On) and start a timer for 5 minutes, then another macro would watch the timer and turn the lights off (CM11A.A2.Off):
eg.driveway.macros.1.jpg
eg.driveway.macros.1.jpg (18.25 KiB) Viewed 1496 times

The Timer plugin is configured to generate the event "driveway-off" in 5 minutes. I was then able to drag that event to the second macro to trigger the A2:Off for the lights.

Then I decided that this should only happen when the sun was down. I chose to add the "SunTracker" plugin to the Autostart section of EG. I then configured it with my latitude and longitude and a checkbox that would automatically generate events at sunset/sunrise. I then added 2 more macros that would watch for these sunset/sunrise events, and then added Actions that would accordingly enable/disable my "LightsON" macro:
eg.driveway.macros.2.jpg
eg.driveway.macros.2.jpg (28.84 KiB) Viewed 1496 times

Notice the red "X" on the "Drive Lights ON" macro. Since it is now daytime, the "Disable..." line just above it is what caused this by disabling the macro.

This worked great, except that if I wanted to leave the lights on all night I would manually turn ON the lights with an "A2:on" command from my X10 controller. But if I left the house, I would leave the driveway and trigger the macros and the lights went OFF in 5 minutes! This was solved by adding another macro that would see the manual (A2:On) happen and then would disable the "Drive Lights OFF" macro. This would allow the lights to stay on all night if I wished. Then if I would manually turned the lights off, another macro that would see the (A2:Off) or (AllUnitsOff) happen and re-enabled the "Drive Lights OFF" macro to make the system work again. Here's the completed folder with its macros, post if you have questions (or better solutions)!
eg.driveway.macros.3.jpg
eg.driveway.macros.3.jpg (42.06 KiB) Viewed 1496 times
wysocki
 
Posts: 32
Joined: Mon Nov 23, 2015 9:23 pm
Location: Los Angeles area

Re: TUTORIAL: Controlling house lights from a driveway X10 s

Postby krambriw » Fri Feb 05, 2016 4:41 am

Very nice!!!
My latest plugins
http://plugins.krambriw.net/index.html

Two men in front of a huge excavator...
- that beast steels work from 100 men with shovels
- well, a 1000 men could do the same using teaspoons
krambriw
Plugin Developer
 
Posts: 2544
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden

Re: TUTORIAL: Controlling house lights from a driveway X10 s

Postby wysocki » Sun Feb 07, 2016 7:11 pm

I notice one minor glitch in this program: if I start EG, the sunset/sunrise condition may not be in the correct state. I needed to check it on startup and set my macros accordingly. So I created a small macro like this:
Capture.JPG

But when I start EG, SunTracker is not ready and always returns false:
Capture2.JPG


If I run the macro after EG starts, it works ok. how can I delay the macro on init until SunTracker is ready?

[EDIT:] SOLVED the problem with a workaround. Just putting a time delay after the GetSunState gave it time to initialize, but then the results of GetSunState were obscured by the timer. The solution is to just a another GetSunState after the timer to set the condition for the jump!
wysocki
 
Posts: 32
Joined: Mon Nov 23, 2015 9:23 pm
Location: Los Angeles area

Re: TUTORIAL: Controlling house lights from a driveway X10 s

Postby kgschlosser » Wed Oct 19, 2016 7:03 am

is X10 still using PLC??? thought that pretty much died. maybe not.
A loved one and Time, The 2 things that can never be replaced.

Family, The only thing you don't get to choose in life.
User avatar
kgschlosser
Site Admin
 
Posts: 1378
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TUTORIAL: Controlling house lights from a driveway X10 s

Postby wysocki » Wed Oct 19, 2016 5:58 pm

AFAIK, X10 is alive and kicking butt with their PLC system. I have about 50 X10 devices (some have been running for 15 years) and while there are some issues with reliability, I haven't found a replacement system that I like yet. I've tried Insteon and Zwave and besides being way more expensive, neither were 100% reliable. Plus they are way too complicated in their setup - with X10 I know exactly what a unit works with just by looking at its code switches - no complex linking and unlinking needed. EG is great as a central controller for my automation system with X10 support.
wysocki
 
Posts: 32
Joined: Mon Nov 23, 2015 9:23 pm
Location: Los Angeles area

Re: TUTORIAL: Controlling house lights from a driveway X10 s

Postby kgschlosser » Wed Oct 19, 2016 6:28 pm

My z wave has been 100 % for the past 3 years. Has never missed once. I am running 2 different versions of GE switches. One that has a neutral and one that doesn't and the one that doesn't at 2 am every morning when my controller remaps the zwave mesh my house looks like a disco. For only 2 seconds. And that's a flaw in the firmware on the switches. I like the GE switches best because the dimmers you can set a manual ramp rate and a zwave ramp rate for both up and down and number of steps and how long. This is nice to get that slow dim up and down for the media room when a movie starts but if you press the switch it acts as usual. I haven't seen another switch that does the same.
A loved one and Time, The 2 things that can never be replaced.

Family, The only thing you don't get to choose in life.
User avatar
kgschlosser
Site Admin
 
Posts: 1378
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA


Return to Tutorials & Guides

Who is online

Users browsing this forum: No registered users and 1 guest