Please login or register.

Login with username, password and session length

Author Topic: Motion Sensor & Macro to dim/raise lights when in kitchen  (Read 6909 times)

USdangerboy

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 32
Motion Sensor & Macro to dim/raise lights when in kitchen
« on: December 16, 2008, 10:58:28 PM »

(I edited this 24 hours after posting, think I solved my problem, leaving for reference :-)

Here's what I would like, seemingly stupid in its simplicity but took me a bit of tinkering:

1) Lights in kitchen stay at 15% brightness at all times after dusk and before 10AM.
2) When I walk in the kitchen, and the lights are at 15%, lights to go to 55% or brighten 40%
3) When the kitchen is idle for 4 minutes, return to 15%, lights dim 40%

SETUP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EE MS14A set on E3 with 4 min delay activity 24 hrs | Named: Kitchen EE
Hi Hat lights with RWS17 (dimmable) | Named: Kitchen HiHats
AHP CM15A


SmartMacro#1 | Code: E3 | Named: "Kitchen EE ON"   <- My naming convention EE=Eagle Eye and ON=RF ON Code rec'd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If after dusk and before 10AM AND Flag 2 OFF Then
Brighten Kitchen Hi-Hats 40%
Set Flag 2 ON


SmartMacro#2 | Code: E3 | Named: "Kitchen EE OFF"   <- My naming convention EE=Eagle Eye and OFF=RF OFF Code rec'd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If Flag 2 ON
Dim Kitchen Hi-Hats 40%
Set Flag 2 OFF

(FYI: I have a 10AM macro that turns all lights off since I'm usually out of the house by then)


Discussion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If anyone walks in the kitchen, E3 sends the RF ON code, firing "Kitchen EE ON"
Check for time (between dusk and 10AM) if so, continue.
Check for Flag 2 OFF, if it's off, then we have dimmed the lights, so they need to be raised
Raise Hi-Hats 40%
Set Flag 2 ON (ON for Flag 2 basically means we have brightened the lights)

4 minutes go by and noone is in the kitchen, so E3 sends the RF OFF Code, firing "Kitchen EE OFF"
Check to see if Flag 2 is on (only on if we brightened the lights)
Dim Hi-Hats 40%
Set Flag 2 OFF (OFF for Flag 2 basically means we have dimmed the lights)

Notice: I don't care about the time condition on the Kitchen EE OFF macro since if the FLAG is ON, then we did that work testing time already :-)  And after 10AM, Flag 2 will not get set to ON again until after dusk so once E3 fires its final RF OFF code anytime after 10AM, no time test needed on that.

Finally, I'm working on a "global flag" thing that will set A16 on or off depending on if I am home or not based on my exit mode from the house (that's going to be a sensor on the garage door that only fires when it goes up) but that's in progress ... any ideas from anyone would be nice :-)


Nagging Questions For Me ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--> Is there a way to test for BRIGHTNESS level of the light?  I mean, of course, this macro is disturbed if someone changes the brightness level while in the kitchen temporarily (guests tend to do this).  Or do I have to set the ON/OFF function for modules and then brightness there?  This then takes lights to full power then pulls back to the desired level, this flashing is not as cool as a dim/brighten from current level :-)


--> Testing for lights "ON" does not seem to help with brightness/dim levels, am I missing something?

--> How do I test for "inactivity" or no motion?  Alternatively, how do I get "MODULE STATUS" for a sensor?  For example, Sensor E3 is in wait mode after sending ON RF and has 2 min 12 sec left until inactivity mode.  Is the activity log available to other applications or stored somewhere I can parse it with an application I can write on XP?  I have a CM19A that seems to be receiving transmitted codes in the house (A MUST FOR DEBUGGING and TESTING!!) so can I get that activity log into another program or an SQL DB?  How about sending codes on my own without having to use the CM15A via the CM19A?  This may be stupid question, but I have no docs on anything (my girlfriend threw out the box I had in the garage with ALL MY DOCS in it!!).


ULTIMATELY ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I could write in VB or C or something, but how do I get that in the interface?  Is this thing running on Assembler or what?  How do we get down to the lowest level of this thing to make it do what we need? 

Thx in advance!!
« Last Edit: December 29, 2008, 09:23:55 AM by USdangerboy »
Logged
If at first you don't succeed, skydiving is not for you.

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Motion Sensor & Macro to dim/raise lights when in kitchen
« Reply #1 on: December 21, 2008, 10:04:15 PM »

ULTIMATELY ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I could write in VB or C or something, but how do I get that in the interface?  Is this thing running on Assembler or what?  How do we get down to the lowest level of this thing to make it do what we need? 

It is not possible to change the CM15A's operating program. The hardware used is write-once. You can only upload user data to the interface. There are many who have written third-party software that communicates with the CM15A; but changing the way the CM15A operates is not possible without a hardware change.
Logged

USdangerboy

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 32
Re: Motion Sensor & Macro to dim/raise lights when in kitchen
« Reply #2 on: December 27, 2008, 08:10:59 PM »

Thanks Puck.  How about the SDK, is that still available?  Since the PC in on battery backup, I'd rather run everything through that and just have it use the CM15A for Transmit and RF code sends as needed.  Then I can have some incredible logic on the PC :-) 

For example, I want to track motion of multiple people in the house.  So if I have 10 sensors, I need to calculate the time between "on" signals from motion.  So for example, I'd load the time of the "On" event for any house code in a DB, then create conditions on triggers and SP's in the DB and let the app just react to the database :-)

If only I could receive the X10 Activity Monitor directy into an application and send X10 codes from the application!  I don't need all the GUI stuff in the AHP program, I am more concerned with logic surrounding events and actions.  I assume the SDK would help with this?

Thanks again.
Logged
If at first you don't succeed, skydiving is not for you.

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 279
  • Posts: 10371
  • I don't work for X10, I use it successfuly!
    • Tuicemen Forum
Re: Motion Sensor & Macro to dim/raise lights when in kitchen
« Reply #3 on: December 27, 2008, 08:22:29 PM »

Thanks Puck.  How about the SDK, is that still available?  Since the PC in on battery backup, I'd rather run everything through that and just have it use the CM15A for Transmit and RF code sends as needed.  Then I can have some incredible logic on the PC :-) 

For example, I want to track motion of multiple people in the house.  So if I have 10 sensors, I need to calculate the time between "on" signals from motion.  So for example, I'd load the time of the "On" event for any house code in a DB, then create conditions on triggers and SP's in the DB and let the app just react to the database :-)

If only I could receive the X10 Activity Monitor directy into an application and send X10 codes from the application!  I don't need all the GUI stuff in the AHP program, I am more concerned with logic surrounding events and actions.  I assume the SDK would help with this?

Thanks again.
The SDK is still available!
However you can't download to the CM15A even with it!
There are many examples in the SDK section to help you with your project!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

USdangerboy

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 32
Re: Motion Sensor & Macro to dim/raise lights when in kitchen
« Reply #4 on: December 27, 2008, 08:40:14 PM »

Fantastic!  Let's hope I get it working and start posting some smokin items on these boards!!  So far, I have more time than success happening, but just ordered phase couplers/extenders/repeaters/etc. so I refuse to be beaten!!  LOL.

Oh MAN ... just downloaded the SDK and converted it, looking good so far baby!!!

Thanks SO much; will keep you posted!!

Logged
If at first you don't succeed, skydiving is not for you.
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.