Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Buttons Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jdh2424
Newbie
Newbie


Joined: October 29 2006
Online Status: Offline
Posts: 8
Posted: October 30 2006 at 22:56 | IP Logged Quote jdh2424

Is there a way to have it so a single button does on/off with insteon devices? I want to have a button when clicked down will change to a red button and the device will turn on. I then want to click that same button and it will turn blue and the device turns off. I am currently trying this on a 2856D.


Thanks
Jared
Back to Top View jdh2424's Profile Search for other posts by jdh2424
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: October 31 2006 at 10:12 | IP Logged Quote dhoward

Jared,

It can be done with some code. I plan on adding "Toggle Buttons" in a near future release which will do what you want.

In the meantime, the way to do this with code is follows:

I'll assume that you're using Insteon and the Insteon Device ID we're controlling is "YOURID". Furthermore, the Control Center tab that the button is on is "YOURTABID" and the ID of the button is "YOURCCID".

With the above assumptions, you'll want to create a "Text Button" with an "Action Type" of "Raw Formula". You would then put the following formula in the "ID" field:

Code:
if(ph_getinsteonstat("YOURID") = 2,ph_insteon("YOURID",ioff,0) + ph_setccobjbcolor("YOURTABID","YOURCCID",16711680),ph_insteo n("YOURID",ion,255) + ph_setccobjbcolor("YOURTABID","YOURCCID",255))


This should give the desired results.

HTH,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
jdh2424
Newbie
Newbie


Joined: October 29 2006
Online Status: Offline
Posts: 8
Posted: October 31 2006 at 19:59 | IP Logged Quote jdh2424

AWESOME

Is there a way to have it toggle between two images? One being a down image and one being an up image. IE a light bulb that it off/on


Thanks

Back to Top View jdh2424's Profile Search for other posts by jdh2424
 

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