Jump to content

I need a Boolean ISY brain to help with some programming please....


rchorowitz

Recommended Posts

I have been looking at this waaaaaaaaaaayyy too long and I should probably blow it up and start over.

I have tried so many options, but I cannot seem to get the logic correct.

Here is the scenario....

 

I have an automated dog door.

There are sensors on the dog’s collars that activate the door.

I have two sensors, one inside and one out.

 

The sensors are wired to a ZOOZ multirelay. ZEN16 (Z-Wave controller), that has 3 relays.

 

I have an KPL with three relevant buttons.

 

KPL.E= Lock-In

KPL.F=Lock-out

KPL.H=Both Locked

 

The concept is to be able control the dogs access locking them in the house or locking them out… They tend to run in front of cars but have been trained to run in the house when the driveway alarm goes off.

So, for example, when the alarm goes off, I want them “locked-in,” for 5-minutes but not “locked-out.”

 

In addition, I have several buttons throughout the house with “Both Locked” so I can see status or just provide two-way access the door.  Other keypads have all three options.

 

I had to create a program to turn the relay off, when the keypad button is on, to provide visual status of a locked condition.

I created three state variables lock-in, lock-out, both-locked.

The keypads all belong to scenes so that I can change the status of all the related buttons.

I have three programs, (total of 9) for each of the three conditions.

 

In Status Light

If

        $Dog_Door_Lock_In_Status is 1

 Then

        Set 'Dog Door / Dog Door Master Lock-In' On

 Else

        Set 'Dog Door / Dog Door Master Lock-In' Off

Lock In Control

If

        'Mudroom_Entry / DB.Dog Bath / DB.Dog Bath.E' Status is On

 Then

        Set 'Dog Door / ZW 015.1 On-Off Power Switch' Off

 Else

        Set 'Dog Door / ZW 015.1 On-Off Power Switch' On

 

Lock In Status

If

        'Dog Door / ZW 015.1 On-Off Power Switch' Status is Off

 Then

        $Dog_Door_Lock_In_Status  = 1

 Else

        $Dog_Door_Lock_In_Status  = 0

 

For the locked both I have:

 

Lock Both Status

If

        (

             $Dog_Door_Lock_In_Status is 1

         And $Dog_Door_Lock_Out_Status is 1

        )

     Or 'Mudroom_Entry / DB.Dog Bath / DB.Dog Bath.H' Status is On

 

Then

        $Dog_Door_Lock_Both_Status  = 1

 

Else

        $Dog_Door_Lock_Both_Status  = 0

 

Both Status Light

If

        $Dog_Door_Lock_Both_Status is 1

 Then

        Set 'Dog Door / Door Dog Master Control' On

 Else

        Set 'Dog Door / Door Dog Master Control' Off

 

Lock Both Manual Control

If

        'Mudroom_Entry / DB.Dog Bath / DB.Dog Bath.H' Status is Off

 

Then

        Set 'Dog Door / ZW 015.2 On-Off Power Switch' On

        Set 'Dog Door / ZW 015.1 On-Off Power Switch' On

 

Else

   - No Actions - (To add one, press 'Action')

 I have tried it many different ways and happy to start over with a better solution. 

 

If both lock-in and lock-out are on, and I hit the “both” button things enter a loop of turning on and off that required the programs to be stopped manually.

 

Ideas?

 

Thanks,

Rob

Link to comment

Without all the programs it's hard to trace, (you said you have 9 but I see 6).   The first thing to do tho, is not use status with your KPL buttons, instead use the "control" dropdown, and use OR in the same program for all equivalent keys on different keypads.

For example:

if

         'Mudroom_Entry / DB.Dog Bath / DB.Dog Bath.E'  is switched  On

      Or 'otherkeypad.E' is switched On

      Or 'anotherkeypad.E is switched On

then

---

that will probably clear up your race condition that occurs because Control means someone actually pushed the button, rather than the status that can also be triggered by scenes.   If you still have issues after that change, please repost with all programs included.

The easy way to post programs to the forum is to click on the program name, then right click and pick Copy to Clipboard, then in a forum post click the "<>"  in the toolbar which will bring up a popup window, then click in that window and type Ctrl-V.   Also if all the programs are conveniently grouped in a folder you can right click the folder and pick Copy Folder to Clipboard and post all with just one paste. 

Link to comment

Archived

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


×
×
  • Create New...