Jump to content
C4 Forums | Control4

Room Lighting Automation


BusBoy

Recommended Posts

Hi Guys,

Has anyone thought out room automation so that when entering and exiting a room the need for pressing a light switch is not needed? i have been researching detection methods (sensors) and playing with the scripting and while it seems doable... it seems "clunky" to me.

If anyone has set this up I'd love to see some of the scripting you used.

Thanks,

-Chris :D

Link to comment
Share on other sites


We've only done this in a garage using a motion detector based on time of day then turn it off after a certain amount of time. Using it anywhere else in the house becomes a little busy in the programming dept vs what it will net you.

Link to comment
Share on other sites

RFID - We're working on it as I type. The owner has a keyring and there is a reader in each room. Each person's own ID tag could mean different lighting scenes for husband and wife!

Link to comment
Share on other sites

RFID - We're working on it as I type. The owner has a keyring and there is a reader in each room. Each person's own ID tag could mean different lighting scenes for husband and wife!

Droooll.... Big Light bulb!! thanks for the kick in the head... and to think, one of my friends works for alientechnology. Duh... hmmmm are you using RFID sensors in every room?? what about overlap? Rooms detecting people that inthe adjacent room?

Sucks to have to carry a dongle key ring thing... gotta make it a credit card style tag. hahaha maybe embed it into a piece of jewelry.

Anyway... i ramble...

thanks for the ideas!

-Chris

Link to comment
Share on other sites

RFID - We're working on it as I type. The owner has a keyring and there is a reader in each room. Each person's own ID tag could mean different lighting scenes for husband and wife!

Verrrrrrrrrrrry nice.

What type of RFID receivers and transmitters are you using?

George

Link to comment
Share on other sites

It would be cool to have built in motion sensors in the dimmers and keypads. Then we could have another option in programming. If motion is sensed turn on light etc.. I imagine given the small space available in the current dimmers and switches it would be tough to do. But sure would be cool. Maybe some day.

Link to comment
Share on other sites

  • 2 weeks later...
Guest Chris.Levin

Recently I needed to do some testing of the sensor inputs on a MC. I decided it would be fun to use a motion sensor for the testing. I was able to come up with a simple script that turns on a room light when motion is detected. If motion does not occur again within a timeout interval, the light is switched off. I also added an "after sunset" variable so this only happens when it's dark out.

The script is simple and uses only one variable (plus one for night check) so it would scale well. If anyone is interested please let me know and I will post a screen shot or project.

-Chris

Link to comment
Share on other sites

Guest Chris.Levin

OK,

Here is the screen shot and some extra info.

The ChrisOffice_Motion variable is set to 300 when the motion sensor detects movement. This is 300 seconds. You can use any value that works for you.

NightTimeMotionActive is set to TRUE or FALSE using the scheduler. I have sunrise and sunset events that set handle this.

So, when ChrisOffice_Motion changes, this script turns on the lights and begins decrementing ChrisOffice_Motion. When ChrisOffice_Motion reaches zero, the lights are turned off. The nice thing here is that if the motion sensor detects motion again it resets ChrisOffice_Motion to 300. This works fine (Variables are thread-safe for the programmers out there.)

This script would be much simpler if you removed the blinking led code. Whenever I have something under program control I like to have an led blink so I know that an action is in progress.

One potential problem I see here is that the while loop will consume CPU resources. But with the 500 ms delays it should not be a problem. In the next few weeks I will be doing some performance testing on an MC and HTC and I will be able to identify any potential problems with loops like this. I have not had any issues using this code but my system is pretty small compared to what you guys do. If I find any potential performance problems I will post a message.

If you have any questions please let me know.

-Chris

Link to comment
Share on other sites

Is it the dual 500 millisecond delays that cause each -1 to be a second or is -1 always a one second interval?

Also, what I don't grasp is how the light knows to turn off since it's under the "if >0" variable. Wouldn't you need an "if =0" variable to turn it off?

Link to comment
Share on other sites

OK, so it IS the two 500ms delay that makes the -1 one second interval countdown. It looks like if the criteria for the "while" is met it continues in a loop but as soon as the criteria is no longer met it continues with the rest of the script. That's pretty powerful.

Link to comment
Share on other sites

Guest Chris.Levin

Hi,

Sorry for the delay in getting back to everyone. The new job is getting very busy. I'm working on stuff for the 1.3 release (which I think you are all anxiously waiting for) and have not had much time to keep up with the forums.

I'll take all the questions in order.

The two 500 ms delays give one second total. So the light on time is one second times the count set when the motion sensor trips. I use two 500 ms delays so I can blink the leds on the switch whose light is being controlled.

The off command for the lights is under the if ChrisOffice_Motion > 0 line BUT it's not indented. This means it is not part of the outer or inner if loops. The scripting language uses indenting to indicate where a command belongs. So what happens is when the while loop exits, the lights are turned off.

My current project is a bit simpler than it has been since I am doing some specific beta testing. But, I am happy to share it. I am a professional programmer but new to controlling a home so I'd be interested in comments. I really don't have the system doing everything I want yet, but I know I'll get there.

You can download my current project at:

http://www.rocklizard.org/webdownloads/Control4/home.zip

-Chris

Link to comment
Share on other sites

  • 2 years later...

We thought this would be great and tied in our motion sensors with the lights but it turned out to be a nightmare. For example if you are watching a movie and move the lights go on. AS you can easily see it is not as fun as one would think. This would only work in rooms that this does not matter such as a closet. Good luck.

Link to comment
Share on other sites

You're answering a nearly 3 year old post to say it didn't work for you?

You're a little late there...

:)

Seriously, I use motion automated lighting throughout my house, but limit it to dim 'walkaround' lighting. It works fine for that purpose, and you can program around the issues you're talking about in many cases.

Programming like 'if the TV is on, don't do the magic lighting', or even better, just bring up the accent lighting would take care of your particular gripe.

It's definitely more complicated than just turn on lights when motion is sensed.

RyanE

Link to comment
Share on other sites

Well, there is a *slight* difference in how quick security motion sensors will trigger lighting than motions hooked directly up to contact inputs, but it's like 1/2 a second or so difference.

Security panels are a little more rigorous against false motion alarms, for good reason.

Something to consider, but usually not a deal-breaker. Your best bet is to try them, and if they suit your needs for lighting, go with them.

RyanE

Link to comment
Share on other sites

Sorry I did not notice the thread was three years old. I just got my system and am looking around here for ideas which are supplied in abundance. Thanks and I will be careful. I agree the motions can be used and will just require more programming. I need to work on my dealer to work this out verus me doing the homeowork.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...