Author |
|
brian Newbie
Joined: August 17 2007
Online Status: Offline Posts: 5
|
Posted: August 23 2007 at 03:04 | IP Logged
|
|
|
Hello again, i am stumped, and could use some help. I am using a X-10 motion sensor to trigger a macro which turns on an insteon controlled light, after three minutes the light turns off, ending the macro. My problem is that if someone sets off the macro but does not leave the room before the three minutes time out, they are left standing in the dark, and the wife is none to happy about my new system What i was thinking, that if someone enters the room and plans on staying longer than three minutes, flip the insteon light switch twice,triggering another macro and killing the light macro. Any help on how to do this,or any other ideas would be greatly appreciated! Thanks in advance. Brian
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: August 23 2007 at 07:42 | IP Logged
|
|
|
This is the holy grail of HA!
If you are using a WAIT for the three minutes, you can end the macro using a ph_killmacrowait("YOUR MACRO"). This would be triggered by a Fast On from your switch.
My solution to this, shown in another thread, was to try two motion sensors that get triggered sequentially as you enter or leave the room. Inbound increments the room counter and outbound decrements the counter. When the count is >0, the light comes on, and when it hits zero again, the light goes off. Works pretty well.
Edited by TonyNo - August 23 2007 at 07:45
|
Back to Top |
|
|
brian Newbie
Joined: August 17 2007
Online Status: Offline Posts: 5
|
Posted: August 24 2007 at 00:19 | IP Logged
|
|
|
Hi, thanks for the quick response, but i am having trouble with the command working. I am using a trigger
Action type: raw formula
Action: ph_killmacrowait("my macro")
Trigger type: Insteon device chg
Trigger ID: my switch
Trigger ID number: 1
Trigger value: 1
Boolean: 1
I can see the trigger check status coming on in the power home status screen but it does not kill my macro.
the macro that i am trying to kill is
10 jump if(ph_getinsteonlevel("hall bath")=255,999,1)20 jump if( hour( now()) > 23 or now()< ph_getsuntime( today(), 3) , 1, 999)
30 insteon "my device" fast on
40 wait 80
50 insteon &nb sp;"my device" fast off
any ideas what i am doing wrong? Thanks again
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: August 24 2007 at 06:18 | IP Logged
|
|
|
Try a Trigger ID number of (Any).
If that does not work, change the trigger formula to this for testing...
Code:
if( ph_ismacrowaiting( "YOUR MACRO")=0, ph_usermessage("Not waiting!"), ph_killmacrowait("YOUR MACRO")) |
|
|
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: September 02 2007 at 20:35 | IP Logged
|
|
|
Brian,
Since you're trying to trigger off of a Insteon "Fast On", you may want to change the trigger to a Insteon Group In trigger rather than a Insteon Device Chg trigger.
However, that doesnt mean your trigger wont work. You may want to temporarily change the trigger action type to a macro and place the ph_killmacrowait function within the macro. That way, you should be able to see in the log that the macro was actually executed.
Another thing you may want to do is look at the ph_extendmacrowait function. If a person is moving around in the room and constantly tripping the motion sensor, then you can just extend the wait time of the macro by another 3 minutes. Sometimes this isnt viable however and you'll need to use an approach like you're doing now. Or you can look into trying sense occupancy like Tony suggests. Ive been wanting to setup something similar to Tony's example using a couple of lightbeam sensors side by side (I think Tony was even working on this ). This would be the ultimate in room occupancy.
Let us know how it goes,
Dave.
|
Back to Top |
|
|
|
|