dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: April 11 2008 at 10:51 | IP Logged
|
|
|
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.
|