Jump to content

Help writing program


Go to solution Solved by Geddy,

Recommended Posts

I have Eisy 5.5.9 and i need some direction writing a program for my outdoor parking area. The parking area comes on at sunset everyday at 35% and i would like it to have it brighten to 100% when motion is triggered then dim back down to 35% after 5 minutes. Could someone  give me some pointers please? Thanks

 

Link to comment

Since you didn't provide a lot of details about your program or the motion sensor here is some general guidance. 

I'm assuming you already have a program that turns on the light to 35% at sunset, I going to call that the "Sunset Program".

Add a 2nd program that does this:

If

   Motion is detected and

   time window for the "sunset program" is true (ex. > sunset and < 11PM)

Then

  Turn lights on to 100%

  Wait 5 Minutes

  Run "Sunset Program" (if path)

Depending on how your if path in the "sunset program" is written, this might not work.  If the condition is "after sunset and before 11PM" for example, it will work. 

Edited by tmorse305
  • Like 1
Link to comment

Change that to like this:

 

If
        From    Sunset
        To      11:59:59PM (same day)
 
Then
        Set 'Christmas Tree#' On 35%
 
Else
        Set 'Christmas Tree#' Off

 

I choose 11:59:59 because I'm not certain whether the ISY considers 12:00:00 exactly to be "Same Day" or "Next day".. I'm certain 12:00:01 would be Next Day, it should include 12:00:00 AM as Next Day, but since I didn't test the best advice it to just avoid it and use 11:59:59 because I know that is "Same Day".

  • Like 1
Link to comment

and those two programs should work fine together, this one and the motion...

 

Also when posting programs it's really better to Right click the program name then Copy to Clipboard and paste into the message, like i did above.   If you do that over screen shots people helping can cut and paste to re-arrange a program, screenshots take more typing to re-create.

Link to comment

so if i want it to  return to the original 35% do i still need to put the "else" in?

thanks for the copy trick!

 

Parking Pad Light - [ID 000D][Parent 0001]

If
        From    Sunset 
        To      11:45:00PM (same day)
    And 'Outdoor / Parking Pad Sensor.1 Motion' is switched On
 
Then
        Set 'Outdoor / Parking Pad' On 100%
        Wait  5 minutes 
        Run Program 'Sunset' (Then Path)
 
Else
   - No Actions - (To add one, press 'Action')
 

Link to comment
1 hour ago, n8ur9irl said:

do i still need to put the "else" in

The "else" that @MrBill was suggesting was for your Sunset program. 

You have a "Sunset" and a "Sunrise" program showing in your screenshot. I think he's assuming that your "Sunrise" program might be turning the outside lights off. You can use his suggestion to only have 1 program.

For instance I have this for my front door light:

Front Light - Night - [Run At Startup]

If
        From    Sunset  -  1 hour
        To      Sunrise +  1 hour (next day)
 
Then
        Set 'Front' On
 
Else
        Set 'Front' Off

This does both the turning on, and turning off. Be sure that it's triggered to run at startup incase you have a power outage that happens before your time and returns after your time it will turn on the outside lights.

As you have it now your parking pad light will only trigger from Sunset to 11:45pm. You would set it back to the 35%, but you need to edit the sunset program to turn the lights on to 35%. Right now your program just has them coming "ON" at Sunset. Their on% is either handled by another program or scene or device setting.

It's unclear how you're turning those on at 35%. What is "Outdoor Lights On"? Probably a scene?

 

Final comment...wouldn't you want the outside lights to go to 100% if there is motion all night long? It would potentially pause anybody approaching your house with the change in brightness. And if you have outdoor cameras might help with the details of the motion overnight. 

 

Link to comment

Yes i do want the motion switch to activate all night. We are in the country with bears. 😗

Thank you Geddy for the program advice I changed some other multiple folders to 1 on/off. One thing I am having a problem with the outdoor lights is that the 100% is activating in the daytime also. I have the scheduled times in "If" and I also changed the motion sensor to day only. See anything that would cause that

Parking Pad Light - [ID 000D][Parent 0001]

If
        From    Sunset 
        To      11:45:00PM (same day)
    And 'Outdoor / Parking Pad Sensor.1 Motion' is switched On
 
Then
        Set 'Outdoor / Parking Pad' On 100%
        Wait  5 minutes 
        Run Program 'Outdoor Lights' (Then Path)
 
Else
   - No Actions - (To add one, press 'Action')
 

Link to comment
  • Solution
15 hours ago, n8ur9irl said:

See anything that would cause that

If the program you posted is the only one triggering based on motion then it shouldn't be doing it during the day, but now you've said you've adjusted the motion sensor to only trigger at night. Did that help? What kind of motion sensor are you using?

It sounds like there might be another program triggering the light. You can use the "Find/Replace" feature in the program tree. Click on the root folder (probably "My Programs"). Right click to get a menu. Select "Find/Replace". You'll get the window to search for finding "Your Devices". Select the "Parking Pad..." and then only hit "Find" (note, you don't want to replace so be sure you only click "FIND"

image.png

image.png

 

15 hours ago, n8ur9irl said:

Yes i do want the motion switch to activate all night.

If you want it to run all night then you should remove the "11:45pm (Same Day)" from the program and make it something like "Sunrise (Next Day)". The example @MrBill gave above was from his own system and it was for a light he wants to turn off before midnight. The example I gave above turns my lights on and off around the sunset/sunrise time. You would want something similar to allow the motion to trigger during the middle of the night.

 

What you posted in a screen shot above could be your issue. Unless you modified THAT program. The way you had it in the screen shot was that anytime there was motion they light would come on. You also ran the "THEN" of the Sunset path meaning whatever that program does happened following the program you posted. 

When you call on a "THEN" there's no evaluation of that program and it just runs "THEN". So even though the sunset program probably has a time to happen you're avoiding that schedule when you run "THEN" of that program. 

 

Since you've been modifying several programs please post all CURRENT programs that trigger the light (Sunset, Sunrise (if still 2 programs), and motion trigger). This way we can accurately review what is currently being used.

 

 

 

 

  • Like 1
Link to comment
11 minutes ago, Geddy said:

The example @MrBill gave above was from his own system and it was for a light he wants to turn off before midnight.

No actually it was because @n8ur9irl said she wanted it to stop at 12:00

On 5/20/2023 at 1:27 PM, n8ur9irl said:

Thank you I also added that i want it between the hours Sunset and 12:00

The important thing to understand is that the two programs are designed to interact with each other.  The reason they are designed to interact with each other is so that a Motion event at the end of the window will end with the light off.   For that reason it's a Must that the SUNSET Program also include the off time, and that not be two separate programs.  But are these programs even for the same light?   Looking back it looks like we are dealing with 'Outdoor lights' and "parking pad'.

So I'm going to use a GENERIC device "Light" in this example to illustrate how it works:

Program Light

If
       From Sunset
           To Sunrise (next day)
Then
       Set 'Light' on 35%
Else
       Set 'Light' Off

this program will make 'light' be 35% from Sunset to Sunrise.

Now we add a second related program:

Program Motion

If
            Motion_Detected is switched on
   AND  From Sunset
                to    Sunrise (next day)
then
         Set 'light' on 100%
          Wait 15 min
          Run Program Light (if)

This program, on motion during the same time period will turn the light up to 100%, wait 15 minutes, then run the Original program to turn the light back down. 

Why do we run the original program, instead of just going back to 35%?  Because if the motion occurred 5 minutes before Sunrise, the light would first get bright for motion, the light would first turn off at Sunrise, then when the end of the Wait 15 minutes occurred it would turn back on to 35%.   Since we have interrelated these two programs what will happen now is that the light will go bright 5 minutes before sunrise and turn off at sunrise then when the Wait expires it will turn off again.
     

  • Like 3
Link to comment

Im using an insteon motion sensor II for the program. even after the change to the only at night it didnt help . i did the search and it didn't come up with any thing else. I did change the timing

Parking Pad Light - [ID 000D][Parent 0001][Run At Startup]

If
        From     8:15:00PM
        To      Sunset  (next day)
    And 'Outdoor / Parking Pad Sensor.1 Motion' is switched On
 
Then
        Set 'Outdoor / Parking Pad' Fade Up
        Wait  5 minutes 
        Run Program 'Outdoor Lights' (Then Path)
 
Else
   - No Actions - (To add one, press 'Action')
 

Outdoor Lights - [ID 0025][Parent 0001][Run At Startup]

If
        From    Sunset  +  1 hour 
        To      Sunrise -  1 hour  (next day)
 
Then
        Set 'Sunrise' On
 
Else
        Set 'Sunrise' Off

 

motionsensoroptions.jpg.1e157b5db22e47c110c2e448b25d08a5.jpg

Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...