N-Button Automation: Conditional Control Relays

N-Button software allows you to create widgets to control relay boards.  You can not only simply turn relay on or off, but set up conditional rule to control relays.

Here will show you an example about how to set up conditional rule to control relays.

We will use the push button of push notification board to control relay board. Both of the push notification board and relay board are from National Control Devices. We already have a blog about how to control/toggle relays by push notification board.

N-Button Automation: Toggle Relay by Push Notification Board

We will add conditional rule to avoid Relay 1 and Relay 2 to be on at the same time. That is,

  • When Relay 1 is ON, Relay 2 can NOT be ON;
  • When Relay 2 is ON, Relay 1 can NOT be ON;

This might be happened when you use relay board to control two different doors or valves, if you don’t want them to be opened at the same time.

Step 1: Be sure you already installed N-Button software, connected push notification board and relay board to your computer.

Relay Board and Push Notification Board

Step 2: Run N-Button Lite or Pro, add push notification board and relay board to Device Manager.

N-Button software - Add Devices

Step 3: Add two Relay Buttons to toggle Relay 1 and Relay 2 separately.

N-Button software - Add Relay Button

You will see the Relay Button widgets on your desktop. Click the button with your mouse to turn on/off Relay 1 and Relay 2 separately. Green means the relay is ON. Red means the relay is OFF.

N-Button software -Relay Button Widget

Step 4: Add two Scan Channel widgets to indicate the status of Push Button 1 and Push Button 2.N-Button software -Add Scan Channel Widget

You will see the Scan Channel widgets on your desktop. Both of them show red. When you press one of the Push Button down it will turn green.

N-Button software - Scan Channel Widget

Step 5:  Add two simple Conditions for Relay 1 and Relay 2 separately. The initial status of conditions are Meet. The condition works as a mark for relay channel. The relay will be controlled as long as the condition is Meet.

N-Button software - Add Conditions

Step 6: Add two Actions List for both Push Buttons. Once the Push Button is pressed, the Actions on the list will be executed one by one.

N-Button software - Add Actions List

For Push Button 1, when the button is pressed there are 5 actions will be executed.

  • Lock Relay 2 : It is a Condition Action to set the Condition 2 (Mark for Relay 2) as Not Meet.
  • Turn Relay 1 On: It is a Relay Action to turn Relay 1 On.
  • Wait: It is a Wait Action. Input the time you want the Relay 1 keeping On.
  • Turn Relay 1 Off: It is a Relay Action to turn Relay 1 Off.
  • Unlock Relay 2 : It is a Condition Action to set the Condition 2 (Mark for Relay 2) as Meet.

In the same way, the 5 actions for Push Button 2 shown as below.

N-Button software - Actions List

    • Lock Relay 1 : It is a Condition Action to set the Condition 1 (Mark for Relay 1) as Not Meet.
    • Turn Relay 2 On: It is a Relay Action to turn Relay 2 On.
    • Wait: It is a Wait Action. Input the time you want the Relay 2 keeping On.
    • Turn Relay 2 Off: It is a Relay Action to turn Relay 2 Off.
    • Unlock Relay 1 : It is a Condition Action to set the Condition 1 (Mark for Relay 1) as Meet.

We have finished all settings. You will see 4 widgets on your desktop.

N-Button software - Widgets

When you press Push Button 1, you will see the Relay Button 1 and Scan Channel 1 turn green. Try to press push button 2 during 5 seconds after you press the Push Button 1, there is no action for Relay 2.

N-Button software - Widgets - Relay1 ON

After 5 seconds, Relay 1 is Off. Press the Push Button 2, you will see the Relay Button 2 and Scan Channel 2 turn green. Try to press Push Button 1 during 5 seconds after you press the Push Button 2, there is no action for Relay 1 also.

N-Button software - Widgets - Relay 2 ON

The video shows how it works.

Here we just set the Relay 1 and Relay 2 keeping On for 5 seconds, you can set the time you want.  With the condition rule, you have more ways to control relays with N-Button software.

See also:

N-Button Automation: Control Relay with Push Notification Board

N-Button Automation: Toggle Relay by Push Notification Board

N-Button Automation Control Device with Conditional Rule