Announcement

Collapse
No announcement yet.

HS3 Third Party Current Cost Envi Plugin Released

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

    MrHappy. That seems to have done the trick
    All channels on all sesnors are listed in the energy API and graph appropriately. I'll leave it running for a few more days and report back but it looks pretty good.

    There is only one small issue in that when logging is turned on (via the CC directory) the plug-in crashes after about 20 minutes. So I have had to leave logging turned off.

    Thanks for the good work.
    Marty
    iCore5 Win 10 Pro x64 SSD

    HS3 Pro Edition 3.0.0.435 Windows

    BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

    Comment


      Is it posseble to show the graf`s in hstouch?
      If so, how do i do that?

      Comment


        Originally posted by mminehan View Post
        MrHappy. That seems to have done the trick
        All channels on all sesnors are listed in the energy API and graph appropriately. I'll leave it running for a few more days and report back but it looks pretty good.

        There is only one small issue in that when logging is turned on (via the CC directory) the plug-in crashes after about 20 minutes. So I have had to leave logging turned off.

        Thanks for the good work.
        Marty
        Good to hear, thankfully the logging is rarely needed it just makes things easier to copy and paste from. Turning it on is not actually documented in there because it is very rarely needed. I don't know why it crashed but I don't think I will need to see any more logs as I think that problem is overcome.

        Could I ask that you just give me an update in a day or two as to whether it is still working and the readings are OK. If everything is alright then I will probably look at using this as a release version.

        Originally posted by Mrtiger View Post
        Is it posseble to show the graf`s in hstouch?
        If so, how do i do that?
        No not really, unfortunately the new charts are a Javascript object and I can think of no way to easily get that into a HSTouch element. I am logging data to the Energy API and apparently HSTouch support for these charts is coming out but on my HSTouch designer they are not yet supported. I am afraid it will be a case of waiting for HSTouch to be updated I think. There is no point me using the old charts that were in the HS2 plugin because they will stop working in May this year.

        Comment


          Hi Mr Happy,
          The plug-in is running very well. All sensor channels are being logged in the energy API and graph accordingly. No crashes either. Just need HS to tidy up the energy API so that better graphs can be drawn. I would like to be able to graph solar generation versus energy usage for example.

          The solar panels don't plot negative values in the API despite being set at energy direction produced. But I think this may be something to do with the API rather than the plug-in.

          Proabaly the only minor issue is that with storing data every minute the energy database gets quite big relatively quickly. It has been running for 4 days now and it's 25MB in size. So I imagine in about 3 months it will be over 500MB. Maybe saving the data every 5 minutes or something might help. I guess devices that power cycle (on and off) or change usage quickly might be less accurate the less frequently they are logged. But CT clamps are an 'estimate' anyway.

          Thanks again for developing this plug-in.
          Marty.
          iCore5 Win 10 Pro x64 SSD

          HS3 Pro Edition 3.0.0.435 Windows

          BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

          Comment


            Originally posted by mminehan View Post
            Hi Mr Happy,
            The plug-in is running very well. All sensor channels are being logged in the energy API and graph accordingly. No crashes either. Just need HS to tidy up the energy API so that better graphs can be drawn. I would like to be able to graph solar generation versus energy usage for example.

            The solar panels don't plot negative values in the API despite being set at energy direction produced. But I think this may be something to do with the API rather than the plug-in.

            Proabaly the only minor issue is that with storing data every minute the energy database gets quite big relatively quickly. It has been running for 4 days now and it's 25MB in size. So I imagine in about 3 months it will be over 500MB. Maybe saving the data every 5 minutes or something might help. I guess devices that power cycle (on and off) or change usage quickly might be less accurate the less frequently they are logged. But CT clamps are an 'estimate' anyway.

            Thanks again for developing this plug-in.
            Marty.
            Thanks for the update, certainly the charting side of the API does look like it could do with some work or at the very least some explanation as like you I would think it would make sense to show charts of consumption vs. production. Hopefully this is to come but who knows at the minute. You could always add your comments to that bug I posted (#2180 I think) if you wanted to keep comments there.

            I did think about the database size and I hope that there are methods to perhaps compress the database size coming out or something because I am logging at the maximum suggested by Rich (once a minute) and still if this is only a couple of months worth of data then it is not the best for long term comparisons of power use. As I have no control over other devices in peoples systems this could end up with a very short period stored indeed. I can add options in the plugin of course to do this but I will lose accuracy (which it already is less accurate than it could be) and again I am not sure if the solution for this should be from HS (because what about other devices - what are their reporting intervals) rather than the plugin.

            I will look at this and then probably release the version and thanks for testing and reporting back.

            Comment


              Originally posted by mminehan View Post
              Hi Mr Happy,
              The plug-in is running very well. All sensor channels are being logged in the energy API and graph accordingly. No crashes either. Just need HS to tidy up the energy API so that better graphs can be drawn. I would like to be able to graph solar generation versus energy usage for example.

              The solar panels don't plot negative values in the API despite being set at energy direction produced. But I think this may be something to do with the API rather than the plug-in.

              Proabaly the only minor issue is that with storing data every minute the energy database gets quite big relatively quickly. It has been running for 4 days now and it's 25MB in size. So I imagine in about 3 months it will be over 500MB. Maybe saving the data every 5 minutes or something might help. I guess devices that power cycle (on and off) or change usage quickly might be less accurate the less frequently they are logged. But CT clamps are an 'estimate' anyway.

              Thanks again for developing this plug-in.
              Marty.
              I have posted this version to the start of the thread, I have also added two INI file settings, they are documented but if you wish to experiment you can add this line under the [Options] key in the ccost3p.ini

              EnergyUpdateInterval=2

              where '2' is the minutes you wish to update the database over (there is also EnergyEnabled which you can set to false if you don't want to update it at all). Thanks...

              Comment


                Hi Mr Happy,
                Just a quick update. This version has been running for 2 weeks now and seems to be working like a charm.
                Thanks again!!
                Marty
                iCore5 Win 10 Pro x64 SSD

                HS3 Pro Edition 3.0.0.435 Windows

                BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                Comment


                  Thanks very much for the update, any other issues or suggestions let me know.

                  Comment


                    Right, I have seen a few requests for the charts to go into HSTouch and I thought I would post a workaround for people who do want to see the charts in HSTouch. It is a workaround because of the charts being Javascript and HSTouch just wants a simple image file.

                    Beware this is indeed not a straightforward method but it does appear to work, here are the steps.

                    1) Download the version .19 of the plugin, this version amends some formatting issues that were preventing the charts displaying on Internet Explorer (previous testing was just with Chrome) and also hides the border to the tables that was showing on IE but not on Chrome.

                    2) Download Jon00's rather excellent HTML to Image utility here http://board.homeseer.com/showthread.php?t=149455 and install it as per the instructions.

                    3) Download the CCHSTouchChart.vb file in the attached zip file and install it to your scripts directory.

                    Now what is going to go on is:

                    CCHSTouchChart.vb gets called with two parameters, they are the Chart Number (the number is as per the script 'Select Case' statement starting with 0) followed by the '|' pipe and then the Sensor Number. CCHSTouchChart.vb is then going to call into the plugin and generate a HTML file just containing the chart and nothing else. This it will generate to your main \html\ directory and it will call this file something like 'bbarchart12m0.html' where the first part of that is the chart name and the last digit is the sensor number.

                    After this file is generated the HTML to Image tool is called and it makes an image of the bbarchart12m0.html file, this image by default is saved to your \html\Images directory. It appears to format the size of the image automatically itself but if not you can crop it to your taste.

                    In your configuration file for the HTML To Image tool you will need to use the above file name to specify the charts like the following;

                    Code:
                    [Capture1]
                    URL=192.168.0.8/bbarchart12m0.html
                    DeviceBGColor=
                    ImagePath=blivelinetoday0.png
                    crop=
                    WBWidth=
                    WBHeight=
                    Delay=50
                    Here you can see that the name of the URL is the same as the above HTML file that the script is generating, you can set the image name to whatever you want but you will need to remember this for HSTouch. I suggest putting in a delay just to make sure things are loaded, 50 is five seconds and seems to work just fine.

                    I imagine you will want to call this from an event so please set up an event like the following, you can see that the CCHSTouchChart.vb script is called first (with the two parameters) and then the HTMLToImage script is called.

                    Check the event produces an image in your \Images\ directory matching the file name in your above INI file.

                    In HSTouch you then add an image element to your page and then specify the path to this image, your chart should now be in HSTouch. I know that a lot of customised options that were available in the HS2 plugin (background colours, text colours) are missing but feel free to amend the HTML to your liking.

                    I know this might be a bit difficult to follow but if you are struggling please post here and I will try to help.
                    Last edited by mrhappy; January 6, 2017, 01:46 PM.

                    Comment


                      i got this error in the log every night at 0:00:00

                      Hope you can help to find out whats wrong here.

                      feb-26 00:01:02 Database Error - Save of the devices to the database did not succeed - see the log for more details.

                      feb-26 00:01:02 Database ERROR, device 1 ETG. Current Cost 3P Sensor 0 Today Estimated Use failed to be updated or added to the database.

                      feb-26 00:01:02 Error SQL Exception : UPDATE [Devices] SET [ref]=309,[name]='Sensor 0 Today Estimated Use',[location]='Current Cost 3P',[location2]='1 ETG.',[Last_Change]='2015-02-26 00:00:08',[devValue]=Infinity,[devString]='',[object_version]=100,[object_data]=@ByteArray WHERE [ref]=309;

                      feb-26 00:01:02 Error SQL Exception updating device record in the database: SQL logic error or missing database no such column: Infinity, Code=1, Link=

                      feb-26 00:01:02 Database ERROR, device 1 ETG. Current Cost 3P Sensor 0 Today Estimated Cost failed to be updated or added to the database.

                      feb-26 00:01:02 Error SQL Exception : UPDATE [Devices] SET [ref]=308,[name]='Sensor 0 Today Estimated Cost',[location]='Current Cost 3P',[location2]='1 ETG.',[Last_Change]='2015-02-26 00:00:08',[devValue]=Infinity,[devString]='',[object_version]=100,[object_data]=@ByteArray WHERE [ref]=308;

                      feb-26 00:01:02 Error SQL Exception updating device record in the database: SQL logic error or missing database no such column: Infinity, Code=1, Link=

                      Comment


                        Here is a print screen.

                        Comment


                          I am sorry but I am not sure that this is a plugin issue and to me looks like an issue with your HS install. That error relates to the device belonging to the plugin certainly however looking at the database table name (Devices) and the column names (location, location2, name, ref etc) then these are all the names of the columns in the HomeSeer database.

                          I do not know why HS is having issues updating this device but as I only use HS calls like hs.setdevicevalue and such like then the plugin should not have issues updating the device. It would be no different than a script updating the device.

                          I am afraid I do not know what to really suggest, if you are not using these devices in HSTouch or events then it may be a consideration to delete the devices and let the plugin recreate them. Please note that if you are using them in events and wish to do this then you would need to re-select the devices in the events. If you wish to do this then stop the plugin, delete the ten devices belonging to Sensor 0 and then restart the plugin. The devices should be recreated and then be given new references, that perhaps might find out whether or not it is the device or something else.

                          Comment


                            Originally posted by mrhappy View Post
                            I am sorry but I am not sure that this is a plugin issue and to me looks like an issue with your HS install. That error relates to the device belonging to the plugin certainly however looking at the database table name (Devices) and the column names (location, location2, name, ref etc) then these are all the names of the columns in the HomeSeer database.

                            I do not know why HS is having issues updating this device but as I only use HS calls like hs.setdevicevalue and such like then the plugin should not have issues updating the device. It would be no different than a script updating the device.

                            I am afraid I do not know what to really suggest, if you are not using these devices in HSTouch or events then it may be a consideration to delete the devices and let the plugin recreate them. Please note that if you are using them in events and wish to do this then you would need to re-select the devices in the events. If you wish to do this then stop the plugin, delete the ten devices belonging to Sensor 0 and then restart the plugin. The devices should be recreated and then be given new references, that perhaps might find out whether or not it is the device or something else.
                            Strange, it worked perfect for almost a week before this happend.

                            Comment


                              Originally posted by Mrtiger View Post
                              Strange, it worked perfect for almost a week before this happend.
                              OK, after looking at it a bit more it seems to be trying to set the device value to infinity and understandably failing. The values at around midnight for these devices do tend to be quite low but should not be anything other than 0. I will do some testing and get back to you, it may indeed be a problem with the plugin but everything I put in I thought catered for this sort of thing.

                              Comment


                                Thanks for your help. If you need more information, let me know.

                                Comment

                                Working...
                                X