Jump to content

help with a program for my dog :)


jon102034050

Recommended Posts

Posted

I'm having some issues moving my rules from HomeSeer to ISY.  Here's the basic gist of the rule i had in HS: open deck door at night, turn on deck lights for 10 minutes OR until the off switch is pressed.  For whatever reason, i simply cannot get this rule to translate over to my ISY....   FWIW, I'm using ISY 5.0.11c with the Elk module and an HS-WS100+ for a switch.  Any assistance is greatly appreciated!  Here are the 2 events in HS that I use to accomplish this

Screen Shot 2018-02-25 at 8.38.17 PM.png

Posted
I'm having some issues moving my rules from HomeSeer to ISY.  Here's the basic gist of the rule i had in HS: open deck door at night, turn on deck lights for 10 minutes OR until the off switch is pressed.  For whatever reason, i simply cannot get this rule to translate over to my ISY....   FWIW, I'm using ISY 5.0.11c with the Elk module and an HS-WS100+ for a switch.  Any assistance is greatly appreciated!  Here are the 2 events in HS that I use to accomplish this
5a93735cc9a3d_ScreenShot2018-02-25at8_38_17PM.thumb.png.e67b1716891c8bf0562f648e701d8ba8.png


What’s your ISY program look like? Right click on the program and copy to clipboard and paste here.

Are you using “ELSE”? Also you need to use “Elk” in the program drop downs and when “X zone is violated”.
Posted

Derp.... That would probably help.  Tbh though, it's kinda starting from scratch because it doesn't really work at all yet.  I think I maybe need to use 2 programs....

If
        Elk Zone 'Deck Door' is Violated
    And $dog_outside is 0
    And From    Sunset 
        To      Sunrise (next day)
 
Then
        $dog_timer Init To 0
        Set 'ZW 003 Multilevel Switch' On
        Repeat While $dog_timer >= 600
           $dog_timer += 1
           Wait  1 second
        Repeat 1 times
           Set 'ZW 003 Multilevel Switch' Off
           $dog_timer  = 0
 
Else
   - No Actions - (To add one, press 'Action')


 

Posted
5 minutes ago, jon102034050 said:

Derp.... That would probably help.  Tbh though, it's kinda starting from scratch because it doesn't really work at all yet.  I think I maybe need to use 2 programs....


If
        Elk Zone 'Deck Door' is Violated
    And $dog_outside is 0
    And From    Sunset 
        To      Sunrise (next day)
 
Then
        $dog_timer Init To 0
        Set 'ZW 003 Multilevel Switch' On
        Repeat While $dog_timer >= 600
           $dog_timer += 1
           Wait  1 second
        Repeat 1 times
           Set 'ZW 003 Multilevel Switch' Off
           $dog_timer  = 0
 
Else
   - No Actions - (To add one, press 'Action')

 

I am sorry I do not have any ZWave devices or switches but try this...

 

If Elk Zone 'Deck Door' is Violated    

And Set 'ZW 003 Multilevel Switch' Off

And From    Sunset         

To      Sunrise (next day)  

Then       

Set 'ZW 003 Multilevel Switch' On        

Wait 10 minutes                      

Else

Set 'ZW 003 Multilevel Switch' Off (If the above conditions are not met then the light is off)

 

FWIW "repeat" line goes at the top and repeats everything under the command. If you need repeats you should be looking at your network closer too as they really shouldnt be needed. You dont need to use variables for this either its just complicating things.

Also you can make a new "FOLDER" and call it Sunset to Sunrise and make an IF statement on it to run just those programs inside it during that timeframe.

Sunset to Sunrise

Folder Conditions for 'Sunset to Sunrise'

If
        From    Sunset
        To      Sunrise (Next Day)
 
Then
   Allow the programs in this folder to run.
 

I am not 100% perfect on programs and still need help time to time myself, but this should hopefully get you going.

Posted

Hm, maybe I'm missing something here, but this isn't working at all.  The light doesn't turn on at all - thoughts?

If
        Elk Zone 'Deck Door' is Violated
    And 'ZW 003 Multilevel Switch' is switched Off
    And From    Sunset 
        To      Sunrise (next day)
 
Then
        Set 'ZW 003 Multilevel Switch' On
        Wait  10 minutes 
 
Else
        Set 'ZW 003 Multilevel Switch' Off

 

Posted
Hm, maybe I'm missing something here, but this isn't working at all.  The light doesn't turn on at all - thoughts?

If       Elk Zone 'Deck Door' is Violated   And 'ZW 003 Multilevel Switch' is switched Off   And From    Sunset        To      Sunrise (next day)Then       Set 'ZW 003 Multilevel Switch' On       Wait  10 minutes Else       Set 'ZW 003 Multilevel Switch' Off

 

 

 

Take out the sunset and sunrise for now and test. Does that work? Try just a simple program. Also your Elk module is indeed working? You have imported all the zones? When you open the door does the zone show violated in the ISY?

 

Edit: also make sure your time is set properly on the ISY, your location too and it shows the correct sunrise/sunset in the top bar.

Posted

A very basic test it to right click on the program and select Run Then. Does the device turn on? Does Run Else turn off the device?

Posted
7 minutes ago, Scottmichaelj said:

 

Take out the sunset and sunrise for now and test. Does that work? Try just a simple program. Also your Elk module is indeed working? You have imported all the zones? When you open the door does the zone show violated in the ISY?

 

Edit: also make sure your time is set properly on the ISY, your location too and it shows the correct sunrise/sunset in the top bar.

Hm, sunset - sunrise works just fine, it's the 'switch off' that is messing with this.  When I pull the 'switch off' out in the 'if', the light turns on when the door opens, and turns off when it closes.  Obviously, this isn't the functionality I am looking for.  Here's what it looks like:

If
        Elk Zone 'Deck Door' is Violated
    And From    Sunset 
        To      Sunrise (next day)
 
Then
        Set 'ZW 003 Multilevel Switch' On
        Wait  20 seconds
 
Else
        Set 'ZW 003 Multilevel Switch' Off

 

2 minutes ago, stusviews said:

A very basic test it to right click on the program and select Run Then. Does the device turn on? Does Run Else turn off the device?

Run Then and Run Else works to turn on and off the light.

Posted
A very basic test it to right click on the program and select Run Then. Does the device turn on? Does Run Else turn off the device?

 

Could ZWave not be reporting status properly? I don’t have ZWave so I am unsure.

 

Edit: IE it’s showing the switch on&off in the admin console right?

Posted (edited)

The only effect of your wait statement is to wait 20 seconds after the device turns on and then end the program. It will not do anything else. It will not run the Else statements at all. What is your reason for having a Wait?

Edited by stusviews
Posted

The purpose of the wait (shortened to 20 seconds for testing, would be 10 minutes when in place for real) is to keep the light on for 10 minutes while the dog is out.  After that, turn it off.  Again, here is what I want to achieve: Door is opened at night - turn on deck lights for 10 minutes OR until the off switch is pressed.

Posted
The only effect of your wait statement is to wait 20 seconds after the device turns on and then end the program. It will not do anything else. It will not run the Else statements at all. What is your reason for having a Wait?

 

Sorry good catch. That was supposed to be his 10min wait for the dog to go out. Typo ??‍♂️

 

Edit: My OCD would make the time first then the door violated for the IF portion. ?

 

Posted
44 minutes ago, jon102034050 said:

Hm, sunset - sunrise works just fine, it's the 'switch off' that is messing with this.  When I pull the 'switch off' out in the 'if', the light turns on when the door opens, and turns off when it closes.  Obviously, this isn't the functionality I am looking for.  Here's what it looks like:

I haven't used V5 yet, but in V4 you choose CONTROL or STATUS for switches.  CONTROL means the physical act of the being switched OFF or ON.  STATUS means the current state of the switch.  It looks like you have used CONTROL so it will only be true at the instant someone turns the switch OFF.  I think you want to use STATUS which will be true any time the switch is in an OFF state.

Also, in an earlier program you were using a variable.  Have you read about the difference between STATE and INTEGER variables.  Which type you choose can have a huge impact on how your IF functions.

Posted

Well nix that.  You're changing the state of the switch in the program so that would cause the IF to reevaluate immediately and the run the ELSE.  But still I don't understand what you're trying to accomplish with evaluating whether the switch is switched OFF.

Posted (edited)

Just reread you opening paragraph.  What if you changed to something like "And NOT 'ZW 003 Multilevel Switch' is switched Off"?  That should evaluate as TRUE all the time except when the switch is actually turned off, at which time the WAIT 10 MINUTES should be broken, the IF reevaluated and then the ELSE executed.

But you'd still need to add "Set 'ZW 003 Multilevel Switch' Off" after the WAIT because when the time limit of the WAIT expires the programs just stops, it doesn't automatically execute the ELSE.

Edited by kclenden
Posted

 

9 minutes ago, kclenden said:

I haven't used V5 yet, but in V4 you choose CONTROL or STATUS for switches.  CONTROL means the physical act of the being switched OFF or ON.  STATUS means the current state of the switch.  It looks like you have used CONTROL so it will only be true at the instant someone turns the switch OFF.  I think you want to use STATUS which will be true any time the switch is in an OFF state.

Also, in an earlier program you were using a variable.  Have you read about the difference between STATE and INTEGER variables.  Which type you choose can have a huge impact on how your IF functions.

^ this helps me quite a bit....  I was struggling to understand the diff between control and status. 

5 minutes ago, kclenden said:

Well nix that.  You're changing the state of the switch in the program so that would cause the IF to reevaluate immediately and the run the ELSE.  But still I don't understand what you're trying to accomplish with evaluating whether the switch is switched OFF.

Let me just reiterate this: I am a complete noob when it comes to programming the ISY, please don't take my rules to mean anything.... lol.  Here is my goal: Door is opened at night - turn on deck lights for 10 minutes OR until the off switch is pressed.  If the switch isn't pressed (off), then the lights will just go off as planned in 10 minutes from original opening.  Please feel free to re-write the rule completely if you think it can be achieved in a different way.

Posted
5 minutes ago, kclenden said:

Just reread you opening paragraph.  What if you changed to something like "And NOT 'ZW 003 Multilevel Switch' is switched Off"?  That should evaluate as TRUE all the time except when the switch is actually turned off, at which time the WAIT 10 MINUTES should be broken, the IF reevaluated and then the ELSE executed.

I'm not sure I totally follow, but I can test things out tomorrow AM though.  I'll report back then.

Posted

The purpose of a Wait is to execute the statements that follow the Wait after the designated interval. You have absolutely no statements following the Wait command, so nothing will execute after interval, not the Else, not anything.

In this program, Off is executed after waiting 2 seconds:

If

        Status  'GG / Garage1 Control / GG1 ZW028 Binary Switch' is Off
 
Then
        Set 'GG / Garage1 Control / GG1 ZW028 Binary Switch' On
        Wait  2 seconds
        Set 'GG / Garage1 Control / GG1 ZW028 Binary Switch' Off
 
Else
   - No Actions - (To add one, press 'Action')
 

Posted
7 hours ago, jon102034050 said:

Hm, sunset - sunrise works just fine, it's the 'switch off' that is messing with this.  When I pull the 'switch off' out in the 'if', the light turns on when the door opens, and turns off when it closes.  Obviously, this isn't the functionality I am looking for.  Here's what it looks like:


If
        Elk Zone 'Deck Door' is Violated
    And From    Sunset 
        To      Sunrise (next day)
 
Then
        Set 'ZW 003 Multilevel Switch' On
        Wait  20 seconds
 
Else
        Set 'ZW 003 Multilevel Switch' Off

jon102034050,

I don't find it easy trying to follow this conversation, but I believe this is your latest program (above), correct?  As some have pointed out, you need to move the OFF command to immediately follow the wait command.  I also believe you have a potential problem that closing the door (Elk Zone 'deck door') would end the "violated" state and interrupt the wait statement.  Unfortunately, I don't use the Elk system so I do not know if there is a zone trigger similar to a "control" statement for insteon devices.  Assuming not, you will need to separate this program into two:

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

if

elk zone 'deck door' is violated

and from sunset to sunrise (next day)

then

run next program (then path)

else

nothing

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

next program:

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

if

nothing

then

Set 'ZW 003 Multilevel Switch' On

Wait  20 seconds

Set 'ZW 003 Multilevel Switch' Off

else

nothing

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

 

Posted
6 hours ago, stusviews said:

The purpose of a Wait is to execute the statements that follow the Wait after the designated interval. You have absolutely no statements following the Wait command, so nothing will execute after interval, not the Else, not anything.

In this program, Off is executed after waiting 2 seconds:

If

        Status  'GG / Garage1 Control / GG1 ZW028 Binary Switch' is Off
 
Then
        Set 'GG / Garage1 Control / GG1 ZW028 Binary Switch' On
        Wait  2 seconds
        Set 'GG / Garage1 Control / GG1 ZW028 Binary Switch' Off
 
Else
   - No Actions - (To add one, press 'Action')
 

stusview,

are you not concerned that the first statement in the THEN path would retrigger the program, interrupting the wait statement?

Posted
51 minutes ago, oberkc said:

jon102034050,

I don't find it easy trying to follow this conversation, but I believe this is your latest program (above), correct?  As some have pointed out, you need to move the OFF command to immediately follow the wait command.  I also believe you have a potential problem that closing the door (Elk Zone 'deck door') would end the "violated" state and interrupt the wait statement.  Unfortunately, I don't use the Elk system so I do not know if there is a zone trigger similar to a "control" statement for insteon devices.  Assuming not, you will need to separate this program into two:

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

if

elk zone 'deck door' is violated

and from sunset to sunrise (next day)

then

run next program (then path)

else

nothing

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

next program:

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

if

nothing

then

Set 'ZW 003 Multilevel Switch' On

Wait  20 seconds

Set 'ZW 003 Multilevel Switch' Off

else

nothing

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

This is the closest that I've come to getting this to work.  When the door opens, the light turns on, and when the door closes, it doesn't turn off anymore.  However, it doesn't take into account if I want to cancel the wait early by pressing the switch manually, which should turn off the lights and cancel the wait.  Here's what it looks like:

Deck 1 - [ID 0008][Parent 0004]
If
        Elk Zone 'Deck Door' is Violated
Then
        Run Program 'Deck 2' (Then Path)
Else
   - No Actions - (To add one, press 'Action')
 

Deck 2 - [ID 0009][Parent 0004][Not Enabled]
If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
Then
        Set 'ZW 003 Multilevel Switch' On
        Wait  20 seconds
        Set 'ZW 003 Multilevel Switch' Off
Else
   - No Actions - (To add one, press 'Action')

 

Posted
7 hours ago, jon102034050 said:

However, it doesn't take into account if I want to cancel the wait early by pressing the switch manually, which should turn off the lights and cancel the wait. 

So, is not the light wired to the "zw 003 multilevel switch"?  Does not turning that switch off also turn the light off?

Posted
9 hours ago, oberkc said:

stusview,

are you not concerned that the first statement in the THEN path would retrigger the program, interrupting the wait statement?

Ha ha. You are absolutely correct. The reason I'm not concerned is because there's an error in the program. It should be:

If
        Status  'GG / Garage2 Control / GG2 ZW028 Binary Sensor' is Off
 
Then
        Set 'GG / Garage1 Control / GG1 ZW028 Binary Switch' On
        Wait  2 seconds
        Set 'GG / Garage1 Control / GG1 ZW028 Binary Switch' Off
 
Else
   - No Actions - (To add one, press 'Action')

Now corrected. Thanks bunches for catching that.

Posted
3 hours ago, oberkc said:

So, is not the light wired to the "zw 003 multilevel switch"?  Does not turning that switch off also turn the light off?

Sorry, I should have been more clear:  yes, it is wired to the switch, so physically pressing the switch off does turn the switch off, but it doesnt cancel the running event.  Take the following scenario: walk outside at 22:00:00.  Light turns on with a timer of 10 minutes before its scheduled shutdown.  Dog drops a load and is back in in 2 minutes.  I walk in and press the switch off at 22:02:30.  Dog forgets that it needs to go number 1 and asks to go back outside at 22:09:45.  I walk outside and the light proceeds to turn on again for us, but, is the original run of the 10 minute timer still going?  Or, in other words, is the light going to turn off on us 15 seconds after we go out the second time?

Guest
This topic is now closed to further replies.

×
×
  • Create New...