Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Furnace/Temp. Logging Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
raven77
Groupie
Groupie
Avatar

Joined: January 02 2007
Location: United States
Online Status: Offline
Posts: 44
Posted: September 26 2010 at 15:27 | IP Logged Quote raven77

Hello,
Man posting on this forum is frustrating!!!

Sometimes when I hit enter it wipes out my post and decides to submit. I just had a huge message typed out...oh well

anyway...
I am trying to log temperature and furnace run time into a mysql database.
I can post to the database using php with no problems.
I can also update a GV using a timed event in PH using this code
"double(ph_rtne(ph_setvar_s(1,1,ph_getwburl("http://192.168. 1.15:85/gett1.cgi",10)) + ph_setvar_a(1,2,pos(ph_getvar_s(1,1),"<BODY>")) + ph_setvar_a(1,3,pos(ph_getvar_s(1,1),"</BODY>"))) + mid(ph_getvar_s(1,1),ph_getvar_n(1,2) + 6,ph_getvar_n(1,3) - ph_getvar_n(1,2) - 7))"
and that also works nice.
I just cant figure out how to post that data to the database hourly.
any ideas?
I would also like to log start and stop times of my furnace. the data url is about the same
"http://192.168.1.15:85/geti1.cgi"
But I am not sure the best way to log start/stop times to the database.
Best idea I came up with was to use a time event to poll the URL every 5 seconds and update a GV if it changes then use the GV trigger to post to the database.
But again, I am not sure how to insert to an external database with PH.
I realize this could probably be done outside of PH, but any help would be greatly appreciated.


Edited by raven77 - September 26 2010 at 15:43
Back to Top View raven77's Profile Search for other posts by raven77
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 27 2010 at 08:53 | IP Logged Quote MrGibbage

I don't know if you can make a direct connection to a mysql database right from PH. If your mysql database
is hosted on some webserver that you have access to, I would write a small php program to take a url with
the post data being your entry into the database. Something like

mysupersecreturl.com?time=1600&date=9/27/2010&data1=1234&dat a2=sometext

By the way, I also have problems posting here from time to time. I've not had it delete an entire post, but
posting can take a looonnnnngggg time from the time I hit the "Post Reply" button.

__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: September 29 2010 at 11:30 | IP Logged Quote dhoward

I have plans for a generic ODBC plugin for PowerHome. Not sure if it will help in connecting to the mysql database or not but should allow you to execute SQL against any database that you can configure an ODBC connection to.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward'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