We have moved at community.getvera.com

Author Topic: CurrentCost EnviR energy monitor  (Read 113305 times)

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
CurrentCost EnviR energy monitor
« on: June 09, 2011, 08:25:16 am »
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 (http://www.currentcost.com/product-envir.html).  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.
« Last Edit: February 10, 2015, 03:44:32 pm by futzle »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CurrentCost EnviR energy monitor
« Reply #1 on: June 09, 2011, 08:27:26 am »
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.
« Last Edit: June 17, 2011, 06:41:14 am by futzle »

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: CurrentCost EnviR energy monitor
« Reply #2 on: June 10, 2011, 12:47:43 am »
Great stuff!  I hope you don't mind, but I borrowed the JSON file you'd built so I could apply it to mine  ;)

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CurrentCost EnviR energy monitor
« Reply #3 on: June 10, 2011, 05:25:43 am »
I borrowed the JSON file you'd built so I could apply it to mine

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

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: CurrentCost EnviR energy monitor
« Reply #4 on: June 10, 2011, 09:39:43 am »
Share, and share alike.... and all that ;)

Thanks @woodsby!

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CurrentCost EnviR energy monitor
« Reply #5 on: June 17, 2011, 06:36:51 am »
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.
« Last Edit: June 18, 2011, 08:11:34 pm by futzle »

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: CurrentCost EnviR energy monitor
« Reply #6 on: June 18, 2011, 11:13:01 am »
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)

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: CurrentCost EnviR energy monitor
« Reply #7 on: June 29, 2011, 01:10:16 pm »
http://www.currentcost.com/download/Envi%20XML%20v19%20-%202011-01-11.pdf adds support for electric impulse meters and uid.

Offline mhjens

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +0/-0
Re: CurrentCost EnviR energy monitor
« Reply #8 on: June 29, 2011, 04:38:19 pm »
Will it be possible to use with the Current Cost Bridge?

 http://www.currentcost.com/product-bridge.html

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CurrentCost EnviR energy monitor
« Reply #9 on: June 29, 2011, 05:35:30 pm »
Will it be possible to use with the Current Cost Bridge?

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.)

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CurrentCost EnviR energy monitor
« Reply #10 on: June 29, 2011, 05:50:22 pm »
http://www.currentcost.com/download/Envi%20XML%20v19%20-%202011-01-11.pdf adds support for electric impulse meters and uid.

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.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0

Offline Jackpost

  • Sr. Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
Re: CurrentCost EnviR energy monitor
« Reply #12 on: July 02, 2011, 02:51:01 pm »
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?

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CurrentCost EnviR energy monitor
« Reply #13 on: July 02, 2011, 07:09:52 pm »
the child device for appliance0 does not work (it does not display any value), the child device for the solar array appliance works fine.

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.

Offline Jackpost

  • Sr. Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
Re: CurrentCost EnviR energy monitor
« Reply #14 on: July 03, 2011, 05:57:43 am »
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.
http://currentcost.posterous.com/how-can-i-use-a-dev-board
Do you think a child device thats measuring gas usage can be adopted to display m2 gas and its cost?

Thanks!