Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Conditional on or off command Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: June 21 2006 at 18:25 | IP Logged Quote Manny

I am very sure this has been covered but for some reason I'm not hitting the right key words in my searches.

lamp = A1

I'd like to send one x10 command to either turn on the lamp if it's currently off, or turn off the lamp if it's currently on. This way I do not have to have 2 seperate buttons on my limited pda real estate.

BTW the Palm program I'm goofing around with is called Shortcutter. Using Bluetooth (no wifi on my palm)it can use the PH SocketServer to talk to PH. This is a lot faster than the webpage method for these old PDAs.

If I get this going I can keep a couple of old PDA's from collecting dust.
Back to Top View Manny's Profile Search for other posts by Manny
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: June 21 2006 at 19:40 | IP Logged Quote TonyNo

Use...

if( ph_getx10stat( "LAMP" )=0, 0, ph_x10btn( "LAMP", case( ph_getx10stat( "LAMP" ) when 2 then 3 when 1 then 2), 0 ))

This Shortcutter?
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: June 21 2006 at 20:00 | IP Logged Quote Manny

Tony,
Never hesitate to "dumb" things down for me. Er, I mean the newbies may need a bit more detail.

Seriously, I will not be offended with "Step 1: Place hand on mouse"

Where/ how do I use the if statement?

Plus, yes that's the pda program. I forgot that it may be useful for you hoity-toity PocketPC types as well.

Edited by Manny - June 21 2006 at 20:00
Back to Top View Manny's Profile Search for other posts by Manny
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: June 21 2006 at 20:12 | IP Logged Quote TonyNo

That is just a formula that you could put in a trigger, a macro, a web-based URL, etc.

If using PHSSCMD.exe you would run this for the toggle button...

"D:\Program Files\PHSSCMD\phsscmd.exe" if( ph_getx10stat( "LAMP" )=0, 0, ph_x10btn( "LAMP", case( ph_getx10stat( "LAMP" ) when 2 then 3 when 1 then 2), 0 ))

Let me know if you need more!
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
Manny
Senior Member
Senior Member
Avatar

Joined: March 23 2003
Location: United States
Online Status: Offline
Posts: 172
Posted: June 21 2006 at 21:41 | IP Logged Quote Manny

Once again, thank you. I'll try it once I get home.

I had no clue that you could start a formula with "if".

I'm sure my eyes just glazed over any similar examples.

I thought you were giving me a snippet of something that required a script with variables, etc...

All my formulas have been of the "ph_do-something" variety.

This is just by using Alt-F12 as a guide.

Anyway, you just gave me one of those "oh" moments when I finally "get" something.

Hope this helps others...I can't be dumbest in the class...again.
Back to Top View Manny's Profile Search for other posts by Manny
 

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