Jump to content

Programs


osurh18

Recommended Posts

Last question of the night....I was trying to do a simple program to turn off my outside lights at a certain time.

 

I started a new program

I used the schedule feature to set the time and added it to the code

I then added AND Device A is on

or Device B is ON

 

Then

Set Device A Off

and

Set Device B Off

 

 

When the program kicked off my lights started turning on and off and on and off like it was stuck in a loop. I trices ed deleting the programs (that didn't do it) and I tried to delete the devices (that has now caused all of my devices statuses to be blank and when I try to do anything I get Discovering Nodes, Retry.......

Suggestions? Please (before I snap and quit) Thanks.

 

 

-Edit - Need help quick. My F'ing lights are just turning on and off and I can't get them to stop

Link to comment

Mark the Programs Disabled to stop the execution.

 

There are a few problems in the Program you described. Suggest the Program be posted so the exact situation can be evaluated. The If statement needs parens to get the order of precedence correct. The Program probably changing the Status of a device used in the If. Assumptions until the actual Program can be seen.

Link to comment

My neighbors thank you.

 

Any idea on what I did wrong with the programs?

 

I had 2 of them

 

Front Lights ON

If

Time is 8:30 PM

and status Front Porch is Off

or status Garage Lights is Off

 

Then

Set Garage Lights On

Set Front Porch On

Else

 

FronLights Off

If

Time is 9:50

and Status Garage Light is On

or Front Porch is On

 

Then

Set Front Porch Off

Set Garage Off

End If

Link to comment

The order of precedence is not what you want. The first device Status is Anded with the Time, the second device status, the one that is Ored stands alone, not gated by time. There is a good write up on the order of precedence in the UDI Wiki if more information is needed.

 

Front Lights ON

If

Time is 8:30 PM

and

(

status Front Porch is Off

or status Garage Lights is Off

)

Then

Set Garage Lights On

Set Front Porch On

Else

 

FronLights Off

If

Time is 9:50

and

(

and Status Garage Light is On

or Front Porch is On

)

 

Then

Set Front Porch Off

Set Garage Off

End If

Link to comment

It also looks like you can simplify the program. Based on what I'm seeing your simply trying to have the program turn on the outside lights when it gets dark and turn them back off again when it gets light. For example:

 

IF:

From 8:30 PM

To 9:00 AM (next day)

 

Then

Set Garage Lights On

Set Front Porch On

 

Else

Set Garage Lights Off

Set Front Porch Off

 

Nice, simple and condensed. I use a similar program for my outside lights. (except I use the time of sunset/sunrise)

Link to comment

Archived

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


×
×
  • Create New...