Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Query KPL LED status? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
judetf
Senior Member
Senior Member


Joined: January 23 2008
Online Status: Offline
Posts: 234
Posted: April 10 2008 at 09:21 | IP Logged Quote judetf

Is there a way to query the status (on or off) of a KPL button/LED (other than the load)?
Back to Top View judetf's Profile Search for other posts by judetf
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 11 2008 at 10:51 | IP Logged Quote dhoward

Unfortunately, no. Not unless there is some new hidden memory location in the latest firmware KPL's.

There is a memory location in the older firmware KPL's that is *supposed* to reflect the status of the LED's. However, it is unreadable so of no use to us. It also needs to be retrieved using a memory peek function.

Dohhh!!! Hold that thought. I figured I would review the most current Insteon command table documentation before I submitted this post and apparently new information is available. There is an Insteon command that returns the status of the LED's and it looks like it works on older firmware KPL's as well.

Try this:

ph_insteonwithret("YOUR KPL ID",25,1)

The value that it returns will be a bit mask reflecting the status of the LED's. 8 bits to a byte, a 1 is LED on, a 0 is LED off. Button 1 is the most significant (leftmost bit) all the way to button 8. Use the ph_and function to test individual bits.

So, to check if LED 5 is on or off, use this formula:

ph_and(2 ^ (5 - 1),ph_insteonwithret("YOUR KPL ID",25,1))

A 0 means off, a nonzero means on.

Hope this helps,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
judetf
Senior Member
Senior Member


Joined: January 23 2008
Online Status: Offline
Posts: 234
Posted: April 11 2008 at 12:37 | IP Logged Quote judetf

Wow, super cool! That's great, it works perfectly, and thanks!
jtf
Back to Top View judetf's Profile Search for other posts by judetf
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum