Jump to content

KPL multiple programs on one button


AgentAR9

Recommended Posts

I have some KPL buttons set up to light up if a window or door is open using Insteon open/close sensors.  The button lights up when it is open and goes off whenever it is closed.  It's basically just a notification.  I have also experimented with using one of the same buttons to activate/deactivate a scene, totally independent of the open/close sensor.  Kind of like giving the same button two separate functions.

 

My question is, is there a way to not have the led function when pressing the button to activate/deactivate the scene, but have the led function for the open/close sensor notification?

 

The dual function set up works fine except that when I press the button to activate the scene, the led is on even if the open/close sensor is closed.

 

Thanks

Link to comment

A couple of ways.

Create a scene "Kpl button" and add the Kpl button to the scene as a responder only.

Write a program:

If control Kpl button is on

Then wait 2seconds

Set scene "Kpl button" off.

 

The purpose of the wait is to allow traffic from the Kpl button to clear.

 

Or

You can set the button to non toggle off mode. Although depending upon your keypad, this may not work.

Write a program:

If control Kpl button is off.

Then do whatever you want the button to do. (Set a scene on or off)

 

If the non toggle off is working properly then when you press it it should flash then turn off on its own.

Link to comment

I had written a post, that didn't post.

One more thought. If the button is on to show the sensor status and you press the button to do what you want, then the button will turn off an not reflect the status of the sensor. If the button is already off then no problem.

I am having trouble writing a program for this given that the sensor is a battery device. I think this could easily be done with a state variable for the sensor.

Link to comment

I had written a post, that didn't post.

One more thought. If the button is on to show the sensor status and you press the button to do what you want, then the button will turn off an not reflect the status of the sensor. If the button is already off then no problem.

I am having trouble writing a program for this given that the sensor is a battery device. I think this could easily be done with a state variable for the sensor.

 

EricK-

 

I see 2 programs for this using an integer rather than state variable:

If 
   Control 'Door Sensor' is Switched On
   Or Control 'Door Sensor' is Not Switched Off

Then
   $i.DoorSensor = 1

Else
   $i.DoorSensor = 0



If 
  (
   Control 'KPL_Button' is switched On
   or Control 'KPL_Button' is switched Off
   )
   And $i.DoorSensor = 1

Then
   Wait 2 seconds
   Set Scene 'KPL_Button' On

Else
   Wait 2 Seconds
   Set Scene 'KPL_Button' Off

-Xathros

Link to comment

Xathros,

 

If I understand the above correctly, does this mean that no matter if a person presses the button, its light will always follow the sensor's state?

 

Thanks!

Exactly

 

What that does is any time the button is pushed, it checks the sensor state (variable value) and sets the button LED accordingly.  Sensor on, LED on, sensor off, LED off.  The program is triggers when the button is turned on or off and uses the value of the integer variable to decide the LED state.  The variable is managed by the first program.

 

NOTE: The variable in this case is an integer variable AND the button LED is also responder in a scene controlled by the sensor.

 

Make sense?

 

-Xathros

Link to comment

Xathros,

 

I implemented your code above and it works perfectly. I will be using it for monitoring my garage door status, which seems to be what a lot of people here do.

 

I'd like to assign two separate KPL button LEDs for the status -- one open and one for closed, so that I can tell at a glance what the position of the door is. I know this can simply be inferred from one light being on or off, but I'd prefer having two indicators if at all possible. I also am only using the system to monitor the status, and not wiring the I/O Linc relay to the opener at all.

 

I tried to extend the programs you listed above by creating a new scene for when the door is closed, but I discovered that I can't add a controller to more than 1 scene.

 

I also tried writing a new program to directly control another KPL button, but that didn't seem to work.

 

Do you have any thoughts on how to implement what I'm trying to do?

 

I prefer a method which uses logic that looks at the input contact status to then turn the light on or off, but is it possible to program the KPL itself so that a given pair of button lights would "flip flop" when one was triggered on/off?

 

Thanks!

Link to comment

Can a scene have just a responder, with nothing else?

Yep.  Sure can.

 

Here is how I would do this: (LeeG started down this road above)

 

2 Scenes: GarageOpen and GarageClosed.

 

GarageOpen has 2 KPL Buttons (G & H) as responders only.

Button H has it's OnLevel set to 0%

Button G has It's OnLevel Set to 100%

 

GarageClosed has 2 KPL Buttons (G & H) as responders only.

Button H has it's OnLevel set to 100%

Button G has It's OnLevel Set to 0%

 

Then a program to deal with them:

If 
   Status 'GarageDoor IOLinc Sensor' is On

Then
   Set Scene 'GarageOpen' On

Else
   Set Scene 'GarageClosed' On

Depending on the type of mag switch used, you may need to swap the contents of Then and Else above. Or swap your definition of G & H ):

 

Added value here: You can use the True/False value of the above program in other programs that may need to know the status of the garage door.

 

Hope that works for you.

 

-Xathros

Link to comment

Archived

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


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...