Dlucas10 wrote:I have a fanlinc, and wrote pgm to update the KPL based on what state it's in. So, if I press a button I don't want it to run but if I use my phone to set the fan, then I want it to update the KPL. I was using triggers to do this, but it's easier to do python if I can figure this little thing out.
I do something quite similar in my setup. I have a number of KPL's around the house and toggle their lit button state depending on other stuff that happens. In the case of this example I have other KPL's that need to have their buttons lit up or darkened based on what happened on another KPL or device.
While not identical to yours, my setup is like this;
- I have a trigger that listens for ANY Insteon command from the device in question (i.e., your Fanlinc)
- The action is a script to determine the status of that device and then turn on/off the KPL buttons as needed
So:
- Screen Shot 2016-07-28 at 8.55.55 PM.png (43.24 KiB) Viewed 1471 times
Does this (still in old Applescript, I've not gotten around to changing the stuff that works yet - tells you how long I've been running THIS trigger
):
- Code: Select all
if ((on state of device "Greatroom Sectional")) then
send insteon group instnTurnOn using name "Master BR KPL LED 4"
else
send insteon group instnTurnOff using name "Master BR KPL LED 4"
end if
It would be a simple matter to translate that into Python code. If this sounds like it's close to what you are trying to achieve I could probably fix it up for Python for you. Now this also required that I defined my KPL buttons properly in "Manage Insteon PowerLinc Links" under the Interfaces->Insteon menu:
- Screen Shot 2016-07-28 at 9.01.38 PM.png (43.13 KiB) Viewed 1471 times
But's that may not be as important now that Python has some built in functions to toggle KPL buttons.