Author |
|
mustangcoupe Super User
Joined: August 08 2003 Location: United States
Online Status: Offline Posts: 308
|
Posted: October 26 2004 at 19:52 | IP Logged
|
|
|
Hi Guys.... tried to post this past weekend and had server problems.. so this may be too short notice. I just dont know where to start with this.. I have PH and a x10 5-1 remote.. I want ph to "count" the on (+1) and offs (-1) of a A-5 signal. what I want to do is count the kids that come by for trick ot treat this weekend. anyone done this or give me some code to do it???
__________________ Todd Hannemann
HA newbie
PowerHome - UPB - ELK
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: October 26 2004 at 21:22 | IP Logged
|
|
|
You want to be able to subtract from the count, too?
Create a global variable called COUNT.
Add a trigger for X-10 RF In, A5, On as Formula...
ph_setglobal_a ( "COUNT", {COUNT} + 1 )
Add a trigger for X-10 RF In, A5, Off as Formula...
ph_setglobal_a ( "COUNT", {COUNT} - 1 )
Done deal! Let me know if you need more.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: October 27 2004 at 13:15 | IP Logged
|
|
|
Todd,
Tony has you covered. I had to think awhile about your request and Im still not sure what the difference is between the A5 on and A5 off but if you want to count them both, you'll need two global variables instead of one...say COUNTON and COUNTOFF. You can just modify Tony's sample above substituting COUNTON and COUNTOFF appropriately.
Also, be sure you pre-initialize your global variables with 0 so the counts work properly.
Dave.
|
Back to Top |
|
|
mustangcoupe Super User
Joined: August 08 2003 Location: United States
Online Status: Offline Posts: 308
|
Posted: October 28 2004 at 15:25 | IP Logged
|
|
|
I can just figure that I would "accidently press the button" or my wife will play with it... LOL
__________________ Todd Hannemann
HA newbie
PowerHome - UPB - ELK
|
Back to Top |
|
|
mustangcoupe Super User
Joined: August 08 2003 Location: United States
Online Status: Offline Posts: 308
|
Posted: October 28 2004 at 21:38 | IP Logged
|
|
|
works great! But can I program the formula to also speak TTS the value of count after it adds the value to it?
__________________ Todd Hannemann
HA newbie
PowerHome - UPB - ELK
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: October 29 2004 at 06:51 | IP Logged
|
|
|
Just add this to the end of the formulas...
[plus] ph_tts("{COUNT}")
Replace [plus] with an actual plus sign. How did I get it to show up in my last message?
|
Back to Top |
|
|
mustangcoupe Super User
Joined: August 08 2003 Location: United States
Online Status: Offline Posts: 308
|
Posted: October 29 2004 at 06:59 | IP Logged
|
|
|
maybe because it was not the first char in the line
__________________ Todd Hannemann
HA newbie
PowerHome - UPB - ELK
|
Back to Top |
|
|