Jump to content

"Else" portion of program


PB11

Recommended Posts

Posted

Hi All

Just looking for some clarification.

In my program I have 

If between 10pm and sunrise

Then

Set scene to this

Else 

Set the scene to default.

Can I assume at the end of the If time, i.e at sunrise, my scene will return to the default settings?

The cookbook states "• The THEN statement will run when the program is TRUE. • The ELSE statement will run when the program becomes FALSE."

So I assume when the if is not longer true the status is false. Correct?

Posted

From....to is a complex condition statement.

 

From 6 AM
To 10 PM

Triggers Then at 6 AM
Triggers Else at 10 PM

....  and also acts as a filter for other program triggers and is true between 6 AM and 10 PM and false between 10 PM and 6 AM whether the program is enabled or not. (subroutine mode)

Posted

if this means you're turning the scene on and off, then yes it will have the desired result. 

If you're using it to "adjust scene" then you may not be doing what you intend.

The best thing to do when requesting programming help to to post the actual program by right clicking the name of the program in the program tree and choosing "COpy to Clipboard", you can then paste this into a post.  Also tell us what you are trying to accomplish.

  • Like 2
Posted
4 minutes ago, MrBill said:

If you're using it to "adjust scene" then you may not be doing what you intend.

 

Since he referred to "default" he must be trying to use Adjust Scene, which probably is indeed not what he wants.

I've always wondered what the use case is for Adjust Scene?  If you want a group of lights to do different things, wouldn't/shouldn't you create multiple scenes instead of trying to "adjust" the one scene?

  • Like 1
Posted (edited)
31 minutes ago, carealtor said:

If you want a group of lights to do different things, wouldn't/shouldn't you create multiple scenes instead of trying to "adjust" the one scene?

I'm sure there are other reasons, but one reason is because the PLM has a limited number of links that it can hold.  Every scene that a device is in counts as a link.  So if you have enough devices, and use enough scenes, eventually you'll run out of links in the PLM table.

Another is because a device can only be a controller for one scene.  So let's say you have a motion sensor directly linked to a light.  In the daylight you want the light to come on at 100%, but at night it want it to come on at 20%.  The only way you can accomplish this, if you leave the motion sensor directly linked to the light, is by using Adjust Scene.

Edited by kclenden
Add second reason.
  • Thanks 1
Posted
13 hours ago, larryllix said:

also acts as a filter for other program triggers

Hi @larryllix

by the above do you mean it will affect any other programs which have the same nodes?

So for example,

If i have a "dim program" that sets the hallway to 30% after 8pm, and I have an "arriving home geofence program" that turns on the hallway between 6pm and 11pm, then after 8pm the "arriving home program" will also fall under the "dim program" resulting in my geofence hallway program turning on the lights to 30%?

Posted
13 hours ago, MrBill said:

If you're using it to "adjust scene" then you may not be doing what you intend.

I am indeed trying to adjust scene. I have found if I simply change the settings of a node between a period of time, the results are my lights turn on at one level then quickly adjust to the corresponding active program. 

Here's one of the programs I'm wanting to confirm. 

The hope is as the day progresses into night, I have one level of lighting during wake hours, and a much dimmer light leveling during the wee hours. At the end of the wee hours program (i.e daylight) the light levels return to much higher levels.

Guest Wing Wee Hours - [ID 0021][Parent 0053]

If
        From    11:00:00PM
        To      Sunrise (next day)
 
Then
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights East' To 20% in 0.1 seconds
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights Mid' To 20% in 0.1 seconds
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights West' To 20% in 0.1 seconds
        In 'Guest Bathroom / Guest Vanity' Set 'Guest Bathroom / Guest Bathroom Vanity' To 15% in 0.1 seconds
        In 'Peter's Office / Peter's Office' Set 'Peter's Office / Peters Office Lights' To 35% in 0.1 seconds
        In 'Guest Bedroom / Guest Lights' Set 'Guest Bedroom / Guest Bedroom Lights' To 35% in 0.1 seconds
        In 'Back door / Backdoor' Set 'Back door / Hallway Bank / Backdoor Lights' To 35% in 0.1 seconds
        In 'Back door / Backdoor' Set 'Back door / Backdoor Lights' To 35% in 0.1 seconds
 
Else
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights East' To default
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights Mid' To default
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights West' To default
        In 'Guest Bathroom / Guest Vanity' Set 'Guest Bathroom / Guest Bathroom Vanity' To default
        In 'Peter's Office / Peter's Office' Set 'Peter's Office / Peters Office Lights' To default
        In 'Guest Bedroom / Guest Lights' Set 'Guest Bedroom / Guest Bedroom Lights' To default
        In 'Back door / Backdoor' Set 'Back door / Hallway Bank / Backdoor Lights' To default
        In 'Back door / Backdoor' Set 'Back door / Backdoor Lights' To default
 

Posted
5 minutes ago, PB11 said:

Hi @larryllix

by the above do you mean it will affect any other programs which have the same nodes?

So for example,

If i have a "dim program" that sets the hallway to 30% after 8pm, and I have an "arriving home geofence program" that turns on the hallway between 6pm and 11pm, then after 8pm the "arriving home program" will also fall under the "dim program" resulting in my geofence hallway program turning on the lights to 30%?

No. Only triggers within the same program or when other programs call this program as a subroutine.

If
....Something is switched On
....AND
.....From 6 AM
....To 10 PM
Then
.....only do something between 6AM-10PM if enabled when something is switched on
Else
....only do something between 10PM-6AM if enabled when something is switched on

 

  • Like 1
Posted
5 minutes ago, PB11 said:

I am indeed trying to adjust scene. I have found if I simply change the settings of a node between a period of time, the results are my lights turn on at one level then quickly adjust to the corresponding active program. 

Here's one of the programs I'm wanting to confirm. 

The hope is as the day progresses into night, I have one level of lighting during wake hours, and a much dimmer light leveling during the wee hours. At the end of the wee hours program (i.e daylight) the light levels return to much higher levels.

Guest Wing Wee Hours - [ID 0021][Parent 0053]

If
        From    11:00:00PM
        To      Sunrise (next day)
 
Then
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights East' To 20% in 0.1 seconds
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights Mid' To 20% in 0.1 seconds
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights West' To 20% in 0.1 seconds
        In 'Guest Bathroom / Guest Vanity' Set 'Guest Bathroom / Guest Bathroom Vanity' To 15% in 0.1 seconds
        In 'Peter's Office / Peter's Office' Set 'Peter's Office / Peters Office Lights' To 35% in 0.1 seconds
        In 'Guest Bedroom / Guest Lights' Set 'Guest Bedroom / Guest Bedroom Lights' To 35% in 0.1 seconds
        In 'Back door / Backdoor' Set 'Back door / Hallway Bank / Backdoor Lights' To 35% in 0.1 seconds
        In 'Back door / Backdoor' Set 'Back door / Backdoor Lights' To 35% in 0.1 seconds
 
Else
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights East' To default
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights Mid' To default
        In 'Hallway / Hallway' Set 'Hallway / Hallway Lights West' To default
        In 'Guest Bathroom / Guest Vanity' Set 'Guest Bathroom / Guest Bathroom Vanity' To default
        In 'Peter's Office / Peter's Office' Set 'Peter's Office / Peters Office Lights' To default
        In 'Guest Bedroom / Guest Lights' Set 'Guest Bedroom / Guest Bedroom Lights' To default
        In 'Back door / Backdoor' Set 'Back door / Hallway Bank / Backdoor Lights' To default
        In 'Back door / Backdoor' Set 'Back door / Backdoor Lights' To default
 

You will likely flood your Insteon cache and lose some actions with so many packed together scene changes, doing that. Rewriting the EPROMS inside the Insteon devices takes time to do. Insert Wait 10-20 seconds between each line of scene change code or beak it into multiple programs that operate independently.

Posted (edited)

@larryllixk, so previously I have used this approach, but this is when I found the condition, i.e lighting level would come on at one level then very quickly apply "then" changing to appropriate lighting levels.

I thought if I simply changed the scene state at a fixed point in time it would avoid this issue.

Edited by PB11
Posted
Just now, larryllix said:

You will likely flood your Insteon cache

Right, I usually do this, but only for much longer changes i.e house wide backlight changes. Thanks, will make these changes.

Better approach?

 

Posted
Just now, PB11 said:

Right, I usually do this, but only for much longer changes i.e house wide backlight changes. Thanks, will make these changes.

Better approach?

 

I use independent programs for each room and independent times for each program. Some based on sunset and some based on exact times.

  • Thanks 1
Posted

so better if I simply change the state of a program at one moment ie 11pm with 10 seconds between each line of code. Rather then "If between 11pm and sunrise"?

Then at sunrise run a program change scene back to default?

Posted

The bathroom lighting works well at fixed times during the night and mornings. If you want bright lights just tap the SwitchLinc Dimmer up again for 100% lights. Otherwise you get about 12% (dimmest I can get with these bulbs)

No MS involved and all manual switchLinc  operated.

Posted
Just now, PB11 said:

so better if I simply change the state of a program at one moment ie 11pm with 10 seconds between each line of code. Rather then "If between 11pm and sunrise"?

Then at sunrise run a program change scene back to default?

I prefer the independent program method myself. Each room requires a different time. Bedtimes are set at a constant time. I find sunset and sunrise is not how we want the lighting levels changed anyway. Summer to winter they should not vary.

Posted
1 minute ago, larryllix said:

No MS involved and all manual switchLinc  operated.

Where's the fun in that? :) Can I ask what you mean by MS?

Posted
Just now, PB11 said:

Where's the fun in that? :) Can I ask what you mean by MS?

MS = motion sensor.

Bedroms require earlier times and run off MSes. Bathrooms require different times to accommodate the midde of the night run.

Posted
1 minute ago, larryllix said:

MS = motion sensor

Ah, thanks. I've just purchased 2 MS over the holidays, but am only just dabbling as I'm struggling to understand their usage value and how to utilize their data fields.

Posted (edited)
14 hours ago, carealtor said:

 

I've always wondered what the use case is for Adjust Scene?  If you want a group of lights to do different things, wouldn't/shouldn't you create multiple scenes instead of trying to "adjust" the one scene?

If its only the ISY changing the lights in a scene, then using multiple scenes instead of adjust makes perfect sense. If you want to change how the lights work at the switch manually, then you would want to use adjust scene. 

For example, my front porch and garage lights dim to 40% after 11. If motion is sensed, it'll turn full on and then go back to 40%. I just use multiple scenes for this with everything in them as responders. 

With my livingroom lights, I use adjust scenes. If you manually turn on the lights from any of the switches during the day/evening, they turn on 100%. Late night, they'll only turn on 50%.

Edited by lilyoyo1
  • Like 1
  • Thanks 1
Posted
13 hours ago, carealtor said:

Since he referred to "default" he must be trying to use Adjust Scene, which probably is indeed not what he wants.

I've always wondered what the use case is for Adjust Scene?  If you want a group of lights to do different things, wouldn't/shouldn't you create multiple scenes instead of trying to "adjust" the one scene?

The only place I previously used it was a bedroom closet light.  The controller was a hidden door sensor.  At bedtime scene adjust changed the on level to 8%, in the morning some offset after sunrise it changed back to 100%.    The idea being if I opened the closet door in the night while my wife was asleep it wouldn't flood the room with light.   Worked great with v4.x... version 5.x has a bug where it tries to write to the battery powered scene controller.  I had to switch to doing the same thing via programs, which means that I open my closet door now and can count slowly ONE, TWO, THREE then the light comes on, whereas with the scene adjust method it was literally instant.

Same use case idea... scene's controlled by motion detectors.  If I had motions I would probably want to use it there, I don't have motion detectors tho for several reasons.

Another interesting use case, I helped a guy in another thread awhile back that was setting his office up.  He was using a motion detector to turn the office on/off based on presence, but he wanted the scene to remember what he had on.  If he turned the overhear light on or off manually, he adjusted the scene for the motion,  same for the desk light, if he turned it on/off manually it was a scene adjust.  The fan was more complicated and took into account the temperature as well, but the jist being when we walked out of the office it should turn everything off, when he came back it should turn back on just what he has turned on when he left.  The drawback to what he's doing is that he's not re-writing the scene just twice a day but many times, eventually he'll have devices fail from overwriting the memory frequently (it'll still take years probably but device life will be shortened).

What most people don't understand about Adjust Scene:  is that it doesn't change the state of what is on or off after the "Adjust scene" action, it changes how the scene is programmed. If it's also desired to actually effect the current state of the lights the program also needs to send the scene and On or Off.

How much traffic creates a traffic jam?  Insteon does a much better job than X10 did at avoiding collisions.  Insteon is also faster than X10 was but it's still a really slow protocol by modern standards, things happening by Insteon are practically almost measured in full seconds, and can only happen one at a time.  In the range 15-30 years ago I solved X10 problems that other people created and/or didn't understand.  As a result I'm very conscious of everything that creates power-line traffic, most people aren't tho.  I helped someone else from this forum offline, he ended up PMing me then we spent a couple hours on a screen share most of his problems were that he was just writing way too much useless traffic to the powerline, many Else bodies that were constantly getting triggered turning things off that were already off, etc.  He also had GREAT BIG HUGE programs changing backlights and on levels based not on not just day/night but actually how bright it was outside,  and he was basing it on a luminescence sensor that updated every 30 seconds and doing nothing to de-bounce.  It was night when I was talking to him, but had it been a partly cloudy day I could actually see that his programs could literally fire those big programs every 30 seconds. 

  • Like 2
  • Thanks 2
Posted
1 hour ago, PB11 said:

@larryllixSo far, my biggest issue is response time of a program triggered by MS.

 

This may not work properly for the new MS II devices. The scene modification syntax has changed somewhat with newer ISY firmware versons.

 

 

Posted
1 hour ago, PB11 said:

Ah, thanks. I've just purchased 2 MS over the holidays, but am only just dabbling as I'm struggling to understand their usage value and how to utilize their data fields.

MS's are great for a lot of things. I use zwave and Insteon sensors. Speed has never been an issue even though i use programs for everything. 

I have them hidden to turn the underbed lights on late night. Late night, they will turn lights on to a very dim level just enough so you can see. If you need more light, you can hit the switch which will turn them on to 50% if you need more but not full on (unless you double tap)

I also use my sensors to turn lights and stuff off in rooms/areas that are unoccupied. For example, if no motion is sensed on my patio for an hr and the tv or music is on, itll automatically shut everything down. This only happens at night as we could potentially be in the yard away from the sensor during the day. 

My zwave MS's have lux sensors built in. I use this to adjust lighting in occupied rooms vs using only sunset +/- to trigger stuff. On a cloudy or rainy day, those options do not work well which can leave you sitting in the dark or needing to physically turn on the lights (whether its remotely or by touch). By looking at the amount of light in the room, the lights will turn on by themselves. Sometimes it

  • Like 1
Posted
4 minutes ago, MrBill said:

The only place I previously used it was a bedroom closet light.  The controller was a hidden door sensor.  At bedtime scene adjust changed the on level to 8%, in the morning some offset after sunrise it changed back to 100%.    The idea being if I opened the closet door in the night while my wife was asleep it wouldn't flood the room with light.   Worked great with v4.x... version 5.x has a bug where it tries to write to the battery powered scene controller.  I had to switch to doing the same thing via programs, which means that I open my closet door now and can count slowly ONE, TWO, THREE then the light comes on, whereas with the scene adjust method it was literally instant.

Same use case idea... scene's controlled by motion detectors.  If I had motions I would probably want to use it there, I don't have motion detectors tho for several reasons.

<snipped>

You must turn off the battery writes option. ISY turns it back on upon rebooting. UDI has just reported it has fixed this in the next release.

  • Like 2
Guest
This topic is now closed to further replies.

  • Recently Browsing

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

    • There are no registered users currently online
  • Forum Statistics

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