One-stop linking a KeypadLinc button to a plugin device

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Perry The Cynic
Posts: 857
Joined: Mon Apr 07, 2008 9:46 pm

One-stop linking a KeypadLinc button to a plugin device

Post by Perry The Cynic »

I need to make plugin devices turn on or off from a KeypadLinc button. Since Insteon knows nothing about plugin devices, I must write triggers:

button on -> device on
button off -> device off
device turns on -> turn button LED on
device turns off -> turn button LED off
(and some additional gunk for dimmers)

Is there anything that lets me do this without writing an exploding number of individual triggers? Something that lets me link "state of this device" to "state of this KeypadLinc button", in both directions, in one fell swoop?

Cheers
-- perry
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: One-stop linking a KeypadLinc button to a plugin device

Post by matt (support) »

There is no magic to make it easy, but you could subscribe to all device changes via indigo.devices.subscribeToChanges() then have your plugin monitor for when a particular KPL button changes its state value via deviceUpdated() callbacks, which you would then internally have mapped to whatever plugin action you need.
Image
Perry The Cynic
Posts: 857
Joined: Mon Apr 07, 2008 9:46 pm

Re: One-stop linking a KeypadLinc button to a plugin device

Post by Perry The Cynic »

There is no magic to make it easy, but you could subscribe to all device changes via indigo.devices.subscribeToChanges() then have your plugin monitor for when a particular KPL button changes its state value via deviceUpdated() callbacks, which you would then internally have mapped to whatever plugin action you need.
Yes, I could do that. I was sort of hoping that someone else had already written a nice plugin for this, actually... :-)

Cheers
-- perry
Dewster35
Posts: 1033
Joined: Tue Jul 06, 2010 6:29 pm
Location: Petoskey, MI

Re: One-stop linking a KeypadLinc button to a plugin device

Post by Dewster35 »

This is a major reason why I've got close to 600 triggers :/

It would be nice to be able to have the KPL button able to be assigned a separate device or sub device and simply have any change drive the main controller and vice versa...
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: One-stop linking a KeypadLinc button to a plugin device

Post by matt (support) »

600? Ouch. Yeah, there is definitely a need here for a better solution...
Image
Dewster35
Posts: 1033
Joined: Tue Jul 06, 2010 6:29 pm
Location: Petoskey, MI

Re: One-stop linking a KeypadLinc button to a plugin device

Post by Dewster35 »

Having an alarm kpl button and play/pause kpl button on every kpl linc in the house adds a lot. Not saying all the triggers are related to those, but a large handful is.
Perry The Cynic
Posts: 857
Joined: Mon Apr 07, 2008 9:46 pm

Re: One-stop linking a KeypadLinc button to a plugin device

Post by Perry The Cynic »

Having an alarm kpl button and play/pause kpl button on every kpl linc in the house adds a lot. Not saying all the triggers are related to those, but a large handful is.
If each KPL button was a distinct device, then Indigo's shiny new device groups feature could take care of "if any of these buttons is pressed, pause audio" and such. In general, device groups ought to be able to deal with "all of these do the same thing" kinds of situations, as long as "these" are devices.

I'm just saying... :-)

The only "big bang" solution I can see, is to add a programming-language level pattern matching facility. I might do that for myself eventually (right before my trigger army rises up to crush me :-)), but I don't see that being useful for beginners...

Cheers
-- perry
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: One-stop linking a KeypadLinc button to a plugin device

Post by jay (support) »

I'm hoping to have a solution for this by Indigo 6 GM but we're still in the process of defining what and when.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Dewster35
Posts: 1033
Joined: Tue Jul 06, 2010 6:29 pm
Location: Petoskey, MI

Re: One-stop linking a KeypadLinc button to a plugin device

Post by Dewster35 »

jay (support) wrote:I'm hoping to have a solution for this by Indigo 6 GM but we're still in the process of defining what and when.
Fully expecting the canned answer of wait and see here, but will this solution just work for KPL buttons and other switches, or could it also encompass variables and plugin states?
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: One-stop linking a KeypadLinc button to a plugin device

Post by jay (support) »

jay (support) wrote:we're still in the process of defining what and when.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: One-stop linking a KeypadLinc button to a plugin device

Post by kw123 »

along those lines,
with the 6 button version: depending on state of the button led it is brighter or dimmer (on/off)

I have tried to control the led brightness of each button, sometimes it changes with the set led brightness insteon action (both device options), sometimes not and there is no error message in the event log.

Can i just set them to one level, independent of the state?

In the device setup one can set the background brightness, but it seems to only set the average on/off-state led brightness level.


thanks

Karl
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: One-stop linking a KeypadLinc button to a plugin device

Post by kw123 »

just found a way:

on trigger button 3 on
do your action action
set button 3 off

the button will always be in off mode.

that also solves the the issue that one could get an off signal from the button. it only goes from off to on, never on to off.
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: One-stop linking a KeypadLinc button to a plugin device

Post by jay (support) »

You can change a button into non-toggle mode so that it only sends ON (or OFF), never the other, and the button will remain on (or off). Use Interfaces->INSTEON/X10 Power Line->Set KeypadLinc Button Toggle Mode. This is better because it will decrease the amount of INSTEON traffic.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: One-stop linking a KeypadLinc button to a plugin device

Post by kw123 »

there is still a lot of undiscovered land left .. :D

thanks
Perry The Cynic
Posts: 857
Joined: Mon Apr 07, 2008 9:46 pm

Re: One-stop linking a KeypadLinc button to a plugin device

Post by Perry The Cynic »

You can change a button into non-toggle mode so that it only sends ON (or OFF), never the other, and the button will remain on (or off). Use Interfaces->INSTEON/X10 Power Line->Set KeypadLinc Button Toggle Mode. This is better because it will decrease the amount of INSTEON traffic.
If we do that, will subscribeToChanges still see the button press? (Arguably it doesn't change the state of the KPL device anymore...)

Cheers
-- perry
Locked

Return to “Extending Indigo with Plugins and Python”