Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Sending X10 command from a GV Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: November 23 2005 at 09:00 | IP Logged Quote krommetje

Hi all,

I am extending my firealarm with a memoryfunction: when an alarm is given, PH stores the last state of my Front and rear doorshutter in a GV ....

here is the code I came up with:

Code:
ph_setglobal_a("K4STATE",[X10STATK4])


when the shutter is down, the state is off, in which I have to change the GV to 3 and here is the code for that:

Code:
case( [X10STATK4] when 1 then ph_setglobal_a("K4STATE",3))


When the shutter is up then the state is on and the GV remains 2

so after an all-safe is given I want to send an X10 command to the shutter and return to it's last state before the firealarm and here is that code too:

Code:

ph_x10btn ("K",4,ph_getglobal_n("{K4STATE}"),0)


but here is the fault: no matter what value is stored in the GV, always a ALL UNITS OFF command is sent...

what am I not seeing here?

Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 23 2005 at 15:52 | IP Logged Quote dhoward

Peter,

You mixed a variable substitution form of a global variable (enclosed within {}) with the ph_getglobal_n function. So, you would either:

ph_x10btn("K",4,{K4STATE},0)

or,

ph_x10btn("K",4,ph_getglobal_n("K4STATE"),0)

Hope this helps,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: November 24 2005 at 03:53 | IP Logged Quote krommetje

OH MAN.....

I aint never gonna get this GV stuff into my thick head....

Am I lost forever????

btw. works like a charm now!!!

Peter



btw: have you seen my post(s) in General in thread uptime?

Edited by krommetje
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 

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