Jump to content

Vacation Folder


mfbrin

Recommended Posts

I have a kitchen sink hot water heater. I have a plug that instructs that if the plug is OFF, then turn it ON.  I have this in case someone inadvertently turns it OFF.

I want it to always be ON unless the folder I call "Vacation" is running.  In other words, I have a If Date/Time X-->Y, then run the programs in the folder.  If I have a program in the Vacation folder that says to turn off the Sink Hot Water, then there will be a program turning it ON at the same time as one saying to turn it OFF.   For the Sink Heater Program, is there a way to say that if the Vacation folder programs are not running, then turn the Plug ON?

Thanks.

 

 

Link to comment
30 minutes ago, mfbrin said:

I have a kitchen sink hot water heater. I have a plug that instructs that if the plug is OFF, then turn it ON.  I have this in case someone inadvertently turns it OFF.

I want it to always be ON unless the folder I call "Vacation" is running.  In other words, I have a If Date/Time X-->Y, then run the programs in the folder.  If I have a program in the Vacation folder that says to turn off the Sink Hot Water, then there will be a program turning it ON at the same time as one saying to turn it OFF.   For the Sink Heater Program, is there a way to say that if the Vacation folder programs are not running, then turn the Plug ON?

Thanks.

 

 

Short answer is yes, you could do this by testing for running programs or by using a variable.

However, for specific assistance, I think it would be best if you pasted your existing programs here. To do this, right click on each program name and at the bottom of the pop up list select copy to clipboard. Then paste here in a reply.

After posting your programs tell us what you would like to have done.

Link to comment

Thanks Dennis. 

---------------------------------------------

Here is the Hot Water Heater program:

Hot Water Sink Kitchen - [ID 0012][Parent 0008]

If
        'Hot Water Sink / Hot Water Sink' Status is Off
 
Then
        Set 'Hot Water Sink / Hot Water Sink' On
 
Else
   - No Actions - (To add one, press 'Action')
----------------------------------------------------

Here is the Vacation Folder:

Vacation - [ID 000B][Parent 0001]

Folder Conditions for 'Vacation'

If
        From     6:27:00AM on 2023/02/26
        To       9:30:00PM on 2023/03/19
 
Then
   Allow the programs in this folder to run.
------------------------------------------------------

Here is the program within the Vacation Folder:

Hot Water Sink Off - [ID 001F][Parent 000B]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Set 'Hot Water Sink / Hot Water Sink' Off
 
Else
        Set 'Hot Water Sink / Hot Water Sink' Off
-------------------------------------------------------

Basically, I want the hot water to be on all of the time, but not when the vacation folder is active.

Thanks,

Mitchell

Link to comment

Is enabling the Vacation folder's date/time setting a manual operation? 

This could be automated using a button press or even UD Mobile - just something to consider.

Also, your date and time is done by adding a folder condition to enable the folder for a certain period. Just be aware, that folder conditions can sometimes be unreliable. Therefore, if your program fails to run or runs when it shouldn't, check your folder conditions.

Also, since the If portion of your Vacation folder doesn't contain an If statement, there is nothing to actually trigger your program to run. The folder condition just says ok, you are allowed to run, but you need an If statement to trigger run then or else. I hope that makes sense.

If you only have one program, the date/time could be in the If portion of the program and eliminate the folder condition.

There are several ways of doing this. Since you can enable/disable a program from a program (a disabled program will not run from the If statement, but can be run manually) my suggestion would be as follows.

I would suggest eliminating the folder condition. Use your Hot Water Sink program and then add another program as follows:

If: 

From     6:27:00AM on 2023/02/26
To       9:30:00PM on 2023/03/19

Then:

Disable program Hot Water Sink

Set 'Hot Water Sink / Hot Water Sink' Off

Else:

Enable program Hot Water Sink

You can add a turn on to your else statement, or just let your 1st program turn on by itself after being enabled.

 

Link to comment

I read the 2 comments.  Here is the clarification: the Vacation folder has several programs to turn lights on and off at certain times, and also turn off the whole house hot water recirculator.  Also, I set the vacation time manually.  I don't mind restructuring the system with a variable or whatever is most efficient.    It sounds like I can toggle the vacation folder with a variable. 

I went into the variable section, and created a variable, and it assigned it "$vacation".  Above, Jim recommended setting "ivariable".  What is the difference?  I read the Variable wiki, and it was not clear to me.  

I thought I would experiment with the Sink Hot Water first before tackling the Vacation folder of programs.

Therefore, I created a program that says: 

Vacation Now - [ID 0020][Parent 0001]

If
        From     1:45:00PM on 2023/05/28
        To       2:00:00PM on 2023/05/28
 
Then
        $Vacation  = 1
   
Else
        $Vacation  = 0
 

Then for the sink hot water, I set the program:

Hot Water Sink Kitchen - [ID 0012][Parent 0008]

If
        $Vacation is 1
 
Then
        Set 'Hot Water Sink / Hot Water Sink' Off
 
Else
        Set 'Hot Water Sink / Hot Water Sink' On

The problem was that once the vacation was set, after the time elapsed, it reset the Variable to 0, but did not turn the Hot Water Sink back to "ON".

Therefore, I modified the Vacation to:

Vacation Now - [ID 0020][Parent 0001]

If
        From     1:45:00PM on 2023/05/28
        To       2:00:00PM on 2023/05/28
 
Then
        $Vacation  = 1
        Set 'ISY' Query
 
Else
        $Vacation  = 0
        Set 'ISY' Query
I thought that would get the system to check itself, but it didn't.

Any thoughts?

Thanks, Mitchell


 

Link to comment
13 hours ago, mfbrin said:

I went into the variable section, and created a variable, and it assigned it "$vacation".  Above, Jim recommended setting "ivariable".  What is the difference?  I read the Variable wiki, and it was not clear to me.  

First, only a state variable will trigger a program, an integer variable will not trigger a program.

After time, when you start adding variables, it becomes difficult to remember what type of variable you are working with. This is important for troubleshooting. Therefore, best practice is to start an integer variable with a "i" and a state integer with an "s".

13 hours ago, mfbrin said:

Then for the sink hot water, I set the program:

Hot Water Sink Kitchen - [ID 0012][Parent 0008]

If
        $Vacation is 1
 
Then
        Set 'Hot Water Sink / Hot Water Sink' Off
 
Else
        Set 'Hot Water Sink / Hot Water Sink' On

The problem was that once the vacation was set, after the time elapsed, it reset the Variable to 0, but did not turn the Hot Water Sink back to "ON".

To insure the else section runs, add a trigger that makes the statement false when set to 0. In you original example, for the If portion try:

If

        $Vacation is 1

Or

$Vacation is Not 0

 

Link to comment
1 hour ago, DennisC said:

First, only a state variable will trigger a program, an integer variable will not trigger a program.

After time, when you start adding variables, it becomes difficult to remember what type of variable you are working with. This is important for troubleshooting. Therefore, best practice is to start an integer variable with a "i" and a state integer with an "s".

To insure the else section runs, add a trigger that makes the statement false when set to 0. In you original example, for the If portion try:

If

        $Vacation is 1

Or

$Vacation is Not 0

 

You may have missed his main query (Can we still say that?) . All variables get prefixed with an "$" by the system. It differentiates them from other elements such as programs and scene names.

  • Like 1
Link to comment

This is very helpful.  "only a state variable will trigger a program, an integer variable will not trigger a program.". For clarity: in my situation, I want to trigger a program...right? Therefore, I would want a State variable - is that correct?  Here is what I have in the Variable tab - how do I tell it what type of variable I am using.  I looked at the Wiki and didn't see it (https://wiki.universal-devices.com/index.php?title=ISY_Users:V5:Program_Variables#Integer_Variables)

image.thumb.png.2ed2e8e92dabbb6cb8cf31c3fd5a9fa5.png

Also, how often does the ISY poll the system to see if anything has changed?

One other minor point: the calendar format is yyy/mo/dd.  Is that changeable?  I looked in the Wiki and could not find anything on this.

Thanks.

Link to comment
1 hour ago, mfbrin said:

This is very helpful.  "only a state variable will trigger a program, an integer variable will not trigger a program.". For clarity: in my situation, I want to trigger a program...right? Therefore, I would want a State variable - is that correct?  Here is what I have in the Variable tab - how do I tell it what type of variable I am using.  I looked at the Wiki and didn't see it (https://wiki.universal-devices.com/index.php?title=ISY_Users:V5:Program_Variables#Integer_Variables)

image.thumb.png.2ed2e8e92dabbb6cb8cf31c3fd5a9fa5.png

 

Yes, you want a State variable to trigger a program.

You created an integer variable. Look at your screenshot, right above ID, it says Integer and that is the tab you are on. To the right of that is State tab. Click on the word State and then create your variable and update your programs to use the new variable. Another reason to use the naming conventions called out in my previous post.

1 hour ago, mfbrin said:

Also, how often does the ISY poll the system to see if anything has changed?

The ISY doesn't poll the systems. Programs run when they are triggered, either true which runs Then or false which runs Else.

1 hour ago, mfbrin said:

One other minor point: the calendar format is yyy/mo/dd.  Is that changeable?  I looked in the Wiki and could not find anything on this.

No, there is not.

  • Like 1
Link to comment

Keep in mind when you enable/disable folders, programs inside can get stopped dead in the middle of them and not finish their jobs. This could leave a device or program "in process".

The folder enable can make things easy but comes with some dangers. Usually this is not a problem. I tend to avoid using this technique due to it being so obscure and programs cannot be tested while inside a disabled folder. There is no indication of programs refusing to run manually so it can be very annoying.

The other method I try to use is to use a single variable say $sVacation that is used inside my vacation programs/routines like this.....

If
    whatever trigger
AND
    $sVacation is $cTRUE (permanently set to 1 and marked with a constant prefix)

Then
    ----

Edited by larryllix
Link to comment
  • 1 month later...
6 hours ago, mfbrin said:

I just re-read this.  I am not sure I understand the "cTrue".  Can you provide more information on the use of a constant?  Thanks.

$cTRUE is  an Integer variable assigned a value to indicate what True is in my system. To permanently assign a value to any variable you put the value in the left column of the variable and each time the system boots up the value get copied into the value of the variable. You never change it then it is permanently assigned. It can be any value you would like and usually assigned 1 or some non zero value. All programs that use it will understand, no matter what value you use. It is for convenience and clarity of program understanding mostly.

'$' is the prefix all variables get assigned by the ISY system
'c' is the prefix I have assigned to indicate is is a constant, I never change it
'TRUE'  is the name I have assigned to the variable indicating it's usage.      . . . .The caps also indicate it is a constant value, and a common method  used in many programming languages, to indicate it is a constant value.

Many programming languages have values like this permanently defined in the language.

$sVacation is 1 <--would have been equivalent, in my case,  but less clear what it's purpose is, to other readers.

Edited by larryllix
  • Like 1
Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...