Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: ph_getinsteonlevelrt not logged? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: January 31 2010 at 18:47 | IP Logged Quote jeffw_00

So I have a formula...

ph_setvar_a(1,9,ph_getinsteonlevelrt("BATHROOM1LIGHT"))

the function fetches the level from the device.

I test [LOCAL9] in the next line, so I know that this formula works (i.e., it gets the correct status, whether the light is on (255) or off (0))

But when I execute this command, I see no activity in the PH Event log, even though i have -all- checkboxes checked in Setup->Logs.

???

thanks
/j
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: January 31 2010 at 23:44 | IP Logged Quote BeachBum

I think that’s normal as I send these all the time and don’t see them either but I know the command is working.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: February 01 2010 at 09:32 | IP Logged Quote jeffw_00

It would be nice, then, if there -was- a way to log them...
Right now I'm using one as a PLM 'health check'
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: February 01 2010 at 10:00 | IP Logged Quote BeachBum

I tried the “health check” thing but when I had a failure due to lost communications, PH then froze in an endless loop of error recovery. The end result was I never got control to intervene. Would be interesting if your method works.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: February 01 2010 at 10:33 | IP Logged Quote jeffw_00

SO the problem I have is the the PLM hangs up, and then next time PH tries to access it, PH hangs up.

Every 15 minutes, PH runs ph_getinsteonlevelrt and then writes a timestamp to a text file.

I have a perl script running on the machine that checks the text file every 15 minutes for the timestamp (it's actually a little more sophisticated to avoid boundary conditions).
If PH misses a timestamp, the perl script reboots the PC.

It -appears- that when the machine reboots, PH successfully 'catches up' from wherever it hung.

This has worked very well for me as I have tried different unsuccessful attempts at getting my PLM to work reliably. I'm going to order a serial one today

/j
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: February 01 2010 at 10:40 | IP Logged Quote BeachBum

Now that is cool. But I’m trying to find a way to trigger a macro that would be on top of the execution queue and ReInit PH from within itself. I have also found this problem to correct itself by waiting but the execution queue stacks way up.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: February 01 2010 at 14:31 | IP Logged Quote dhoward

I checked the code and indeed, Insteon status requests originating from PowerHome are not logged. In addition to status request (cmd1 = 25), the peek and poke commands (40 thru 45) are also not logged. I originally did this so that standard PowerHome processing (the continuous polling and database peek/poke) would not overrun the log since PowerHome does so much of this during its normal operations. I can see though that it would be nice to log these commands if they originate from the user rather than from PH background processing. I'll look into and see if I can differentiate easy enough.

Concerning getting a command to the top of the execution queue ahead of other commands...this can be done fairly easily. The Boolean field of a trigger is executed ahead of the execution queue. All you need to do is put your ph_macro or ph_reinit command in the boolean field of a trigger. A handy trigger to use is a Windows Message trigger. Its then relatively simple for an external program to send an appropriate windows message to PowerHome that will fire the trigger, execute the boolean field, and get the boolean field ahead of anything that may be in the execution queue.

Also, Ive been working on new code in PowerHome so that when a logoff or shutdown is being processed, PowerHome will exit cleanly and not prevent the logoff or shutdown. This should make reboots without using the shutdown -f parameter alot easier.

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

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: February 01 2010 at 14:52 | IP Logged Quote BeachBum

Again, thanks Dave…

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: February 01 2010 at 15:35 | IP Logged Quote jeffw_00

It sounds like dave is saying that the boolean field is directly executed before a trigger is put in the execution queue - Is there some way to do that with macros?

How does one generate a "windows message" trigger from an external program (is that the 'helper' program (i forget the name) I use to execute commands from a Dos box (well, actually an Icon calling a .BAT script).

Finally - I would welcome clean shutdown from PH. Right now I have an icon that calls "process.exe" which explicitly kills PH by name. it's dirty, but it's better than -f.

thanks!
/j
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 

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