Announcement

Collapse
No announcement yet.

PHP Support in HomeSeer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • dale3h
    replied
    Awesome. Anyone going to test database stuff?

      Best Regards,
        Dale Higgs (Synthesize)

      Website: http://www.synvb.com/

    Leave a comment:


  • Jim Doolittle
    replied
    I might play around with it this weekend. I'll at least try doing a "Hello World" test.

    Jim Doolittle

    Leave a comment:


  • dale3h
    replied
    Any feedback?

      Best Regards,
        Dale Higgs (Synthesize)

      Website: http://www.synvb.com/

    Leave a comment:


  • dale3h
    replied
    Here is the plugin. This will hold everyone over until HomeSeer integrates direct PHP support. Just place it in the HomeSeer directory and register it (Start>Run>regsvr32 "C:\Program Files\HomeSeer\hspi_phpin.ocx"). Add it to the HomeSeer interfaces just like you would any other plugin. It is considered an I/O plugin. The only method of the plugin is "ExecPHP", which is passed a filename (not including path), which resides in the "html" folder. In order for this to work, you will need an ASP front-end script and a PHP script. When HomeSeer integrates PHP support, you will just drop the ASP front-end and use the PHP script alone. Here is an example for the ASP script:
    <pre class="ip-ubbcode-code-pre">&lt;%@ LANGUAGE=VBScript %&gt;
    &lt;%
    Response.Write hs.Plugin("PHPin").ExecPHP("phptest.php")
    %&gt;</pre>
    ...and here is an example for the PHP script:
    <pre class="ip-ubbcode-code-pre">&lt;?
    $myspk = "The current HomeSeer uptime is ".$hs-&gt;SystemUptime();
    $hs-&gt;speak($myspk);
    echo $myspk;
    ?&gt;
    </pre>
    This will speak the uptime as well as print it out. Please avoid using the "shutdown" command during speaking.

    Please note that you must have PHP installed on your system in order to run this plugin correctly. PHP can be found at http://www.php.net/ in the downloads section. If I left out anything, please let me know. I will be happy to answer any questions.

    &nbsp;&nbsp;Best Regards,
    &nbsp;&nbsp;&nbsp;&nbsp;Dale Higgs (Synthesize)

    &nbsp;&nbsp;Website: http://www.synvb.com/
    Attached Files

    Leave a comment:


  • Jim Doolittle
    replied
    I posted an ASP a while back that does some complicated queries on the MSAccess database populated by the UltraLog plugin. So, there is a mechanism already for "data analysis".

    I don't know if I would use php for that purpose but would probably use a mix-and-match of ASP and PHP depending upon what I wanted to accomplish. I was forced to learn php for my Apache website (didn't want to pay extra for Chilisoft).

    Jim Doolittle

    Leave a comment:


  • dale3h
    replied
    I will try to get a plugin made tonight that allows you to call it from an ASP page returning the results. It would be something like this:

    <pre class="ip-ubbcode-code-pre">Response.Write hs.Plugin("PluginName").DoThePHPMethod("index.php")</pre>

    This would simply return the parsed PHP file "index.php" that resides in the \html directory of the HomeSeer folder.

    &nbsp;&nbsp;Best Regards,
    &nbsp;&nbsp;&nbsp;&nbsp;Dale Higgs (Synthesize)

    &nbsp;&nbsp;Website: http://www.synvb.com/

    Leave a comment:


  • zimmer62
    replied
    I bet it could be done automatically.... so it wouldn't be hard for a new user... they just wouldn't have to use the features of the database.

    I'd love it if we could connect to it from a remote machine using a standard SQL method... any of the msql mysql pgsql oracle etc would be fine because almost all languages support that. Boy we could start to write some crazy stats pages if we had all that info in a database...

    Give me a list of all the lights that were left on for 6 hours or more per day in the last month. Poof! here is your answer.

    Add a column for the approximate wattage draw of each device when turned on and add up how much those christmas lights cost me

    Leave a comment:


  • Nitrox
    replied
    Postgresql provides trigger and notify functions that this would work well with. I think MySQL is adding support for triggers in v5.x

    -Nitrox

    Leave a comment:


  • twittydavis
    Guest replied
    I like the idea of the database. I've long wished that HomeSeer used a database for all of it's data. It would make setup more complicated for new users (and the set up routine itself more complicated) but would be very useful.

    Leave a comment:


  • zimmer62
    replied
    I've had a great idea a while back to add support for PHP and all sorts of languages to homeseer........but, I havn't had any time to write a plug in, maybe someone else will jump on this, or get this off the ground.

    The idea would incorporate using an SQL database to control homeseer and vise versa. So basically there would be a homeseer plugin that watched an table or set of tables in the database, and made changes to the database etc...

    For instance... you could use PHP to connect to a postgres (free) sever, or whatever sql server.... do a "SELECT * FROM devices WHERE devices.status='on';" or something to that effect, and you could see what the current status of things were,

    Then you could do something like "UPDATE devices set status='on' WHERE devices.name='Floor Lamp' AND devices.location='Living Room';

    So at this point postgres (or whatever) could have a trigger that called the homeseer plugin, and it would say, I have made a change please compare... then the plugin would compare the states of the current devices to what is in the database ( or the trigger could be smart enough to tell the plugin what device was changed), and then turn on the livingroom light, to reflect the changes made.... also if you were to make a change from homeseer, for instance you turned on the living room light with a palm pad, the plugin would have to update the database to reflect that. All of this would need to happen very quickly upon changes as well… if the database doesn’t support triggers, you could poll the database and do a comparison, but the trigger method would be less load and faster.

    You could also do more complex queries, and joins between revelavant tables etc..

    SELECT devices.name FROM devices, log WHERE devices.name=log.name AND devices.location=log.locaiton AND log.user=’web’;

    If this could be done, it would let anyone write in almost any language scripts for homeseer, because I can't think of a programming language that can't connect to a variety of sql servers. PHP, JAVA, PERL, C++, VB.NET, “insert your favorite language here”

    I would love to see something like this happen; it sure would make future expansions of homeseer limitless.

    Leave a comment:


  • dale3h
    replied
    Nothing forgotten...I will talk to Rick Tinker about it and maybe get it added in. It's a somewhat complicated process.

    &nbsp;&nbsp;Best Regards,
    &nbsp;&nbsp;&nbsp;&nbsp;Dale Higgs (Synthesize)

    &nbsp;&nbsp;Website: http://www.synvb.com/

    Leave a comment:


  • jhisr
    Guest replied
    Dale,

    How did you get PHP in VB? Did you forget to attach something for us to look at?

    Joe
    HomeSeer Rocks!

    Leave a comment:


  • dale3h
    started a topic PHP Support in HomeSeer

    PHP Support in HomeSeer

    Since no one had a clue to how to incorporate PHP into HomeSeer a few months ago when I was in question about it, I had to do it myself. I took the initiative (a few hours) to research how to use PHP in Visual Basic, then voila! Any comments on this?

    &nbsp;&nbsp;Best Regards,
    &nbsp;&nbsp;&nbsp;&nbsp;Dale Higgs (Synthesize)

    &nbsp;&nbsp;Website: http://www.synvb.com/
Working...
X