Announcement

Collapse
No announcement yet.

RFXPower usage power graphs and scripts

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

    RFXPower usage power graphs and scripts

    I have installed an RFXPower monitor into my system which uses a CT to measure power usage and sends data wirelessly back to HS via ACRF. To make use of the data I have set about creating a database and some graphs. On the list are:
    • Hourly usage
    • Hourly cost
    • Daily usage & cost - last seven days
    • Daily usage & cost - last 31 days
    • CO2 output caused by my usage

    I have created access database (temperature.mdb) with fields id, ctime, cdate, reading, lusage, lcost and sensor.

    I have created a script (tempdb.txt) with the help of Rupp and Jon00 that reads the value from the RFXPower sensor, calculates usage and cost and inserts id (auto), ctime, cdate, reading and sensor into the database on a half-hourly basis scheduled in HS2

    For the graphing side of things I have installed Kavachart, a java graphing applet as recommended by Jon00 and amended the example asp script (tempchart2.asp) to create the daily usage (kwh) and cost (pence) graph page. I am really pleased with the output (see below)

    I now want to be able to create the daily usage 7 & 31 days but dont know how to go about the sql side of things to extract 7 and 31 days from the database.

    Please help yourself to the attached files if they are any use.

    Any help would be appreciated

    regards
    Gary
    Attached Files
    Last edited by connoleg; January 1, 2007, 07:11 AM.

    #2
    WHERE dateField BETWEEN 'date1' AND 'date2'
    --
    stipus

    Comment


      #3
      Really neat.
      I'm Java illiterate. How do I install Kavachart? I've been looking for something like that.

      Comment


        #4
        This looks awesome...well done...looking forward to getting my power monitor now!

        Comment


          #5
          Originally posted by ea_automation View Post
          Really neat.
          I'm Java illiterate. How do I install Kavachart? I've been looking for something like that.

          Hi,
          To install, just download from the link below and extract to your html directory. It should be like this: c:\ program files\ Homeseer2\ html\ javachart\ (depending where your Homeseer is installed).

          I used the online chartwizard to play with the settings and get the parameters for the asp page. The chartwizard is accessed from the index web page in the javachart directory you just extracted.

          http://homepage.ntlworld.com/g.connoley/javachart.zip

          Gary

          Comment


            #6
            Gary,
            Have you got any further with this one?

            Cheers,

            Darren

            Comment


              #7
              Originally posted by darren-mc View Post
              Gary,
              Have you got any further with this one?

              Cheers,

              Darren
              Sure have. I've restructured the scripts and database. The Historical graphs (31 days) are now complete. I'll upload them a bit later.

              regards
              Gary

              Comment


                #8
                Sounds excellent..looking forward to giving it a try.

                Thanks

                Darren

                Comment


                  #9
                  Power Usage update

                  Here is the latest update. Ive added two extra graphs to show usage and cost for previous 31 days.

                  To install:
                  copy scripts to the scripts directory
                  copy powercharts.asp to the html directory
                  copy powermonitor.mdb to the data directory in root of HS (you might need to create this directory)

                  Here is the link to Kava Charts again http//homepage.ntlworld.com/g.connoley/javachart.zip

                  setup one event that runs the PowerMonUpdate.txt script every 60 mins with reference to the hour and the other to run the PowerMonDayTotals.txt at 00:30 everyday.

                  Have fun. Feedback would be welcomed.

                  Gary
                  Attached Files
                  Last edited by connoleg; January 11, 2007, 05:40 PM.

                  Comment


                    #10
                    Originally posted by connoleg View Post
                    Hi,
                    To install, just download from the link below and extract to your html directory. It should be like this: c:\ program files\ Homeseer2\ html\ javachart\ (depending where your Homeseer is installed).

                    I used the online chartwizard to play with the settings and get the parameters for the asp page. The chartwizard is accessed from the index web page in the javachart directory you just extracted.

                    http://homepage.ntlworld.com/g.connoley/javachart.zip

                    Gary
                    kavachart is awesome - it will generate the applet code for you with that chart wizard. We actually use it where I work to create some slick graphs.
                    HS4Pro on a Raspberry Pi4
                    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                    HSTouch Clients: 1 Android

                    Comment


                      #11
                      Installed my RFXPower this week.

                      wow it is just phenomenal!

                      I think it will encourage me to manage my electricity bill in a quite different way....

                      Simon

                      Comment


                        #12
                        I just set this software up - it's cool too!

                        the installed database seems to have some readings data from December.

                        how do i simply clear it so i am starting with my own readings only?
                        Last edited by simonog; January 14, 2007, 04:43 AM.

                        Comment


                          #13
                          Originally posted by simonog View Post
                          I just set this software up - it's cool too!

                          the installed database seems to have some readings data from December.

                          how do i simply clear it so i am starting with my own readings only?
                          Simon,

                          If you have MS access then just open then the database then the sensor_data table and delete all rows. The other tables are emptied by the PowerMonDayTotals.txt script each time it runs. I've attached an empty version of the database if you prefer to use that. Just unzip and rename to PowerMonitor.mdb

                          Gary
                          Attached Files

                          Comment


                            #14
                            Thank you - I used Access as i have it and it worked fine.

                            Just wanted to make sure I was doing the right thing, and also avoid others falling into same trap.

                            now I have an interesting issue. may be 2 though they feel as if connected.

                            1. In the log, i often get this message when i display the charts:

                            <TABLE cellSpacing=2 cellPadding=0 width="100%" border=0><TBODY><TR><TD class=LOGDateTime1 noWrap align=left>14/01/2007 12:03:14 </TD><TD class=LOGType1 align=left colSpan=3>Error </TD><TD class=LOGEntry1 align=left colSpan=8>Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/applet.columnApp.jar</TD></TR></TBODY></TABLE>

                            2. When i display the charts (with my first day's data!) they all appear to be overflowing the scales. i printed the readings from the middle of your .asp to see if there were any silly values: they all look reasonable viz:

                            <TABLE cellSpacing=2 cellPadding=0 width="100%" border=0><TBODY><TR><TD class=LOGDateTime0 noWrap align=left>14/01/2007 12:07:56 </TD><TD class=LOGType0 align=left colSpan=3>sjog dbg </TD><TD class=LOGEntry0 align=left colSpan=8>0,5.75,3.49,3.58,3.57,4.18,4.53,4.84,4.07,4.06,4.5 2,4.27,4.28,</TD></TR></TBODY></TABLE>

                            I think I have attached a screen print of the charts I am getting

                            Simon
                            Attached Files

                            Comment


                              #15
                              Originally posted by simonog View Post
                              Thank you - I used Access as i have it and it worked fine.

                              Just wanted to make sure I was doing the right thing, and also avoid others falling into same trap.

                              now I have an interesting issue. may be 2 though they feel as if connected.

                              1. In the log, i often get this message when i display the charts:

                              <table border="0" cellpadding="0" cellspacing="2" width="100&#37;"><tbody><tr><td class="LOGDateTime1" align="left" nowrap="nowrap">14/01/2007 12:03:14 </td><td class="LOGType1" colspan="3" align="left">Error </td><td class="LOGEntry1" colspan="8" align="left">Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/applet.columnApp.jar</td></tr></tbody></table>

                              2. When i display the charts (with my first day's data!) they all appear to be overflowing the scales. i printed the readings from the middle of your .asp to see if there were any silly values: they all look reasonable viz:

                              <table border="0" cellpadding="0" cellspacing="2" width="100%"><tbody><tr><td class="LOGDateTime0" align="left" nowrap="nowrap">14/01/2007 12:07:56 </td><td class="LOGType0" colspan="3" align="left">sjog dbg </td><td class="LOGEntry0" colspan="8" align="left">0,5.75,3.49,3.58,3.57,4.18,4.53,4.84,4.07,4.06, 4.52,4.27,4.28,</td></tr></tbody></table>

                              I think I have attached a screen print of the charts I am getting

                              Simon
                              For your installation you need to ammend the Powercharts.asp file and adjust the min and max yaxis values. Mine are:

                              param name=yAxisStart value="0.0"
                              param name=yAxisEnd value="1.0"

                              I would suggest you need something like 0.0 and 6.0 looking at your data.
                              You can delete those two lines and the graphs will auto scale but in my experience setting them to your max and min values looks much better.

                              I'll look at the log error and get back to you

                              Gary

                              Comment

                              Working...
                              X