Current Cost 3P Plugin
This is a HS3 replacement of a HS2 plugin for the Current Cost Envi/EnviR hardware (http://www.currentcost.com/). A lot of the code has been changed and optimised from the HS2 version and it is not possible to upgrade an older database. Once downloaded from the updater then the plugin should install and install all of the files into the HomeSeer directories. Once the log says that they have been installed then in the HS3 web interface click Plug-Ins > Manage and then it should find an entry called Current Cost 3P. Using the drop down box select the COM port that the Envi is currently connected to (can be found in Windows device manager) and then click enable.
If the COM port is found and opened then there should be an appropriate entry in the HomeSeer log, please note that the Envi meter is relatively dumb and the plugin does not know that it has an Envi meter connected to it, as such please ensure that you are selecting the correct COM port. Five base devices should be then created in HomeSeer, these devices will hold information about the port status, the number days to log live data, the current kWh unit cost, the receiver temperature and receiver time.
The devices will show the following:
Once the plugin starts to receive data from the Envi meter then it will create a set of ten devices per sensor, it will create these on the basis of live received data and these devices will be created automatically. If you have two sensors, Sensor 0 and Sensor 4 paired to Envi then it will create a block of devices for Sensor 0 and 4, it will not create any others. If you remove the pairing of a device in the Envi then it is then up to you to delete the ten devices from HomeSeer and they will not be deleted automatically. The instant data from the Envi device will then update these devices.
These devices are relatively self explanatory, the breakdown of the wattage readings is on the basis that each sensor can have up to three current clamps connected to it. The total wattage from the unit is the sum of all of these channels. The ‘Now Estimated Cost’ is a value of the current figure of total wattage for that sensor multiplied by the kWh cost. The ‘Today Estimated Cost’ and ‘Today Estimated Use’ are calculated from a midnight-midnight logging of live data from the unit, this is a rough estimate. The ‘Pulse Count’ device is only for OptiSmart sensors, ignore this for the majority of applications.
The energy summary is a device that will show either ‘Low’, ‘Medium’ or ‘High’ depending on the total wattage readings. The values are by default set to be:
As this amount is going to be relative to your typical usage you are welcome to adjust these values in the devices ‘Status Graphics’ tab. You can then change the range of the device to suit, if you wish to change this then look at the value column on the left hand side of the page and change the values.
Every two hours the Envi device will output data from its own internal database. This data is stored by the plugin into another SQLite database on your HS server. This database is then used by a charts and data table web page, to look at the charts click Plug-Ins > Current Cost 3P > Charts & Data. You will then get four tab pages of data, some historic charts on the first page, a chart on the second page with data taken every minute from midnight to the current time and then two pages of day/month data stored in a table form. If no data appears in these charts then you made need to leave the plug in for a number of hours until the next history download has taken place.
It is possible to run this plugin remotely on another computer. For this to happen the contents of the HTML folder should be left in the HomeSeer HTML directory, the following files should go onto the remote computer preferably in their own folder. Please also ensure on this computer you have the Visual C++ runtime redistributable installed http://www.microsoft.com/en-us/download/details.aspx?id=5555.
The plugin should then be run by passing the IP address and COM port to the plugin like this:
C:\Plugin\HSPI_CCOST3P.exe server=192.168.0.105 port=COM7
The plugin logs data to the HomeSeer Energy API, this is in addition to the data that the plugin already logs. The plugin does this in a similar fashion to the devices that log the estimated use for the current day, this means that the values from the devices are logged on a minute timer interval and a kilowatt-hour figure calculated from these values. This data will be slightly more inaccurate owing to the fact the data is logged only every minute rather than every six seconds when new data arrives from the device itself, this is to eliminate excessive data being logged to the Energy API and to limit the system overhead.
The current API exposes a number of calls that at the present time of writing do not appear to be actually in any charting, it may be that further work is done in the future with respect to this. By default all devices are created by the plugin with the default values of the fact the Current Cost sensors will be used to measure energy consumption and they will be monitoring an electricity meter. The Energy API allows you to also measure energy production, it may be that you have a Current Cost sensor on the output of a solar array which is measuring energy inputted into your respective system. In this case you will need to change the energy settings on the device that is measuring the respective data (please note that only the total wattage and channel one to three devices will have this option available). If say Sensor 9 was being used to monitor a solar array then go into the Sensor 9 Total Wattage device and you will now have a tab on the top of the device with the plugin name in it, enter this page.
You will have a number of options in this page, the first option is simply to not log data to the Energy API. This will not remove the device from the energy web page but instead it will no longer log data when the timer runs. The second option is the direction of the energy, the only options here are to either produce energy or consume energy. If you are producing energy on this device then select ‘Produced’ rather than ‘Consumed’. The last option is that to specify what this device should represent, there appears to be no actual guidance on this at this minute but you can specify if this device is a solar panel, wind turbine or other sort of energy producer. This also has options if you have set this device as an energy consumer, options available are appliance, light, meter service or other.
Note: There appears to be some issues with adding devices to the Energy API, it appears that several restarts of the plugin may sometimes be required to allow correct registration. If the devices do not appear then please restart the plugin and also restart HS.
One method of getting these charts into HSTouch is detailed here, http://forums.homeseer.com/showpost.php?p=1164462&postcount=264
Three settings are available by creating a file called ccost3p.ini in the HS ‘Config’ directory, I anticipate that these functions will be rarely used and as such there is no option in the GUI to alter them. If you wish to change these settings the plugin will need to be re-started. Once you have created the file then add a line marked ‘[Options]’ and then below that you can add either or both of the following:
If you are happy with the way that the tables are presented then I would suggest avoiding this parameter.
JSON API & Charts
As of HS3 version 184.108.40.206 there is now a method to query plugins for specific functions by a call that will return a plugin functions return in a JSON type response. You could possibly use this to embed the charts in your own external web pages.
This is an example;
Using that you will return something similar to;
Which you can then use in a web page.
As of version plugin version .36 I now support Linux. The plugin is not in the HS updater and as such it requires a manual installation and please see the main thread for this. In the main plugin link you will find a separate version for Linux that requires a specific version of SQLite supported on Linux. Extract the contents of the zip file into your main HS working directory and enable the plugin in the normal way remembering to pass the correct Linux serial port to it.
If you have any issues with the plugin please post them here: