Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: 2420M commands Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
wasdvd
Groupie
Groupie


Joined: February 13 2007
Location: United States
Online Status: Offline
Posts: 42
Posted: May 13 2009 at 23:14 | IP Logged Quote wasdvd

I am trying to use a 2420M motion detector as an occupancy sensor.

On motion, or lack of motion for one minute, the 2420M sends a command. If there is continuous motion, the 2420M seems to not send any commands after the initial ON.

So, I am trying to find a way to tell the difference between the ON command and the command sent after 1 minute of no motion.

In the PH Insteon raw log, the command sent on beginning of motion is

RECEIVEINSTEONRAW=02 11 9F 86 0D 55 58 4B 13 01

In the PH Insteon raw log, the command sent after 1 minute of no motion is

RECEIVEINSTEONRAW=02 11 9F 86 0D 55 58 4B 11 01

Can someone who knows what they are doing (not me) give me an example of how I can use a PH formula to detect the difference between the 13 and the 11 in the two commands?

Many thanks.
PH 2.1b
Back to Top View wasdvd's Profile Search for other posts by wasdvd
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: May 14 2009 at 00:13 | IP Logged Quote grif091

I believe it is the design point of the Smarthome Motion Senor that once it detects motion and sends an Insteon ON command for Group 1, for as long as motion is detected within the one minute timeout, it will not send the Insteon OFF command until the one minute timer has run without any motion being detected.

I believe you have attributed the wrong commands for motion and no motion. The first command which you attribute to beginning of motion detected…

RECEIVEINSTEONRAW=02 11 9F 86 0D 55 58 4B 13 01

is the command that is issued after the one minute timer has run and motion is not detected. The above command is an Insteon OFF (0x13) for Group 1 (0x01) which the motion sensor issues when motion is no longer being sensed.

The second command in the post…

RECEIVEINSTEONRAW=02 11 9F 86 0D 55 58 4B 11 01

Is an Insteon ON (0x11) for Group 1 (0x01) which the motion sensor issues when motion is detected.

Create a trigger that fires when an ON command is received which indicates motion detected. The trigger can invoke a Macro which performs whatever you want to accomplish for motion. Create a second trigger that fires when an OFF command is received which indicates motion has not been detected for a full minute, invoke a Macro that performs whatever you want to accomplish for no more motion.

You can do a formula that checks the specific command but the two triggers is a simpler approach.


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
wasdvd
Groupie
Groupie


Joined: February 13 2007
Location: United States
Online Status: Offline
Posts: 42
Posted: May 14 2009 at 10:20 | IP Logged Quote wasdvd

Thank you for exactly what I needed. I didn't realize that I was receiving simple Insteon ON/OFF commands.

My 2.1b HELP doesn't function, as I did try to investigate.

It was late, and I must have been affected by the current climate where UP is DOWN, FORWARD is BACKWARD etc.
Back to Top View wasdvd's Profile Search for other posts by wasdvd
 
wasdvd
Groupie
Groupie


Joined: February 13 2007
Location: United States
Online Status: Offline
Posts: 42
Posted: May 31 2009 at 22:44 | IP Logged Quote wasdvd

Thanks, Lee G. As you can see from the time lapse, it has taken me awhile to come up with my next step plan.

Based on your guideline, I have been trying to work around the 2420M style of not periodically sending any signal during continuous motion, just at the start.

From digging through the various posts I found the ph_killmacrowait the key I was missing.

Now, I have the initial motion just issue the ph_killmacrowait and turn on the light. Continuous motion doesn't matter.

After one minute of no motion, I start a count down macro.

If there is additional motion, I rerun the initial macro to kill the count down macro, starting the entire process over. Once there is no motion for one minute plus the count down time, then I turn off the light.

Finally the 2420M works in PH well enough for an occupancy detector for me to replace the old X10 motion detectors. It seems to be a more reliable detector.

Many, many thanks for your help, and the help of those before.

A side note, the only way I have found to see the library of possible PH functions is in formula builder>auto complete>PH functions. My PH2.1b HELP does not work - no response. Is there somewhere I can find what all the functions are, and their syntax?
Back to Top View wasdvd's Profile Search for other posts by wasdvd
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: May 31 2009 at 23:24 | IP Logged Quote grif091

Glad you were able to get the motion sensor and macros working the way you wanted.

The only reference to the functions that I know of is Help/Contents off the main PH screen or Help from the Formula Builder window. They both go to the same help facility. If the Help/Contents from the main PH window does not get you to help, the Formula Builder probably won't either. Sounds like something happened during the PH install. The only suggestion I can offer is to save the database and ini file and reinstall PH. Just as though you were moving to a new release. Then copy the database and ini file back to the PH install directories.

Some day we might see a PH reference manual with all the good information but I don't expect that to happen any time soon.


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: June 02 2009 at 22:18 | IP Logged Quote dhoward

Harsh Lee...really harsh .

Yep, the PH_ functions are currently only documented in the Help file. The Help file can be found in the PowerHome directory and is ph-help.chm. I have run into a couple of systems that do not automatically launch the Help file and havent been able to determine exactly why it doesnt work. It seems to be more of a problem when PowerHome is loaded as a service and that may because of the system account that services are executed under.

One thing you may try is modifying an entry in the pwrhome.ini file under the [System] section. Try changing LAUNCHHELP=0 to LAUNCHHELP=1 and restart PowerHome. This uses a different method of launching the help file (it won't be able to use the context sensitive launching but if it launches at all thats better than nothing).

Concerning your method of timing out the motion sensor. That should work just fine but a possibly more elegant way would be to use the ph_extendmacrowait command. So in your motion sensed trigger, you would call your main macro. The first line of the macro would be a check to see if the macro is waiting (ph_ismacrowaiting) and if it is do a ph_extendmacrowait by the amount of time you desire and then exit. If the macro is not waiting, execute as normal and then enter the "Wait" stage. This would reduce the database I/O as well as the overhead to move a macro into and out of waiting.

HTH,

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


Joined: February 13 2007
Location: United States
Online Status: Offline
Posts: 42
Posted: June 02 2009 at 23:03 | IP Logged Quote wasdvd

Thanks, Dave.

Based on your help when I first started PH, I am really using the ph_ismacrowaiting and ph_extendmacrowait to do what I described above. I just was not saying it clearly.

With the X10, I could just keep extending the macro wait based on recurring motion, but with the 2420M I have to start the time out based on the lack of motion. I am sure you have long since worked this out, but I have just thought it through.

I am running PH as a service, since that made it essentially rock solid. Changing the entry in the ini file did not work for me, but I will just open the ph-help directly for now. I had not realized that I could open it.

Thanks, as always, for your help and for PH.
Back to Top View wasdvd's Profile Search for other posts by wasdvd
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: June 02 2009 at 23:11 | IP Logged Quote grif091

Sorry Dave, no personal dig intended. Was a programmer for more than 30 years and I understand the desire to pump out function compared to the dull dreary work of producing a good pub. There is so much great function in PowerHome, so much that is not being exploited because we don't even know it exists let alone know how to use it. PowerHome has an excellent reputation for function and your personal support. Think of where it could go from here with a good pub behind it. Okay, I’m getting off my soap box.

Thanks for all your help on the forum. You have earned the reputation you have for great support.    


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 

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