Announcement

Collapse
No announcement yet.

Sample ASP

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

    Sample ASP

    I've searched the boards for hours and can't find what I'm looking for. All I need is a sample of a complete ASP page that interacts with Homeseer databases (log, devices) - for example, a page that displays the last 5 log entries.

    I need something like this to serve as a sample or template that I can use to build other custom Homeseer pages.

    If anyone has something like this, I would be eternally grateful if you could share it with me.

    #2
    Check out secure links at:
    http://www.c-website.com/securelinks.htm

    There is a file called db_functions.asp that shows how you can connect to a db.

    And a file called menu_functions that uses the functions in db_functions.asp to connect and run various queries.

    Jeff Farmer
    HomeSeer user since March, 2000

    --
    Jeff Farmer
    HS 3, HSPhone
    My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
    Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

    Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

    Comment


      #3
      Thanks, Jeff.

      I actually have some experience using ASP and databases. I was looking for code specific to Homeseer. I just need to see a basic query that lists the last 5 event log entries.

      How do I connect to Homeseer? To what file do I connect (the data store)? How do I write the query, is it SQL? Are there built-in functions to handle this (e.g. 'hs.GetLogEntry')?

      If I could just get an example, I can figure out the details.

      Comment


        #4
        HomeSeer stores its logs in a text file. There is a plugin called UltraLog that will put the log entries into either an Access or a SQL database.
        So you could read the file (ah.log),split it into an array and then display the last 5 entries.

        Devices and Events are stored in a xml file. There is a plugin AHA Reporter that imports all the devices and events into an Access db.

        Jeff Farmer
        HomeSeer user since March, 2000

        --
        Jeff Farmer
        HS 3, HSPhone
        My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
        Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

        Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

        Comment


          #5
          I've just submitted a request in the help desk for this very feature, but I doubt it'll go anywhere. The few scripts that access the log do so by one of two exceedingly cumbersome methods: either they open the ah.log file and read it, which is not only slow but likely to get way too many entries since the file is likely larger than the in-memory version; or, they maintain a second copy of the log in a database or other storage point, updating it every time HomeSeer writes to the log, then query against it. A third kluge is possible -- use hs.GetURL to let HomeSeer read its own /elog page, but that's even more gratuitously inefficient. An hs.GetLogEntry() function would be much more sensible than any of these, particularly for an application that simply replicates or improves upon the functionality of the /elog page.

          Nucleus Home Automation | System Specs
          News, support, and updates for Rover, Network Monitor, TimeIcons, and more

          Comment


            #6
            Heres an asp page that will read the log entries and list out the lines of the log file that have the word error in them. I tried to trim the page down to the bare minimum code.

            -Rupp

            Hum ... How much deeper would oceans be if sponges didn't live there?
            Attached Files
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              I've learned a great deal from all of you in the past few minutes. I appreciate your time.

              I don't want to go through the rigamorole of building a separate database. And, I can't use the ah.log file. I have a rather old PC hosting Homeseer, and the ah.log file quickly balloons to the point that it really affects performance.

              I imagine it's not possible to write (append) a log entry (as it's triggered) to a variable device value, and clear the first line every 5 entries. In that scenario, I would only have to display the variable device state.

              So, I guess the log is out for now. But how would I query Homeseer to display a list of devices. That can be done, right?

              Comment


                #8
                Thanks Rupp -

                I think this is the missing link to another project that I was working on...

                Comment


                  #9


                  -Rupp

                  Hum ... How much deeper would oceans be if sponges didn't live there?
                  💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                  Comment

                  Working...
                  X