Jump to content

How to use I/O Linc to turn on lights


Cooper0705

Recommended Posts

I tried searching the forums but haven't been able to find an answer.  I have the Insteon garage door kit an it's working fairly well except i can't figure out how to have a light turn on when the garage door is opened when using the garage door remote (not Insteon remote or device). I thought it would be as simple as creating a program that turns on a light when the sensor changes from door closed to door open.  But that isn't the case and any help would be appreciated.  Program is attached.

 

 post-9875-0-14775800-1506046881_thumb.jpg

Link to comment

I tried searching the forums but haven't been able to find an answer. I have the Insteon garage door kit an it's working fairly well except i can't figure out how to have a light turn on when the garage door is opened when using the garage door remote (not Insteon remote or device). I thought it would be as simple as creating a program that turns on a light when the sensor changes from door closed to door open. But that isn't the case and any help would be appreciated. Program is attached.

 

attachicon.gifCapture.JPG

You need to change the program to sunrise *Next Day*

 

 

Sent from my iPhone using Tapatalk

Link to comment

Yes, it is that simple, or even simpler, depending on what you are trying to accomplish.

 

If you want a light to come on with the door, staying on until it closes, you could create a scene with the IOLinc relay as controller and light as responder.

 

If you want a bit more control over when the light turns on and off, a program may be needed.  Yes, it should be that simple.

 

In your program, you might want to change your sunrise condition to "next day".

Link to comment

I think there are more problems with this program.  The condition "Sunset" only happens at once a day, likewise Sunrise only happens once a day (whether it's today or next day) coupled with an AND it makes a condition that only could possible happen during two moments of a 24 hour period.

 

What I do ise use a state variable that I call "dark", although "nighttime" may be a more descriptive name.

 

From Sunset

To Sunrise (Next day)

Then

    dark = 1

else

    dark = 0

 

another program:

 

If dark = 1

and status door is open

then

    turn on the light

else

    turn off the light

 

Another advantage to this is "dark" can be used in other programs, and for testing puposes it's easy to manually set dark = 1 during the daytime.

Link to comment

I think there are more problems with this program.  The condition "Sunset" only happens at once a day, likewise Sunrise only happens once a day (whether it's today or next day) coupled with an AND it makes a condition that only could possible happen during two moments of a 24 hour period.

 

What I do ise use a state variable that I call "dark", although "nighttime" may be a more descriptive name.

 

From Sunset

To Sunrise (Next day)

Then

    dark = 1

else

    dark = 0

 

another program:

 

If dark = 1

and status door is open

then

    turn on the light

else

    turn off the light

 

Another advantage to this is "dark" can be used in other programs, and for testing puposes it's easy to manually set dark = 1 during the daytime.

I use that technique a lot! It works very well to centralise control and isolate triggers from many programs.

 

When you discover a new method of determining "dark" you can change the code in one program and the rest will still work without modification.  I use  7 out of 10 MSes reporting dark and even then the 7 factor is a variable I can modify.

 

Nice!

Link to comment

I use that technique a lot! It works very well to centralise control and isolate triggers from many programs.

 

When you discover a new method of determining "dark" you can change the code in one program and the rest will still work without modification.  I use  7 out of 10 MSes reporting dark and even then the 7 factor is a variable I can modify.

 

Nice!

 

 

I actually had another way "dark" could get set in v4.5.4 based on weather station data.  v4.6.2 broke that tho (it takes too long for dark to happen), and when I complained Michael open called me a drama queen in the thread... so i quietly went away and didn't participate here for a long time.   I ultimately came up with a method to get light and rain data from my weather station using a rPi and the ISY API.  It's not reliable tho (because of an rPI issue) and i don't know enough about python error catching to fix it.

Link to comment

I think there are more problems with this program.  The condition "Sunset" only happens at once a day, likewise Sunrise only happens once a day (whether it's today or next day) coupled with an AND it makes a condition that only could possible happen during two moments of a 24 hour period.

MrBill. I am not so sure this is accurate (or is at least misleading). While the sunset and sunrise conditions trigger only twice each day, they would be true at all points in between.

 

I use the from-to condition in several programs. Works like a champ.

Link to comment

MrBill. I am not so sure this is accurate (or is at least misleading). While the sunset and sunrise conditions trigger only twice each day, they would be true at all points in between.

 

I use the from-to condition in several programs. Works like a champ.

 

 

As a test I just created:

AA test - [ID 0073][Parent 0001]

If
        From    Sunrise
        To      Sunset  (same day)
    And Status  'Door Switches / Costco Rm - Door Sensor' is On
 
Then
        Set 'DN White Fridge Alcove#' On
 
Else
        Set 'DN White Fridge Alcove#' Off

Using Sunrise to Sunset since it's currently daytime for me.   This works as expected.

 

So then I modify to:

AA test - [ID 0073][Parent 0001]

If
        From    Sunset
        To      Sunrise (next day)
    And Status  'Door Switches / Costco Rm - Door Sensor' is On
 
Then
        Set 'DN White Fridge Alcove#' On
 
Else
        Set 'DN White Fridge Alcove#' Off

And this does not work as I would expect.  Now during a daytime time, the light does not turn on but the light will turn off if it was on for some reason.

 

 

My actual garage light programs are separated into on and off programs anyway.  If dark they turn on if any door is opens, and they turn off anytime the last door closes:

===================================================================================
Garage Lights - [ID 0058][Parent 0001]

Folder Conditions for 'Garage Lights'

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
   Allow the programs in this folder to run.
 



-----------------------------------------------------------------------------------
Auto Off - [ID 0059][Parent 0058]

If
        (
             Control 'Door Switches / Garage to House Door' is switched Off
         And Status  'Door Switches / Garage-North OHD' is Off
         And Status  'Door Switches / Garage-South OHD' is Off
        )
     Or (
             Control 'Door Switches / Garage-North OHD' is switched Off
         And Status  'Door Switches / Garage to House Door' is Off
         And Status  'Door Switches / Garage-South OHD' is Off
        )
     Or (
             Control 'Door Switches / Garage-South OHD' is switched Off
         And Status  'Door Switches / Garage to House Door' is Off
         And Status  'Door Switches / Garage-North OHD' is Off
        )
 
Then
        Set 'Garage Lights#' Off
 
Else
   - No Actions - (To add one, press 'Action')
 



-----------------------------------------------------------------------------------
Auto On - [ID 0057][Parent 0058]

If
        $DARK is 1
    And (
             (
                  Control 'Door Switches / Garage to House Door' is switched On
              And Status  'Door Switches / Garage-North OHD' is not On
              And Status  'Door Switches / Garage-South OHD' is not On
             )
          Or (
                  Control 'Door Switches / Garage-North OHD' is switched On
              And Status  'Door Switches / Garage to House Door' is not 100%
              And Status  'Door Switches / Garage-South OHD' is not On
             )
          Or (
                  Control 'Door Switches / Garage-South OHD' is switched On
              And Status  'Door Switches / Garage to House Door' is not 100%
              And Status  'Door Switches / Garage-North OHD' is not On
             )
        )
 
Then
        Set 'Garage Lights#' On
 
Else
   - No Actions - (To add one, press 'Action')
 

So it really depends on what the desired behavior is, but I was trying to keep it simple.

 

Link to comment

PROGRAM EXPLAINED:

 

If from sunset to sunrise (next day)

and status of iolinc is "on"

 

Then turn light on

Else blank

 

The above is correct terminology and will work short of a comm issue as I think was expected.  The only error in the original program is the "same day" when it should have been "next day"

 

Explained:

From Sunrise to Sunset   - - -

1) this statement is true when tested at any time between sunrise and sunset.  Otherwise false

2) this statement is a TRIGGER at sunrise (false) and sunset (true)

 

And Status of iolinc is on  - - - 

1) This statement is true, when tested any time the device is on.  Otherwise false

2) This statement is a TRIGGER when it changes from on to off (false) or off to on (true)

 

 

The program as written above will trigger with every change in iolinc status and with every change in sun status (above or below horizon). 

 

Example:  

1) Door is already open, sunset occurs - - -light turns on

2) Sunset has already happened (and not yet sunrise), door is opened- -- light turns on

3) The "else" clause is empty, so nothing happens when the iolinc turns off, or the sunrises. 

 

 

You certainly can use a variable for sunrise to sunset status (dark/light), or just reference true/false status of a program that says that, but the result is the same.

Link to comment

Mr Bill.  Perhaps I am confused.  Your two examples:

 

from sunrise to sunset (same day)

from sunset to sunrise (next day) 

 

are clearly opposite time periods.  I would not expect both to behave the same.

 

Compare that to the original (post 1) program

 

from sunset to sunrise (same day)

 

Moving back to the cooper0705 program...I agree, let us keep it simple.  I continue to think that there are no more problems beyond the "same day"/"next day" condition and remain unclear regarding your earlier post (#6)

It is this condition that I find flawed, since sunrise (same day) occurs BEFORE sunset.

Link to comment

Mr Bill.  Perhaps I am confused.  Your two examples:

 

from sunrise to sunset (same day)

from sunset to sunrise (next day) 

 

are clearly opposite time periods.  I would not expect both to behave the same.

 

 

 

Done that way because I didn't want to manually adjust the clock, but wanted to test what happens "in this time period" and "outside this time period".

 

I admit the original program works differently than I expected.  I thought it was from this forum I learned that you can't use FROM TO and AND all in the same IF statement, and now I wonder why I think that doesn't work.

 

in any case i still like the "dark" variable better... much easier for testing "after sunset" things at 1pm in the afternoon.

Link to comment

Done that way because I didn't want to manually adjust the clock, but wanted to test what happens "in this time period" and "outside this time period".

 

I admit the original program works differently than I expected.  I thought it was from this forum I learned that you can't use FROM TO and AND all in the same IF statement, and now I wonder why I think that doesn't work.

 

in any case i still like the "dark" variable better... much easier for testing "after sunset" things at 1pm in the afternoon.

 

Hopefully you didn't read that in this forum without someone correcting it.

 

What you can't do is the following:

 

If

at 5am

and

device is switched on

 

The above will never have a true state.  Both conditions are "momentary event" truths.  Two momentary events can't happen at exactly the same time (at least I don't think ISY allows that, but even if it did, it would be astronomically unlikely).

Link to comment

Thanks all... It does appear to be working fairly well now, though I'm not sure why.  I had the From Sunset to Sunrise (same day) set to test during the day while i was working on it. 

 

Here's another question for you experts... When the program runs, 2 additional issues have surfaced.  

  1. While it does turn the garage light on and then off if I set the wait for 10 seconds, it doesn't seem to turn the garage light off if I set it for 10 minutes.  Almost like something is going to sleep and not allowing the program to finish. 
  2. The garage lights are on but none of the keypads I have controlling the lights show the garage lights are on.  the keypads are linked to the light switches in scenes, and they light up if I manually turn the garage lights on, but they do not show the status of the light if it is turned on via the program.
Garage Door Open, Lights ON - [iD 0007][Parent 0001]
 
If
        From    Sunset 
        To      Sunrise (next day)
    And Status  'Garage - Mud Rm / Garage Door Sensor' is On
    And Status  'Garage - Mud Rm / Garage Lights Mud Rm' is Off
 
Then
        Set 'Garage - Mud Rm / Garage Lights Garage Door' On
        Wait  10 minutes and 10 seconds
        Set 'Garage - Mud Rm / Garage Lights Garage Door' Off
 
Else
   - No Actions - (To add one, press 'Action')

post-9875-0-63602300-1506479323_thumb.png

Link to comment

If you close the door before the 10 minute delay, the program stops THEN and the light will not turn off.

 

The second issue is you have to turn on the Scene if you want the KPL to turn on.

 

<!---

I am an independent contractor.

My statements are my own opinions and do not represent those that hire my services. --->

Link to comment

Interesting, makes sense.  I'll work on figuring out how to fix that tomorrow.  I suppose the easy fix would be to turn off the light when the door is closed rather than waiting 10 min.  Usually the door is open until I walk inside and close it. 

 

Can you explain how to turn on the scene to light the KPL?  I added it to the program and nothing changed.  The scene has 2 switches and 3 KPMs.  One KPM is the controller, the rest are responders. 

 

Garage Door Open, Lights ON - [iD 0007][Parent 0001]
 
If
        From    Sunset 
        To      Sunrise (next day)
    And Status  'Garage - Mud Rm / Garage Door Sensor' is On
    And Status  'Garage - Mud Rm / Garage Lights Mud Rm' is Off
 
Then
        Set 'Garage - Mud Rm / Garage Lights Garage Door' On
        Set Scene 'Z Scenes / Garage / Garage Lights Sync 1' On
        Wait  10 minutes and 10 seconds
        Set 'Garage - Mud Rm / Garage Lights Garage Door' Off
 
Else
   - No Actions - (To add one, press 'Action')
Link to comment

Remove

 

Set 'Garage - Mud Rm / Garage Lights Garage Door' On

 

Add the switch to the Scene as a Controller.

 

 

Change

 

Set 'Garage - Mud Rm / Garage Lights Garage Door' Off

 

To set the Scene off.

 

In your program add to the ELSE a command to turn the Scene off in X minutes.

 

That should solve your issues.

 

<!---

I am an independent contractor.

My statements are my own opinions and do not represent those that hire my services. --->

Link to comment

Archived

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


×
×
  • Create New...