Jump to content

Trouble with programming the Elk module


ralbright

Recommended Posts

Posted

Hi yall! I am trying to setup programs for my ISY to control the lighting using the sensors provided by my Elk M1G system. I have already purchased the Elk Module and have begun to work in the programming for it, but between having variables and now the Elk, I am at a lose.

 

What I have is a Elk controlled motion sensor in each room that I want to trigger the lights on when motion is detected (and consequently turn the lights off when no motion is detected) based on the time of the day or the setting of a keypadlinc button (which I have named 'Simulate Daytime'). But I want to have full control over the lights from the switch, because I sometimes throw parties and I want to keep the lights working in 'idiot-proof' mode so that a single tap on will always turn the light on and a single tap off will always turn the light off. I also want to be able to put in an override that is accessible from the keypad or ISY to keep a light dimmed or off (IE while watching a movie, it ruins the movie by the lights ramping up to full when someone moves in their seat. And one final thing, I have 2 lights in the house that are working off of the Elk door sensors that turn the lights on in that room when the door to the outside is opened, how do I set the ISY to remember what the light was at before the door was opened so that when the light returns to the previous level after the door has been closed and the timer expired (say 5 minutes).

 

I know this is a tall order, and I understand a lot of the programming but the use of variables and the Elk module have me at a lose. Thank you for any help you guys can provide.

 

Here is the programming I currently have for the Living Room for the daytime:

DT: On -Living Room Ceiling

If

Status 'Kitchen KP - Simulate Day' is On

And (

Control 'Living Room - Ceiling' is switched On

Or Control 'Kitchen KP - Living Room' is switched On

)

Then

Set Scene 'Grp: DT - Living Room Ceiling' On

$Living_Room_Light = 1

Else

No Actions

 

 

DT: Off - Living Room Ceiling

If

Status 'Kitchen KP - Simulate Day' is On

And (

Control 'Living Room - Ceiling' is switched Off

Or Control 'Kitchen KP - Living Room' is switched Off

)

Then

$Living_Room_Light = 0

Else

No Actions

 

 

DT: Elk On - Living Room

If

(

Folder 'Day Time' is True

or Status 'Kitchen KP - Simulate Day' is On

)

And $Living_Room_Light is not 1

And Elk Zone 'Living R. Motion' is Violated

Then

Set Scene 'GRP: DT - Living Room Ceiling' On

Else

No Actions

 

 

DT: Elk Off - Living Room

If

(

Folder 'Day Time' is True

or Status 'Kitchen KP - Simulate Day' is On

)

And Elk Zone 'Living R. Motion' is Normal

Then

Wait 10 minutes

Set Scene 'GRP: DT - Living Room Ceiling' Off

$Living_Room_Light = 0

Else

No Actions

Posted

I just looked over your programs quickly but it seems like you are on track.

 

As far as "how do I get a light to return to its previous state" question. Well, you can't easily. You would need to use a variable to store the status of the light.

 

If

(light x is switched on

or switched off

or is switched fade up

or is switched fade down)

and status is > 80

and status is <90

Then

set variable light status to 85

 

So the above program would set the variable to 85 if the light was manually controlled to somewhere between 80 and 90. You would need 10 of these programs if you wanted to be accurate to within 10% light status. You would then need 10 programs to set the light back to that status when your timer ends.

 

So, you see, not easy. Perhaps you are ok with just an off/not off status so that would be just two programs.

 

Personally, when I have doors that turn lights on and then start a timer, I just don't let the program run at all unless the light starts in the off position. For example, my back door opening turns on the lights outside the door. But if the light is already "not off", the program won't run at all.

Posted

Well here is what I came up with. Let me know what you all think. I am going to test it out for a few days and see how well it works. Each light in my network has a default on level of 20% before it goes to its final setting of 30% (night time mode) or 75% (day time mode) which is achieved through different scenes. I also guest-proofed the light switches, as we have people over a lot, and doing fancy things with the light switches is not something they are used to. SO single tap up triggers the light to go to 75% regardless of time. and single tap down triggers the light to go off regardless of time.

 

State variables can be set to one of 5 settings:

-1 = force off for 10 minutes

0 = off

1 = dimmed at 30%

2 = Normal on (75%)

3 = Full on (100%)

 

DT On - Kitchen:

If

Status 'Kitchen KP - Simulate Day' is On

And Control 'Kitchen KP - Ceiling' is switched On

Then

Set Scene 'IND: DT - Kitchen Ceiling' On

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = 2

Else

- No Actions - (To add one, press 'Action')

 

 

DT Elk On: Kitchen (0 or 2)

If

Elk Zone 'Kitchen Motion' is Violated

And (

Status 'Kitchen KP - Simulate Day' is On

Or Folder 'Day Time' is True

)

And (

$Kitchen_Current is 0

Or $Kitchen_Current is 2

)

Then

Set Scene 'IND: DT - Kitchen Ceiling' On

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = 2

Else

- No Actions - (To add one, press 'Action')

 

 

DT Elk ON: Kitchen (3):

If

Elk Zone 'Kitchen Motion' is Violated

And (

Status 'Kitchen KP - Simulate Day' is On

Or Folder 'Day Time' is True

)

And (

$Kitchen_Current is 3

)

Then

Set Scene 'IND: DT - Kitchen Ceiling' On

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = 3

Else

- No Actions - (To add one, press 'Action')

 

 

NT Elk On: Kitchen:

If

Elk Zone 'Kitchen Motion' is Violated

And (

Status 'Kitchen KP - Simulate Day' is Off

And Folder 'Night Time' is True

)

Then

Set Scene 'IND: NT - Kitchen Ceiling' On

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = 1

Else

- No Actions - (To add one, press 'Action')

 

 

NT On - Kitchen:

If

Status 'Kitchen KP - Simulate Day' is Off

And Control 'Kitchen KP - Ceiling' is switched On

Then

Set Scene 'IND: NT - Kitchen Ceiling' On

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = 1

Else

- No Actions - (To add one, press 'Action')

 

 

Off - Kitchen:

If

Control 'Kitchen KP - Ceiling' is switched Off

Then

Set Scene 'IND: NT - Kitchen Ceiling' Off

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = 0

Else

- No Actions - (To add one, press 'Action')

 

 

Fast Off - Kitchen:

If

Control 'Kitchen KP - Ceiling' is switched Fast Off

Then

Set Scene 'Fast: Kitchen Ceiling' Fast Off

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = -1

Wait 10 minutes

$Kitchen_Current = 0

Else

- No Actions - (To add one, press 'Action')

 

 

Fast On - Kitchen:

If

Control 'Kitchen KP - Ceiling' is switched Fast On

Then

Set Scene 'Fast: Kitchen Ceiling' Fast On

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = 3

Else

- No Actions - (To add one, press 'Action')

 

 

Elk Off: Kitchen (1, 2, 3):

If

Elk Zone 'Kitchen Motion' is Normal

And (

$Kitchen_Current is 1

Or $Kitchen_Current is 2

Or $Kitchen_Current is 3

)

Then

Wait 5 minutes

Set Scene 'IND: DT - Kitchen Ceiling' Off

$Kitchen_Prev = $Kitchen_Current

$Kitchen_Current = 0

Else

- No Actions - (To add one, press 'Action')

Posted

I assume that the kpl you are using to trigger these programs is not a controller of the scene as that would mess things up.

 

One issue would be that using a kpl button to trigger a program which triggers a scene will not be instant. There will be a small delay that you might find annoying.

 

Personally I would use the values of how bright the light is for my variable instead of 0,1,2,3. Since you can use any number you want, it is just easier to know that 30 is 30% and so on.

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.5k
×
×
  • Create New...