Jump to content

Program help needed


Skripo

Recommended Posts

Posted

Hello all,

 

I finished installing my system today and dove right into programming. My first project was automating a staircase light. Here is the logic:

 

Between sunrise and 10:00 PM the light turns on at 100% set to on

Light shuts off 30 seconds later

 

After 10:00 PM to sunrise the light turns on at 30% when set to on

Light shuts off 30 seconds later

 

Ramp rate was modified to 2.00 to turn off

 

Here is my program:

 

 

If

From Sunrise

To 10:00:00PM (same day)

And Status 'Staircase' is On

 

Then

In Scene 'Staircase Pair' Set 'Staircase' 100% (On Level)

Wait 30 seconds

In Scene 'Staircase Pair' Set 'Staircase' 2.0 Sec (Ramp Rate)

Set 'Staircase' Fade Down

 

Else

In Scene 'Staircase Pair' Set 'Staircase' 30% (On Level)

Wait 30 seconds

In Scene 'Staircase Pair' Set 'Staircase' 2.0 Sec (Ramp Rate)

Set 'Staircase' Fade Down

 

Unfortunately only the timer works and even that is not reliable. Please note that my dual bands have not arrived and I have no phase bridges installed, so that may contribute to the reliability issue.

 

Or maybe I inadvertently created a loop.

 

Any help would be apprecieated.

Posted

First, without valid coupling, trying to make the changes in a device link record is problematic. Okay to play around with turning devices On and Off. The only failure there is the device may not respond. Here the device link records are being altered which I would not try until the system is reliable.

 

From the wording "Staircase Pair" it suggests there are two devices in the Scene yet only one is being changed. Both switches should be changed if the Scene name is being used in another Program. Plus what is being changed is the value in one device when the Scene name is being used in a Program or manipulated through the Admin Console. Yet there is nothing in the posted Program that is using the Scene except the Adjust Scene. Also the On/Off status on one switch is being used to change link records which is not logical to begin with.

 

Describe what the objective is. Cover the switch configuration and exactly what the results should be. Is the result of pressing the paddle on one switch or the other what is being adjusted. I do not think what is coded is addressing what the Program may be trying to accomplish.

Posted

skripo:

 

I may not be getting all of it, but as I understand it you want the staircase light level in the scene to be 100% during the day, and 30% level at night when turned on. And in either case it should shut off 30 seconds after being turned on.

 

I'm unclear on the purpose of the ramp rate business since it seems to always be at 2 seconds. And I don't think you want to use a fade-down, just a normal control off command should do. While it might work, fade-down is intended for IR commands where you do a subsequent fade-stop.

 

You're trying to stuff too much into one program. ISY programs generally should be quite small and dedicated to just one bit of logic. Let the trigger conditions do the work to tie those bits of logic together.

 

In this case, the program is readjusting the control scene settings every time the light is used, which you don't want: that's a lot of Insteon traffic and it takes time, especially if reliability isn't great. And I think you are altering the status of the light that the conditions are triggering on which will cause the program to self-cancel and run its else part. At any rate it all gets too confusing with so much going on in there.

 

So just bust it up: Create one program to run at 10PM that simply sets the scene level for the control to 30% and exits. Then a second program to run at sunrise that sets the scene level for the control to 100%. Then create a third program that triggers on the control coming on, and turns it off after 30 seconds. If there are still problems, they'll be much easier to sort out.

 

I'd agree 100% with LeeG: if your system is not yet reasonably reliable, programmatically modifying control link records isn't the ideal thing to be attempting. At this point you might want to do a link table compare on the control, and restore it if it shows mismatches. Corrupt link tables in devices can cause all kinds of odd problems.

Posted

This is an example of what you may be looking for. Assumptions can really be way off base.

 

ISY Scene – Staircase Pair

SwitchLinc – Staircase

SwitchLinc – Unknown

 

This first Program establishes the link record Responder On Level and Local On Level values based on the time of day.

 

Note that the Ramp Rate statements have been removed completely. They were not setting any new values and can be eliminated. Set the 2 second Ramp Rate value through the Admin Console. No need for Program statements.

 

If

From Sunrise

To 10:00:00PM (same day)

 

Then

In Scene 'Staircase Pair' Set 'Staircase' 100% (On Level)

In Scene 'Staircase Pair' Set 'Unknown' 100% (On Level)

In Scene 'Staircase' Set 'Staircase' 100% (On Level)

In Scene 'Staircase' Set 'Unknown' 100% (On Level)

In Scene 'Unknown' Set 'Unknown' 100% (On Level)

In Scene 'Unknown' Set 'Staircase' 100% (On Level)

 

Else

In Scene 'Staircase Pair' Set 'Staircase' 30% (On Level)

In Scene 'Staircase Pair' Set 'Unknown' 30% (On Level)

In Scene 'Staircase' Set 'Staircase' 30% (On Level)

In Scene 'Staircase' Set 'Unknown' 30% (On Level)

In Scene 'Unknown' Set 'Unknown' 30% (On Level)

In Scene 'Unknown' Set 'Staircase' 30% (On Level)

 

The second Program recognizes switch activation, Waits and turns the Scene Off.

 

If

Status 'Staircase' is On

Or Status 'Unkinown' is On

 

Then

Wait 30 seconds

Set Scene 'Staircase Pair' Off

Else

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

Posted
Or maybe I inadvertently created a loop

 

For what it is worth, I suspect you do have a loop. In your conditions, you have a condiotion for staircase status. In your then and else statements, you fade down the stairase lights. This forces a re-evaluation of your program.

Posted

The unreliability seems to be more on the ISy99i side as I have had lockups and unreliable swicthes that all of sudden became super reliable over a period of 4 days. I did the Java thing and cache clearing and that seems to have helped. My dual bands should be in next week with at least 2 per floor.

 

The second switch in the scene is the secondary that replaced the 3 way swicth.

 

Thank you all so much for your excellent posts, I will make the changes and report back.

Posted

So I set up a folder for staircase and made a brightness level program and a timer program. Everything works like a champ.

 

My last question is:

 

Is how do I set the off ramp rate separately from on?

 

The family loves the instant on but it would be cool if we could rip the off portion only. Is there an easier way then creating a program for it? I would like to apply it to all the lights.

Posted

Insteon hardware/firmware does not support a different Ramp Rate for On versus Off. A Fast On/Fast Off will override a slow ramp rate but it is fixed at 0.2 seconds (it is fixed for sure).

Posted

Why are so many lines needed in:

 

Then

In Scene 'Staircase Pair' Set 'Staircase' 100% (On Level)

In Scene 'Staircase Pair' Set 'Unknown' 100% (On Level)

In Scene 'Staircase' Set 'Staircase' 100% (On Level)

In Scene 'Staircase' Set 'Unknown' 100% (On Level)

In Scene 'Unknown' Set 'Unknown' 100% (On Level)

In Scene 'Unknown' Set 'Staircase' 100% (On Level)

 

Else

In Scene 'Staircase Pair' Set 'Staircase' 30% (On Level)

In Scene 'Staircase Pair' Set 'Unknown' 30% (On Level)

In Scene 'Staircase' Set 'Staircase' 30% (On Level)

In Scene 'Staircase' Set 'Unknown' 30% (On Level)

In Scene 'Unknown' Set 'Unknown' 30% (On Level)

In Scene 'Unknown' Set 'Staircase' 30% (On Level)

 

Seems like you are doing everything 3 times. Why?

 

I have 2 devices, one named Staircase and one Named Staircase Slave

 

I created a scene called Staircase Pair and put them both in.

 

I want them to be 100% brightness from sunrise to 10:00 PM

 

I want them to be 30% brightness after 10:00 PM

 

Why would this not work:

 

Then

In Scene 'Staircase Pair' Set 'Staircase' 100% (On Level)

In Scene 'Staircase Pair' Set 'Staircase Slave' 100% (On Level)

 

Else

In Scene 'Staircase Pair' Set 'Staircase' 30% (On Level)

In Scene 'Staircase Pair' Set 'Staircase Slave' 30% (On Level)

 

Not trying to be argumentative, just trying to understand. Teach a man to fish......

 

Edit:

 

I think I got it, 3 scenes right?

Posted
Insteon hardware/firmware does not support a different Ramp Rate for On versus Off. A Fast On/Fast Off will override a slow ramp rate but it is fixed at 0.2 seconds (it is fixed for sure).

 

I used a fade down, now the lights come on fast, wait 30 seconds, and fade off.

 

Love it.

Posted

Setting the two responders for the ISY Scene name works for when the Scene name is used in a Program or manipulated with the Admin Console. It would not affect what happens when either paddle is pressed.

Posted

Timer and fade down works a treat. Can't seem to get brightness to work. Any ideas?

 

By the way, I was told both devices needed to be set as controllers for them to reflect each others status. Is this correct?

Posted

For two devices to control the same load and the status LEDs to stay in sync, yes they both need to be added to the ISY Scene as Controllers. The ISY will cross link the devices such that either controls the load and the LEDs will be in sync.

 

Regarding the Fade Up, are you using the Fade Stop to stop the Fade Down before issuing the Fade Up?

Posted

Leeg,

 

I am not issuing anything other than fade down. Here is another issue, when I set wait time to 5 seconds for testing, everything works perfectly. When I put it to. 30 seconds, nothing.

 

Brightness control still does not work at all.

 

I did manage to set up a schedule for the backlights and that executed perfectly.

 

Is my staircase cursed?

 

Can you please comment on my post entitled "trying to understand" about 5 or posts up?

 

Thank you for helping m e so much. I appreciate it.

Posted

The two Adjust Scene statements alone affect what happens when the ISY Scene name is used in a Program. They do not affect what happens when the paddle of either switch is operated. The additional 4 lines in my post change the values for when each switch paddle is used. The On Level and Ramp Rate information is stored in each responder under the address of the controller device. There are three controller devices involved, ISY PLM, Staircase, Staircase Slave. It is necessary to change the responder values for all three controllers, thus the need for six Adjust Scene statements. Actually when specifying one of the devices in both name fields the Local On Level is being set rather than the responder information in a link record.

 

Fade Up/Down Fade Stop are issued in pairs. When you press a paddle and hold it the equivalent of a Fade Up/Down is issued. When the paddle is released the equivalent of a Fade Stop is issued. Don't know what the device firmware will do if the Fade Stop is not issued.

 

Suggest posting the actual Program along with an Event Viewer trace with the Level 3-Device communication events selected. The difference could be that the device reaches the end of the ramp and posts a state change within the 30 seconds that does not happen in 5 seconds.

Posted

I used the fade stop command as you suggested and it now works absolutely flawlessly. I was trying to understand the logic of putting it before the fade down and this is what I understood:

 

Trying to reset the state right after the fade down would affect the fade down itself unless a timer is put in. Setting the starting state is a much more elegant solution. Is this correct?

 

The last thing I need to do with timers now is detect a double 'on tap' to keep the light on for 10 minutes. From what I understand it would be best to set up a second program correct? I imagine it would be ok to use the same also right?

 

Once I got this locked in, I will attack the brightness issues.

 

Thank you.

Posted

"Trying to reset the state right after the fade down would affect the fade down itself "

 

It could. Would depend on the On Level when the Fade Down was issued.

 

"Setting the starting state is a much more elegant solution. Is this correct?"

 

It has not been clear to me where the Fade Down is issued relative to the overall logic. Perhaps seeing the Program would help.

 

"thing I need to do with timers now is detect a double 'on tap' "

 

The Insteon hardware issues a Fast On command when a double tap of the On paddle occurs. This overrides the On Level and Ramp Rate settings, turning the device 100% On with a relatively fast ramp rate. The Fast On can be checked in a Program If statement.

Posted

Here is the program with the fade stop before the fade down as you suggested:

 

If

Status 'Staircase' is On

Or Status 'Staircase Slave' is On

 

Then

Wait 10 seconds

Set Scene 'Staircase Pair' Fade Stop

Set Scene 'Staircase Pair' Fade Down

 

Else

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

 

This seems bulletproof so far.

 

Edit: Posted wrong program.

Posted

Putting the Fade Stop first is an odd fix as the Fade Stop normally occurs after the Fade Down. I suspect the Fade Stop is actually clearing the previous Fade Down. Something like this would be better ...

 

Then

Wait 10 seconds

Set Scene 'Staircase Pair' Fade Down

Wait ?? seconds

Set Scene 'Staircase Pair' Fade Stop

 

where the ?? value is what is need to bring the level to Off. This will take a few tests to determine a good value.

 

If my suspicion is correct about the Fade Stop actually clearing the previous Fade Down, a Fade UP may have a problem because the previous Fade Down had no ending Fade Stop. I suggest moving the Fade Stop after the Fade Down before spending time on the Fade Up issue.

Posted

Actually I do not want a fade up, I want instant on so this is perfect. I tried to put the fade stop after and it would not work.

 

I then put an off and the fade would be abruptly cut off. I agree the logic is wonky but I am not about to look a gift horse in the mouth.

 

Now about that brightness issue.......

 

Do you think it could be related to the improper state after the fade down?

 

I will experiment by disabling the programs so I can isolate the issue.

 

Thanks again.

Posted

Nope, don't need fade up. I want the light at 100% during day and 30% from 10:00 PM to sunrise.

 

I set that up for backlight and it worked fine on an other scene but on this one it always opens at 100%

Posted

I want the staircase scene (which contains Staircase and Staircase Slave as controllers) to come on at 100% brightness until 10:00 PM. Between 10:00 PM and sunrise i want them to come on at 30%.

 

Do you think the ending state of the Fade down might be the problem?

Guest
This topic is now closed to further replies.

×
×
  • Create New...