Jump to content

Programming Question


jmed999

Recommended Posts

Two choices.

 

1)

If
       On Thu
       Time is  8:55:00AM
   And $every.other.thursday is 0

Then
       $every.other.thrusday  = 1
       Cool house (I don't have Insteon thermostats so I don't know how this terminology goes)

Else
       $every.other.thursday  = 0


 

I haven't tested this but I think it should work. The next solution I have tested. You probably need to use an integer variable as a state variable might re-trigger the program. Not sure on that, but for sure an integer one won't. EDIT: I have now tested it. It works. It also must be an integer variable as a state variable does re-trigger.

 

2) Download the calendar program I wrote. It has a complete set of functions allowing pretty much any type of date scheduling. http://www.universal-devices.com/mwiki/ ... _Variables This would be the way to do it if you think you will want more programs that happen based on something different than the somewhat limited date functioning built into ISY.

Link to comment

This is what I have...

 

If
       On Thu
       From    11:00:00AM
       To      11:00:00PM (same day)
   And $Every.Other.Thursday is 0

Then
       Set 'Downstairs - Main' 74° (Cool Setpoint)
       $Every.Other.Thursday  = 1

Else
       Set 'Downstairs - Main' 76° (Cool Setpoint)
       $Every.Other.Thursday  = 0

 

How do I know when it will start? I want it to cool this Thursday, not next Thursday and so on.

 

So will it be 74 at 11 AM then change to 76 at 11 PM every other Thursday or will it be 74 every other Thursday and 76 every other Thursday? How do I program the other Thursday?

 

Thanks!

Link to comment

That won't work. Your else clause will run every Thursday at 11pm, not every other Thursday since Thursday 11pm is always a trigger and will always run false.

 

Try this.

 

If
       On Thu
       at    11:00:00AM
   And $Every.Other.Thursday is 0

Then
       $Every.Other.Thursday  = 1
       init  $Every.Other.Thursday  = 1
       Set 'Downstairs - Main' 74° (Cool Setpoint)
       wait 12 hours
       Set 'Downstairs - Main' 76° (Cool Setpoint)


Else
       $Every.Other.Thursday  = 0
       init $Every.Other.Thursday  = 1 EDIT!!! this should have been 0!!!

 

If you want it to start this thursday, set the variable to 0 on the variable page, if you want it to start next Thursday, set it to 1. It will automatically be set to 0 when you create the variable so if you want to start this Thursday you don't need to do anything in actuality. Once the program is set in motion, it just gets toggled back and forth every Thursday 0/1. I also added the initializing line so that it won't get messed up by a reboot of ISY.

 

I'm a bit confused by why you need the setting to 76 degrees at 11pm as part of the cleaning lady routine. Don't you have it set to 76 every day as your normal bed time routine? If so, it doesn't need to be in this program at all. I assume you have another program that sets it to 76 every day at 11pm regardless of whether it is the cleaning lady day or not.

Link to comment
I will check my other programs to make sure the nights are covered.

 

So this will work for this Thursday and everyother Thursday thereafter. Now how do I program the Thursdays that she will not be cleaning?

 

Thanks for your time! :mrgreen:

 

I don't know what your schedule is. Lets say that you have a normal schedule mon-fri. Write a program that covers that normal schedule and check off every day except for Thursday. So now all of your week days are programmed except the Thursday the cleaning lady is not there. Then write a program to do every other Thursday that is the opposite of the one above. In other words, swap all your 0's and 1's so it covers only the Thursdays that the cleaning lady isn't there.

Link to comment

This is what I have so far. Not sure if these programs are the best most efficient way to program what I want. I'm up for suggestions.

 

Weekends and nights...

 

If
       On Sat, Sun, Fri
       From     7:00:00AM
       To      11:30:00PM (same day)
    Or On Mon, Tue, Wed
       From     4:00:00PM
       To      11:00:00PM (same day)

Then
       Set 'Downstairs - Main' 74° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 76° (Cool Setpoint)

 

While at work...BTW I don't work on Fridays

 

If
       On Mon, Tue, Wed
       From     8:00:00AM
       To       4:00:00PM (same day)

Then
       Set 'Downstairs - Main' 85° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 74° (Cool Setpoint)

 

This is my current Thursday for tomorrow (cleaning lady day)...

 

If
       On Thu
       From    11:00:00AM
       To      11:00:00PM (same day)
   And $Every.Other.Thursday is 0

Then
       $Every.Other.Thursday  = 1
       $Every.Other.Thursday Init To 1
       Set 'Downstairs - Main' 74° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 76° (Cool Setpoint)
       $Every.Other.Thursday  = 0
       $Every.Other.Thursday Init To 1

 

Non Cleaning Thursdays...

 

If
       On Thu
       From     8:00:00AM
       To       4:00:00PM (same day)
   And $Every.Other.Thursday is 1

Then
       $Every.Other.Thursday  = 0
       $Every.Other.Thursday Init To 0
       Set 'Downstairs - Main' 85° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 74° (Cool Setpoint)
       $Every.Other.Thursday  = 1
       $Every.Other.Thursday Init To 0

 

Anyone have any suggestions? Are my Thursdays correct?

Link to comment

No, that won't work. Please go back and read the post where I said it won't work the first time. You can't use the from/to. The "to" will be false every single thursday and run the false which will screw up the 0/1.

 

And your second program for the other Thursday shouldn't set the variable. The first program is toggling the variable. Your two programs will fight each other with variable.

Link to comment

Here, just separate out the toggle program from the temp setting. Then you can use your from/to.

 

If
       On Thu
       at    12:00:01AM
   And $Every.Other.Thursday is 0

Then
       $Every.Other.Thursday  = 1
       init  $Every.Other.Thursday  = 1

Else
       $Every.Other.Thursday  = 0
       init $Every.Other.Thursday  = 0

 

If
       On Thu
       From     8:00:00AM
       To       4:00:00PM (same day)
   And $Every.Other.Thursday is 1

Then
       Set 'Downstairs - Main' 85° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 74° (Cool Setpoint)

 

If
       On Thu
       From    11:00:00AM
       To      11:00:00PM (same day)
   And $Every.Other.Thursday is 0

Then
       Set 'Downstairs - Main' 74° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 76° (Cool Setpoint)

Link to comment

Thanks! I'm a slow learner I guess. So now I have...

 

If
       On Sat, Sun, Fri
       From     7:00:00AM
       To      11:30:00PM (same day)
    Or On Mon, Tue, Wed
       From     4:00:00PM
       To      11:00:00PM (same day)

Then
       Set 'Downstairs - Main' 74° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 76° (Cool Setpoint)


 

If
       On Mon, Tue, Wed
       From     8:00:00AM
       To       4:00:00PM (same day)

Then
       Set 'Downstairs - Main' 85° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 74° (Cool Setpoint)


 

If
       On Thu
       Time is 12:00:01AM
   And $Every.Other.Thursday is 0

Then
       $Every.Other.Thursday  = 1
       $Every.Other.Thursday Init To 1

Else
       $Every.Other.Thursday  = 0
       $Every.Other.Thursday Init To 0

 

If
       On Thu
       From    11:00:00AM
       To      11:00:00PM (same day)
   And $Every.Other.Thursday is 0

Then
       Set 'Downstairs - Main' 74° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 76° (Cool Setpoint)

 

If
       On Thu
       From     8:00:00AM
       To       4:00:00PM (same day)
   And $Every.Other.Thursday is 1

Then
       Set 'Downstairs - Main' 85° (Cool Setpoint)

Else
       Set 'Downstairs - Main' 74° (Cool Setpoint)

 

Tomorrow is the cleaning day so I hope everything works!

 

Are there any other improvements I could do? I think I have some duplicate commands.

 

Thanks!

Link to comment

The programs in the post right above this one didn't work correctly today. I checked at 11:05 and adjusted the thermostat so it was cool but the programs didn't do it automatically. Both the cleaning day and non cleaning day programs ran.

 

Not sure why they both ran but they did. The toggle program ran at 12:00:02 also.

 

What went wrong?

Link to comment

Assuming the variable started with a value of 0, the following Program at 1 minute past midnight today (Thursday) changed the variable value to 1. That made today a non-cleaning day.

 

 

If
       On Thu
       at    12:00:01AM
   And $Every.Other.Thursday is 0

Then
       $Every.Other.Thursday  = 1
       init  $Every.Other.Thursday  = 1

Else
       $Every.Other.Thursday  = 0
       init $Every.Other.Thursday  = 0

Link to comment

You shouldn't use the "else" clause to make this work right. The trouble is you have two programs running on thursday and both are going to run false at the "end" time

 

The best way to do this is to separate your two times.

 

Have one program for each time instead of from/to. I would suggest you do that with all of your programs.

 

Each program should just say at x time, set to y temp. You can have the temp change as many times during the day as you want and there will never be a conflict.

Link to comment

I have noticed you using "else" clauses a lot. Generally speaking, "else" clauses end up with unintended consequences. There are times where else clauses work very well but in ISY, they are not that common. As a new programmer, I highly suggest sticking with "if" clauses that when true cause something to happen and when false don't do anything (else clause is empty).

Link to comment

Archived

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


×
×
  • Create New...