CurrentCost EnviR energy monitor

NOTICE: I’ve sold my CurrentCost equipment. There will be no further development of this plugin except for bugfixes that I can do without access to hardware. The source code is available at the link in the next paragraph. I am happy to transfer ownership of this plugin to anyone who wants to continue development.

Edit: UI5 and UI6 users can find this plugin at apps.mios.com; UI5 Vera firmware before 1.5.322 is not supported. You can find the plugin files at code.mios.com for manual installation.

Attached is a plugin I whipped up tonight for the CurrentCost EnviR energy monitor (Current Cost - Reducing your energy bills so you can live a greener life!). This is a wireless receiver which can display up to ten electrical wattages from transmitters. The transmitters have clamps which you wrap around A/C cables in your meter box. There are also individual appliance monitors for wall plugs.

Abbreviated installation instructions: Connect to the EnviR over a USB cable. Install the eight plugin files, create a Luup device with device file D_CurrentCostEnviR1.xml, assign the serial port to the device, reload the Luup Engine. Wait a minute for every appliance to check in, then reload the Luup engine again.

Full documentation is on the wiki.

Version 1 2011-06-09: initial release.
Version 2 2011-06-11: child devices.
Version 7 2011-06-17: history graphs on child devices.
Version 9 2011-07-02: history graph on parent device; colouring of bars in history for peak/off-peak; ready for interval-style sensors soon to be released by CurrentCost.
Version 12 2011-07-04: lots of bug fixes.
Version 17 2012-01-06: Synchronized versions on code.mios.com and apps.mios.com.
Version 22 2012-01-13: New tabs “Connection” and “Configuration” prevent most users from needing to go into the Advanced tab. Also guides setup by reporting how many appliances it has discovered.
Version 25 2012-04-06: Category numbers are now set on the devices, which makes them work in remote applications (I tested AutHomation)
Version 28 2014-04-25: UI6 compatibility

Screenshots in the next post.

Screenshots for those who are logged into the forum:

  • Panel display showing instantaneous power being consumed by the house.
  • Control tab showing the power and the current indoor temperature, as measured by the EnviR display’s inbuilt thermometer.

Great stuff! I hope you don’t mind, but I borrowed the JSON file you’d built so I could apply it to mine :wink:

Credit where it’s due: I snaffled it from @woodsby’s TED5000 plugin.

Share, and share alike… and all that :wink:

Thanks @woodsby!

New feature in changeset 7: history graphs for child devices. Screenshot attached.

One of the nice features of the CurrentCost EnviR is that it stores usage history for each appliance, in two-hour blocks. The serial protocol trickles this history down the serial port every two hours, and the plugin collects it for display in these graphs, conveniently easy to display using the Google image chart API.

Edit: Also, for other developers, this is another example of using JavaScript in tabs.

Great stuff! … and thankyou for getting a clean example out there of writing MiOS UI’s in Javascript., that’s definitely going to be a handy reference as we get into more complex Plugins or UI’s.

Nice code btw 8)

[tt]http://www.currentcost.com/download/Envi%20XML%20v19%20-%202011-01-11.pdf[/tt] adds support for electric impulse meters and [tt]uid[/tt].

Will it be possible to use with the Current Cost Bridge?

Current Cost - Reducing your energy bills so you can live a greener life!

No, it’s either/or, because the EnviR has only one serial port. Connect it to the Bridge and you can do Bridge-y things; connect it to Vera and use this plugin.

(I suppose that since the data direction is purely one-way from the EnviR that you might be able to split the serial signal off with a custom connector, feeding into both the USB cable and the Bridge. If anyone wants to give it a try, post here.)

Thanks for the link. That’s going to require a change to my fake XML parsing. Do you have (know anyone who has) an impulse sensor? They aren’t sold here so I can’t do testing.

[tt]http://www.currentcost.com/download/CurrentCost%20EnviR%20Man-Singles.pdf[/tt]

The OptiSmart Reader doesn’t seem to be available yet:
[tt]Current Cost Support Forum • View topic - Optismart For EnviR Release Date & Compatible Meters?

I have hooked up an EnviR via its USB cable to my Vera2 today. I could create the main device, and it is properly displaying how much power is being used. I also paired a second transmitter that measures my solar array production.

After a few minutes the Vera created 2 child devices, however the child device for appliance0 does not work (it does not display any value), the child device for the solar array appliance works fine.

Any idea what can cause the child device for applaince0 to fail?

I noticed a coding bug last night when I was adding new features to the plugin, and I fixed it. I think that your bug is the same one. Try downloading the most recent version (11) of all of the files (there are now eight files), and let me know if it fixes the problem.

Thanks so much for reporting this bug. You’re my first tester so you will probably find more.

Great work futzle, you nailed it…

Another minor thing I noticed is that when entering the history tab the first time, it keeps displaying “Opening History”. When I switch to any of the other tabs and then back to the history tab, it displays the 2 hourly and daily graps normally.

What extra features are you planning for?
Is it possible to add the total Kwh measured and the associated cost into the child devices?

I have a CurrentCost Dev board and plan to use it to measure my gas meter.
[url=http://currentcost.posterous.com/how-can-i-use-a-dev-board]http://currentcost.posterous.com/how-can-i-use-a-dev-board[/url]
Do you think a child device thats measuring gas usage can be adopted to display m2 gas and its cost?

Thanks!

Some observations from your second tester:

Please note that I’m using the all white data cable.

[ul][li]Windows 2k, Windows XP: could not get the virtual serial port working with the drivers supplied by CurrentCost ([tt]http://www.currentcost.com/software-downloads.html[/tt]). Symptom: “error code 10” ([tt]http://www.prolific.com.tw/eng/FAQs.asp?ID=50[/tt]). A preinstalled Holux GPS serial port driver did the trick for Windows XP …[/li]
[li]Vera V2@1.1.1298: has no problems with detecting the PL-2303 (don’t forget to the set the baud rate …)[/li]
[li]Days since birth is 65535. Let’s wait for the next day …[/li]
[li]History tab does not work. Let’s wait for the first history report from the device …[/li]
[li]Temperature is off by 3 °C[/ul]

It’s a known issue with JavaScript tabs. Several MCV people have posted here saying that it will be fixed Real Soon Now.

What extra features are you planning for?

I’m going to let you change the horizontal scale of the history graphs, so you can show more or less than the last 7 days of two-hourly history data if you prefer, similarly for the daily and monthly history graphs. The only limit is the length of the URL to the Google Chart Images server.

I’m going to let the user copy the history into the clipboard as CSV, for transfer into other, more capable, graphing tools.

I’m going to put another configuration tab onto the parent device to save users from having to mess with the Advanced tab to customize the plugin’s features.

I’m going to figure out what the heck to do with these newfangled CurrentCost impulse meters. There isn’t really any precedent in the Vera world, and the EnergyMonitoring device isn’t really suitable for devices with cumulative energy measurement rather than instantaneous power measurement.

Is it possible to add the total Kwh measured and the associated cost into the child devices? Do you think a child device thats measuring gas usage can be adopted to display m2 gas and its cost?

Ohboy, I was hoping no one would ask those questions. So far my philosophy with this plugin has been to only display stuff that comes from, or can be derived solely from, the EnviR panel. Keeping it stateless, if you will. Keeping a running total of kWh is bringing scary thoughts into my head of integration of power over time… Besides, MCV’s online service does this already, doesn’t it?

Cost? That’s astonishingly difficult. Every electricity supplier in the world seems to have their own weird tariffs. In my state, for instance, one ignores daylight saving for time-of-use tariffs and the other four do.

I’m not saying “no, I won’t do that”; I’m saying “I won’t do it badly”. I’d like to bring in other interested people to make sure that it gets done consistently and correctly for all energy metering scenarios.

Thanks for the info Ap15e; I’ve updated the code.mios.com page with your comments.

The DSB will roll over to 0 tomorrow. I found it rather humorous that it shows 65535 on the day you set it up.

Let me know if the history tab doesn’t populate after four hours. It is supposed to print a “no history” message, so there is some bug there.

History tab doesn’t populate (Win 2k SP4/Win XP SP3, Firefox 5.0).

Home Care plugin is working.

Thanks fuzle,

I am a hardware guy that is trying to keep up with you software magicians, im already more than happy with both child devices working propely now…don’t worry…

That brings the following thought to my mind however; how on earth with 1.6 million EnviR owners is it possible that i am the first one asking, is the group of Vera2 enthousiasts really that small…?