Vera - Smarter Home Control Forum

Advanced => Programming => Plugins & Plugin Development => Topic started by: robertmm on May 09, 2013, 01:09:34 am

Title: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on May 09, 2013, 01:09:34 am
To update, upload the files and "reload". To install, see below.
=====================================

CURRENT VERSION:

Version 0.4: Added link status display and link status change notifications

=====================================

HISTORY:

Version 0.3: Should work with old and new firmware revisions of the Eagle, and can handle negative values in the "Demand" variable.

Version 0.2a: Same as 0.2, but works with the Eagle v2 firmware.

Version 0.2: Display From/To Grid and Net (rounded to nearest Wh). The MeteringType variable can be changed to 0, 1, 2 to forward either of these values to Vera's energy measurement service. On startup, don't modify the WholeHouse and ActualUsage variable in case someone wants to modify them.

Version 0.1: Show Energy to grid, and add link strength to dashboard view

Version 0.0: This is a plugin for the Rainforest Automation EAGLE HAN Gateway.

=====================================

INSTALLATION:

Upload all files under Apps -> Develop Apps -> Luup files

Then, Apps -> Develop Apps ->  Create device
with the following parameters:
Device type = urn:schemas-smartmeter-han:device:SmartMeterHAN1:1
Description = Eagle
Upnp Device Filename = D_SmartMeterHAN1.xml
Upnp Implementation Filename = I_SmartMeterHAN1.xml
Ip Address = <IP of your Eagle>
[Create device]

Then, Reload and it should create the plugin device.

On first run, the plugin tries to discover the device's MAC ID which is then stored for future use. It implements the WholeHouse (optional) and ActualUsage variables and does show up under "Energy". The plugin sets three variables named "KWHDelivered", "KWHReceived" and "KWHNet". "MeteringType" selects which one of them is stored in "KWH" (0 = delivered, 1 = received, 2 = net).

There's a possibility that the time zone is wrong unless you're in Texas (the Eagle seems to live in Pacific time zone, but the meter is in UTC I think), please let me know.

=====================================

This is a minor revision from the version originally posted over at http://forum.micasaverde.com/index.php/topic,14039.0.html
I removed some unnecessary variables and changed one XML file to not throw up when DeviceSpy is scanning it.

As a side note, the Texas distributor for the Rainforest Automation products has spent a lot of time helping me getting the Eagle to work, so all things being equal (including price) why not order from Steve Brightman at swesmarts.com (and tell him you're giving him your business because he helped me).
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on May 09, 2013, 01:33:56 am
Looks like they are out of stock though...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on May 10, 2013, 09:56:09 am
@strangely: I asked and of this morning they had one left (after that one, another one or two weeks). I'd call them.
Edit 10 AM: Last one gone
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on May 10, 2013, 12:03:59 pm
I modified the plugin to display the "Delivered", "Received", and a locally calculated "Net" (see image). The new variable "MeteringType" allows to select which one of the three gets forwarded to Vera's energy measurement service. You can now also turn off the WholeHouse variable.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: Brientim on May 11, 2013, 03:26:08 am
Looks like they are out of stock though...

They were always out of stock for AU models. I sent them an email asking when they would be available and the next day it was available... Problem was I had been waiting and not asking the question or so it appears and it was being sent yesterday.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on May 11, 2013, 03:28:21 am
Guess I should try to call them then :)
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: Brientim on May 11, 2013, 03:48:03 am
Yes, and it seems like a funny way they have to sell your stock - never available online...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on May 11, 2013, 04:04:03 am
I've held off buying for that very reason. I kind of object to paying high shipping costs and tax also since the eagle already carries a large premium over the EMU and raven etc.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on May 28, 2013, 11:35:39 pm
Anyone have a issue pairing their Eagle? I'm not on my third attempt with SCE, and I'm pretty sure this is going to be waste of time again :(
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on May 28, 2013, 11:46:13 pm
@strangely: someone at the Green Mountain Energy forums said it started working for him when he registered the device as a display instead of a gateway. YMMV.
I needed two tries myself but it's been solid since (except for the non-functional 'history' screens).
I did move the device further away from Vera's antenna (put on an external antenna with a long cable) and that improved the 'link' status. I wonder whether there was interference between zigbee and zwave!?

Failing all that, i'd suggest you call or email rainforest support. I've gotten responses on weekends and late at night, they're pretty good about that.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on May 29, 2013, 12:24:52 am
I had no choice but to register it as a display since that was the closest option with SCE as a rainforest device. Gateways are listed, but there are no rainforest ones from their management website.

I spoke with a human earlier again and she said that the Eagle was a supported device, and she adjusted it.

Anyway, 7 hours later and its still not linked at the moment... hating this already :(
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on May 31, 2013, 08:59:48 pm
Third attempt at registering this thing and its still not working :( It got further this time since the SCE website shows it registered, however the Zigbee light 48 hours later is still not solid.

Not very impressed with Rainforest support either since they haven't gotten back to me via email, and I don't see a way to be able to call them.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on June 11, 2013, 01:44:19 am
Finally all up and running now after a firmware update to the Eagle and fourth registration attempt :)

Plugin seems to be working OK, although I did notice this morning in SQ remote there was a very large number that could not have been correct. Will look out for it again and try to capture the log.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on June 26, 2013, 04:49:23 pm
I ordered from Southwest Energy Smarts, and have the Eagle up and working with my Oncor meter and the plug-in from this thread.

So far not sure what all I can do with it...

Thanks for writing the plug-in!
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on June 26, 2013, 05:03:07 pm
Is there any way to get this device to display correctly on AutHomation or Vera Mobile, or...?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on June 26, 2013, 06:34:21 pm
It shows up in Automator and HomeWave. Please let me know if there's anything I need to change in the plugin to make it compatible (I have neither AutHomation nor Vera Mobile).

Is there any way to get this device to display correctly on AutHomation or Vera Mobile, or...?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: garrettwp on June 27, 2013, 02:06:02 am
It shows up in Automator and HomeWave. Please let me know if there's anything I need to change in the plugin to make it compatible (I have neither AutHomation nor Vera Mobile).

Is there any way to get this device to display correctly on AutHomation or Vera Mobile, or...?

I would need to add support for this plugin. The developer of the 3rd party apps would need to add support for any 3rd party plugins.

- Garrett
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on June 27, 2013, 12:02:09 pm
I would hope this plug-in and the Rainforest Eagle product it supports will start selling like hotcakes.  For anyone with a Zigbee smart electric meter, this is a lot cleaner (in my opinion) than the clamp-on whole house energy meters, and obviously the usage numbers will match your electric billing since it comes from the meter itself...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on August 07, 2013, 02:52:32 pm


I would need to add support for this plugin. The developer of the 3rd party apps would need to add support for any 3rd party plugins.

[/quote]

Could a donation encourage that?  I see you (and others) working hard on these MCV projects, but have not seen any donation opportunities....

In truth I can use Bidgely's or the Rainforest's own android app to view the electrical usage data, but it would be nice to have it in one place...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on January 27, 2014, 10:37:27 pm
I uploaded a slightly modified version of the plugin (0.2a) that works with the latest Eagle firmware.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: j9brown on January 28, 2014, 06:13:35 pm
Thank you so much for creating this plugin!  I was wondering how I would hook up my SmartMeter.  It will be so much more convenient than my old TED5000 was.

Currently awaiting activation from PG&E...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on January 30, 2014, 02:16:08 am
I uploaded a slightly modified version of the plugin (0.2a) that works with the latest Eagle firmware.
Cool thanks.

I just had mine updated (Zigbee and HTTP interface) and as soon as I can get it linked to my meter again (took 4 attempts last time), I'll give it a try.

By the way, I mentioned this before, but during the day when my solar panels are generating and pushing out to the grid (I hadn't mentioned the solar panels previously), the displayed wattage number is very large. Anyway, Its not just SQ remote that does this (as I'd mentioned before), as Vera displays the same large number.

As soon as I'm pulling power (night time etc), then its normal.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on January 30, 2014, 09:23:13 pm
@strangely: Is only the wattage number wrong? Could you send me the wrong number and the correct number (from the Eagle web UI)? I suspect it's because the correct number should be negative, and the conversion doesn't consider that (I don't have power generation unfortunately so I can't try). That would be an easy fix.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on January 30, 2014, 10:32:17 pm
Yep it's only the wattage number. It's still not linked up yet, so it might be a while based on last time :)
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on January 31, 2014, 12:26:11 am
When you get it running, please do this (replace IP.OF.YOUR.EAGLE and 0xEAGLESMACADDRESS with your own):

telnet IP.OF.YOUR.EAGLE 5002
<LocalCommand>
<Name>get_device_data</Name>
<MacId>0xEAGLESMACADDRESS</MacId>
</LocalCommand>

Then record what it says under "<Demand>0xZZZZZZ</Demand>" I think I've got a solution, but need to know how long the "ZZZZZZ" number is for you (in my case, 6 digits or 24 bits).
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on February 08, 2014, 01:21:46 am
I've uploaded a new version that should be able to deal with negative demand (wattage) values. It also uses a "real" parser, and smarter number conversion, so hopefully will be more robust if the firmware changes again.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on February 08, 2014, 01:32:17 am
Thanks, will try it tomorrow when the sun is shining again. Just noticed the damn thing has finally paired again.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on February 08, 2014, 01:27:21 pm
Yet another small update that shows the link status (Connected/Rejoining/Unknown) and supports notifications based on that (my Eagle keeps disconnecting every 10 days or so and doesn't automatically link up with the meter unless I reprovision)
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on February 08, 2014, 06:36:53 pm
my Eagle keeps disconnecting every 10 days or so and doesn't automatically link up with the meter unless I reprovision

Ouch, was this since the new Eagle firmware update? I hope I don't have to go through this with SoCal Edison, since its not an easy process to do.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on February 08, 2014, 06:58:53 pm
my Eagle keeps disconnecting every 10 days or so and doesn't automatically link up with the meter unless I reprovision

Ouch, was this since the new Eagle firmware update? I hope I don't have to go through this with SoCal Edison, since its not an easy process to do.

No, it's always done that. I have been unable to figure out why. The distance to the meter is well within spec, and the link strength (when it's working) is always 100%. The location doesn't seem to matter either - it just won't rejoin the meter (even when only a foot away from the meter).  Support doesn't have a fix either. At least we have a web site where reprovisioning is easy (but like for you it sometimes takes a few tries). Suspect the meter firmware at this point.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on February 10, 2014, 01:10:43 pm
@robertmm,

Looks like everything is reporting correctly now along with the other changes you've incorporated.

Thanks!
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on February 25, 2014, 04:14:46 pm
I just built a notification on this plug-in in order to try to tell when the power is out.  My first attempt was to trigger on <10 Watts of usage, thinking maybe the meter still responds during a brief outage.

Just a minute ago it alerted - but when I logged into the VERA GUI all the readings were "nan".  Power, From Grid, to Grid, Net - they all displayed the alpha "nan".

Maybe a message was sent?  I haven't updated to the latest code or firmware (unless the firmware was pushed to the Eagle, I guess...)
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on February 25, 2014, 04:20:33 pm
nan is "not a number". Did your Eagle have power loss too?
If you do the following from the command line (replace IP.OF.YOUR.EAGLE and 0xEAGLESMACADDRESS with your own), we could try to force "usage" to 0:

telnet IP.OF.YOUR.EAGLE 5002
<LocalCommand>
<Name>get_device_data</Name>
<MacId>0xEAGLESMACADDRESS</MacId>
</LocalCommand>


I just built a notification on this plug-in in order to try to tell when the power is out.  My first attempt was to trigger on <10 Watts of usage, thinking maybe the meter still responds during a brief outage.

Just a minute ago it alerted - but when I logged into the VERA GUI all the readings were "nan".  Power, From Grid, to Grid, Net - they all displayed the alpha "nan".

Maybe a message was sent?  I haven't updated to the latest code or firmware (unless the firmware was pushed to the Eagle, I guess...)
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: thegazelle on March 04, 2014, 09:47:39 am
Can anyone confirm if this interfaces with the DataMine plugin? I can't see why DataMine wouldn't work but wanted to confirm.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on March 12, 2014, 05:36:56 pm
What changes would be needed to get the usage monitored in EventWatcher?  I think the Device Category Needs to be "M" AKA "21", but I don't know what controls the category...

http://wiki.micasaverde.com/index.php/Luup_UPNP_Files#Device_Categories
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: robertmm on March 12, 2014, 10:24:10 pm
Can anyone confirm if this interfaces with the DataMine plugin? I can't see why DataMine wouldn't work but wanted to confirm.

Yes it works with DataMine
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: tagyoureit on April 28, 2014, 12:09:09 am
Hi,

I am very excited, and grateful, to have found this thread.  I am a brand new VeraLite user and primarily want this to help control my energy costs, and secondarily to automate my home.  I already received some of my modules (mostly Aeotec smart switches) and discovered some key energy uses.  I also have two of the Aeotec Z-Wave Smart Energy meter (one 1st and one 2nd edition) on order (will be here very soon).  However, I have 400 amps  coming into my house currently divided  into 100A/100A/70A/50A (distr box, distr box, pool, A/C).  If you don't know the specs of the Aeotec by heart, it is limited to 100A.  So I would need to order another 2 (for 4 total) at $80 to $100 each just to monitor my home energy.  I started looking at other solutions (mostly through the forums) and went through NorthQ, YouLess, Ergy, Brultech... finally I came across this thread which lead me to the Rainforest Eagle and my compatible PG&E (Northern California) AXR-SD compatible meter.  And I can enable it completely through the web with PG&E.  I ordered the Rainforest Eagle tonight on Amazon with 2 day shipping.

I am super excited to receive this.  It saves me money, has a direct connection to my electric meter, and I'm looking forward to the next step: data analysis!  Much thanks to @robertmm and I would likewise (@wilme2) be happy to make a donation for this plug-in to continue support/development. 
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: tagyoureit on April 30, 2014, 01:41:57 am
Hey all,
So my Rainforest Eagle arrived today!  Setup was actually really easy.  I was able to pair the unit through the PGE.com website in about 5 minutes and the signal says it is really strong which is surprising because it feels far away... kudos to Zigbee. 

So everything seems to be logging well except... every 10-12 minutes if I have the UI open the Eagle device stops recording the data.  I went out of the house for 3+ hours and it recorded fine, and then I opened the UI again and it stopped recording shortly thereafter.  See screenshots... any advice?  I have tried different settings for the pulse time but it doesn't seem to make a difference.

If I click 'reload' on the UI it comes back again, but otherwise it just goes to sleep after a little while.
thanks!
Russ
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on April 30, 2014, 02:27:06 am
Sorry to answer questions with questions:

Do you use any of the cloud services like Bidgely that you could correlate this against?
What are you using to log with currently? Perhaps we can use the same check if the behavior is the similar!?

Also what software versions do you have in your Eagle? I had mine updated by Rainforest a few months back, so perhaps this will have a bearing.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: tagyoureit on April 30, 2014, 02:55:30 am
Sorry to answer questions with questions:
No worries!

Do you use any of the cloud services like Bidgely that you could correlate this against?
What are you using to log with currently? Perhaps we can use the same check if the behavior is the similar!?
Also what software versions do you have in your Eagle? I had mine updated by Rainforest a few months back, so perhaps this will have a bearing.
I do not have this hooked up to any cloud services (yet).  I am using the rainforest UI and watching the numbers change there and they get stuck in the Vera UI.  I then go to the dataMine plugin (previous attachments) and can see that there has been no change in the data (either kWh or watts) for the same period of time.

These are the Eagle firmware versions:
HW   1.2.3
FW   2.0.24
ZB   1.4
RFA ID   20131030.40 (6200)

Russ
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: strangely on April 30, 2014, 11:28:48 am
So it does look like there are some differences as mine is:

HW   3.2.3
FW   2.0.20
ZB   1.4

I will try the same on mine within a couple of days or so to see if I can reproduce this. If I cant then I guess its likely that its some sort of issue you'll need to raise to RainForest against your versions.

I think having it log to Bidgely or somewhere else (cant remember what the other choice is) will give you better idea to pinpoint if its a Vera or RainForest issue.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: tagyoureit on May 01, 2014, 07:08:50 am
I didn't respond the last couple of days because it seemed to be working pretty well, but then I noticed something odd in the Datamine logs.  The watts appeared to have stop recording even though the total kWh is still working properly.  Not sure if this would be an eagle device issue or Datamine issue (I'm actually guessing the latter, as I _can_ see the watts changing in the device tab).
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: poohbah on July 29, 2014, 10:30:25 pm
Thank you for this plugin. I just received my Eagle and it's paired up with the utility company and the Vera.

It would be great if more useful information could be added from this plugin to automationHD. Currently, it appears that automationHD just shows a question mark on the tile and doesn't show any wattage information or anything else on the tile, and it just dumps all of the data from the plugin when clicked (which is much better than nothing, but not perfect).
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on September 09, 2014, 01:14:07 pm
Just wondering if this plug-in has been tested on UI7?  I am not in ANY hurry to upgrade, but checking on some of the plug-ins I use that haven't been discussed on the UI7 threads...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: shay on July 14, 2015, 11:17:15 pm
robertmm, thank you for the information about Oncor.  I had the 1000X usage and was able to get it corrected with your help.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: rkaplins on July 21, 2015, 04:18:28 pm
I am having trouble trying to follow the steps in the installation process.  I can upload the files and create the device.  However after the device is created, I get stuck.  When you say "reload" do you mean refresh/reload the webpage?  I don't see a reload button (using UI7).  I tried searching for the plugin under "Install Apps" and didn't find anything.

I am pretty sure it must be my mistake, I just don't know what to do.

Thanks in advance.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: Vaggeto on August 21, 2015, 03:05:52 am
I just wanted to thank you for this.

I got the Rainforest Eagle recently after reading this thread and I'm delighted to say I now can see my live data through my veralite!

Thanks!
Title: Rainforest Eagle Smart Meter HAN Gateway Plugin UI7 display & Tracking Data
Post by: BigE-TX on January 07, 2016, 11:21:40 am
Thank you for the app. ;D 

Merry xmas [thanks mom]to me -the new owner of an Eagle tied into my Texas SmartMeter and displayed via Vera Edge. 
3 questions around display and practical use: 
1) Thus far, it ONLY displays in the Vera app [mobile and PC] + Rainforest's Cloud app; no go on Imperihome Pro nor the no longer maintained Authomation HD app.  Likely requires further prog'g.  If so, perhaps I'll see if I can link a window in Imperihome Pro to the RainForest Eagle URL which I think it can do.
2) Edge display [under UI7] is different than what's in this thread -perhaps due to UI7 OR did I do something incorrectly?  How might I [LUUP newbie here] tweak Luup code eliminating the decimal portion of the displayed numbers?  Do fields only display what is in their variable field or can a field be formatted to exclude display of decimals?  Or would it be difficult to add a tick box to include or exclude display for the "to grid" and "net" amounts that frequently go unused.  Please don't take this as critiquing. It's great having this display in my Edge; I'm simply not familiar with the intricacies of LUUP programming yet.  And I may wind up needing the decimal number portion, depending on answers to my next question.
3) Simple to use graphing/tracking of the above information.  Was hoping to have Bidgely, but their response to my email said to contact my energy provider as they no longer work with end users.  Inquiries about which energy providers in de-regulated Texas market they worked with was met with a refusal to divulge client information -probably means none.  I see there is data-mine, data yours, and event watcher, but I am not sure what's stable in UI7 and easy to work with for a novice.  Would like to track and graph energy use so i can see a picture of my consumption.

THANK YOU.
Title: Re: Rainforest Eagle Smart Meter HAN Gateway Plugin UI7 display & Tracking Data
Post by: CudaNet on January 07, 2016, 12:24:32 pm
[1] I use this in Homewave and it displays the necessary values (one which you select) from the HEM.
[2a] Yes, UI differences between 5 and 7.
[2b] Why do you want to remove the precision ? Just curious. If it's for display then see answer [1] as you can select what's displayed.
[3a] Lua's math.ceil(x) or math.floor(x) will adjust the value up or down where x is the variable your operating against.
[3b] I'm surprised that Bidgely has taken this position. I have an account but rarely use it. If you're interested in plotting usage then you have other options.


Hope this helps

Thank you for the app. ;D 

Merry xmas [thanks mom]to me -the new owner of an Eagle tied into my Texas SmartMeter and displayed via Vera Edge. 
3 questions around display and practical use: 
1) Thus far, it ONLY displays in the Vera app [mobile and PC] + Rainforest's Cloud app; no go on Imperihome Pro nor the no longer maintained Authomation HD app.  Likely requires further prog'g.  If so, perhaps I'll see if I can link a window in Imperihome Pro to the RainForest Eagle URL which I think it can do.
2) Edge display [under UI7] is different than what's in this thread -perhaps due to UI7 OR did I do something incorrectly?  How might I [LUUP newbie here] tweak Luup code eliminating the decimal portion of the displayed numbers?  Do fields only display what is in their variable field or can a field be formatted to exclude display of decimals?  Or would it be difficult to add a tick box to include or exclude display for the "to grid" and "net" amounts that frequently go unused.  Please don't take this as critiquing. It's great having this display in my Edge; I'm simply not familiar with the intricacies of LUUP programming yet.  And I may wind up needing the decimal number portion, depending on answers to my next question.
3) Simple to use graphing/tracking of the above information.  Was hoping to have Bidgely, but their response to my email said to contact my energy provider as they no longer work with end users.  Inquiries about which energy providers in de-regulated Texas market they worked with was met with a refusal to divulge client information -probably means none.  I see there is data-mine, data yours, and event watcher, but I am not sure what's stable in UI7 and easy to work with for a novice.  Would like to track and graph energy use so i can see a picture of my consumption.

THANK YOU.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on January 07, 2016, 02:08:28 pm
Strange about Bidgley.  Maybe a future Eagle firmware update can support new cloud providers...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: BigE-TX on January 07, 2016, 02:13:42 pm
Chuckling to myself...
This what I get for abandoning Apple after we grew out of our Apple2+ with floppy drives and I moved to TRS80s and became a DOS convert ;) and eventually Windows on  home built PCs.  I simply haven't had the ambition or the money to pony up for anything Apple other than Apple TV2 to use with XBMC - which is no longer updateable either.  No doubt the two apple IOS apps [Homewave and Automator] interface fine with the Eagle Luup code.  I'll play with this a bit to see what I come up with and appreciate everyone's quick reply...truly.

Was hoping someone with Android devices had worked through a similar experience and might respond so I'm not re-inventing the wheel.  I understand Garrett moved to a more opensource platform and I wouldn't want him to invest anymore time in updating his app at this point.  I will try the folks at Imperihome if I cannot get it to access via a URL somehow.

I was thinking about AltUI, but it simply wouldn't fit on my choking Veralite, the edge seems to be much more stable since upgrading [more available resources...ie memory no doubt].  I will readup on ALtUI.

Again, thanks all.  Garrett thank you for your prior work on on your app.  I enjoyed using it while I was growing with my new VeraLite.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on January 07, 2016, 02:22:12 pm
You know on AutHomation you can get the KWH reading by holding the "?" tile and pressing the information button, but obviously that isn't clean at all.  But it will let you see the reading if you really need it...

I have downloaded Imperihome, but haven't tried to add in the KWH yet...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: BigE-TX on January 07, 2016, 02:23:15 pm
RainForest has updated Eagle firmware several times.  The new unit I received from them this week req'd 4 incremental firmware downloads to get to the latest version - one so new their website didn't even list what it addressed.  The Eagle allows for 3 default cloud services in addition to their own, plus you incorporate any that you know of by entering their URL. 

Bidgely seems to be the only one in the US using backend software to do disaggregation and reporting on the cloud data they get.  I did invest some money in a Indiegogo project overseas where they are working on something similar and hope to see what comes about, but it lacks the simplicity of connection that the Eagle unit possesses which may be a dealkiller.  I am considering Bluedot.com to see what they can provide for rates before my electric provider comes up for re-evaluation in May 2016.  Have yet to find a single review of them other than a DFW,TX news piece on youtube.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: CudaNet on January 07, 2016, 02:24:44 pm
Good point, I remember seeing at least 1 other option if not 2 the last time I looked at the Eagle web config.

Strange about Bidgley.  Maybe a future Eagle firmware update can support new cloud providers...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: BigE-TX on January 07, 2016, 02:26:40 pm
You know on AutHomation you can get the KWH reading by holding the "?" tile and pressing the information button, but obviously that isn't clean at all.  But it will let you see the reading if you really need it...

I have downloaded Imperihome, but haven't tried to add in the KWH yet...

Thanks.  I didn't know that about the question mark. 
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: CudaNet on January 07, 2016, 02:28:52 pm
Good info, didn't realize it now did that...

plus you incorporate any that you know of by entering their URL. 
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: fcol on January 07, 2016, 05:30:11 pm
Good point, I remember seeing at least 1 other option if not 2 the last time I looked at the Eagle web config.

Strange about Bidgley.  Maybe a future Eagle firmware update can support new cloud providers...
Bidgely also didn't provide any support for me during the summer of 2015.  I ended up contacting Rainforest support and they were able to push the Bidgely configuration to my device. Edit: I already had a Bidgely account linked to my energy provider (I'm not sure if they're creating new accounts for individuals).
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: OzCamper on February 09, 2016, 06:04:52 am
Love this Plugin. Many thanks to the coder. For all those Imperihome and AutHomation users. Install the Power Arithmetic plugin from the vera app store. Power Arithmetic will take the power reading from the Smart Meter HAN Gateway Plugin device and Power Arithmetic is identified by both Imperihome and AutHomation as a power meter.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: thegazelle on February 09, 2016, 01:52:35 pm
Good point, I remember seeing at least 1 other option if not 2 the last time I looked at the Eagle web config.

Strange about Bidgley.  Maybe a future Eagle firmware update can support new cloud providers...
Bidgely also didn't provide any support for me during the summer of 2015.  I ended up contacting Rainforest support and they were able to push the Bidgely configuration to my device. Edit: I already had a Bidgely account linked to my energy provider (I'm not sure if they're creating new accounts for individuals).

I believe they stopped taking on new residential customers around the time they got a decent round of funding from several utility investors. I think that the free consumer offer was a proof of concept that they could show to utilities and whatnot, because that's where the money in this is.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: norcalhkr on March 31, 2016, 12:49:23 pm
I just tried installing the plug in (thanks for creating this!) and I am getting the "ERROR: Device not ready". The device has been created and I can see it but it shows all 0's at the moment. Any suggestions of where to start to resolve?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on March 31, 2016, 01:31:42 pm
I just tried installing the plug in (thanks for creating this!) and I am getting the "ERROR: Device not ready". The device has been created and I can see it but it shows all 0's at the moment. Any suggestions of where to start to resolve?

Do you know your Eagle is paired to your electric meter?  If you log directly into the Eagle do you get the current energy readings?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: norcalhkr on March 31, 2016, 01:37:48 pm
Do you know your Eagle is paired to your electric meter?  If you log directly into the Eagle do you get the current energy readings?

Thanks for the quick reply, the eagle has been connected to my meter for about 6 months, I also cloud connect to wattvision and have had very solid results and connections (currently the cloud is reading what my meter is showing) I do have solar on my system as well, not sure how that plays.

One thing I was thinking is did I possibly use the wrong IP Address? I used the one from logging in to the rainforest website and clicking on the gateway then under settings --> internet --> IP address and Mac Address.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on March 31, 2016, 01:53:40 pm
I can't log into my Eagle from where I am now, but you will want to assign a static IP address.  Either in the Eagle, or in your DHCP server (likely your router).

You will want the local IP of the Eagle.  Likely in the range of 192.168.x.x...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: norcalhkr on March 31, 2016, 02:05:30 pm
I can't log into my Eagle from where I am now, but you will want to assign a static IP address.  Either in the Eagle, or in your DHCP server (likely your router).

You will want the local IP of the Eagle.  Likely in the range of 192.168.x.x...

I tried looking for it on my network this am and didn't see it on the router, I might have to move it to a different switch to see it pop up so I can assign it a reservation. If anyone has ideas why it might not be easy to see I am all ears :)

Is it possible it has a different local mac address?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: CudaNet on March 31, 2016, 03:13:45 pm
Isn't there a URL on the underside of the device for local web access ?

I can't log into my Eagle from where I am now, but you will want to assign a static IP address.  Either in the Eagle, or in your DHCP server (likely your router).

You will want the local IP of the Eagle.  Likely in the range of 192.168.x.x...

I tried looking for it on my network this am and didn't see it on the router, I might have to move it to a different switch to see it pop up so I can assign it a reservation. If anyone has ideas why it might not be easy to see I am all ears :)

Is it possible it has a different local mac address?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on March 31, 2016, 04:44:19 pm
On my router I can see it in the DHCP clients table.  Has "eagle" somewhere in the device name, I think...

I rarely have luck with local web access URLs, but definitely try that too-
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: norcalhkr on March 31, 2016, 11:19:45 pm
On my router I can see it in the DHCP clients table.  Has "eagle" somewhere in the device name, I think...

I rarely have luck with local web access URLs, but definitely try that too-

No luck on the web access URL (sure enough it was on the bottom) and I did finally track it down via the vera plus when trying to add a new IP camera, go figure... In my DHCP router is was a very obscure name and nothing to do with the eagle.

So I put the right IP address in and I am still getting the cant find device error. Any other ideas?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: norcalhkr on April 01, 2016, 12:09:02 am
Here is the error given by the LUUP code

SmartMeterHAN1 : HAN device not found. Verify connection and IP address.

I am able to access the device via the cloud and through wattvision API
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on April 01, 2016, 12:12:53 am
But until you can access via the local IP address, I think that needs to be your focus.

Sent from my SM-G900V using Tapatalk

Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: norcalhkr on April 01, 2016, 12:22:42 am
But until you can access via the local IP address, I think that needs to be your focus.

Sent from my SM-G900V using Tapatalk

We have lift-off, it helps when you finally get the right IP address. Ended up resetting the device and watching for the IP to disappear and there you go, identified the current IP. (Reserved in router as well)

Thanks for you help!

Also can you help with the settings for the update pulse?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on April 01, 2016, 12:25:04 am
Pulse is seconds between readings, I think.  Mine is set to 60...

Sent from my SM-G900V using Tapatalk

Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: norcalhkr on April 01, 2016, 12:34:25 am
Pulse is seconds between readings, I think.  Mine is set to 60...

Sent from my SM-G900V using Tapatalk

Thanks I guessed that is what it would do but thought I should be a bit more sure, now to figure out if we want to do anything with it...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 30, 2016, 01:23:53 pm
This plugin works fairly well for me, but every hour or two I get 'nan' for most of the values.  This isn't too much of a problem, but it seems to mess up the graphing within the AltUI.  So I became curious as to what is going on.  So far, I see that most of the values coming back from the parsexml are 0's as seen by the luup.log calls that I uncommented and added.  Interestingly, 'xdelivered' is not 0 in this case, but the xtimestamp is.  I'm not sure, but it seems that the code is trying to block bad results by using the "if (xdemand and xtimestamp and xmult and xdiv) then", but that still passes in this case since the values are not nil.  As a short term fix, I'm thinking of checking to see if the xtimestamp is 0 and returning with an error if it is.

Has anyone else seen this?  Any suggestions for further debug?  I'm thinking of uncommenting this line:

-- luup.log("Got XML: " .. xml, 1)

I'm assuming that will print out the xml that came back.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on November 30, 2016, 01:56:23 pm
Are you using the latest code?  Nan was previously resolved, I thought...

Sent from my SM-G900V using Tapatalk

Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 30, 2016, 02:46:39 pm
I'm using the code that is attached to the first post in this thread.  Is there anything newer somewhere?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on November 30, 2016, 04:15:17 pm
I'm using the code that is attached to the first post in this thread.  Is there anything newer somewhere?

No the 0.4 version is current AFAIK.  Back on this post (http://forum.micasaverde.com/index.php/topic,14767.msg160260.html#msg160260), I had the "nan" issue, but either I fixed it somehow and didn't post a follow-up, or I might still have the problem and not know it...

I thought it was related to Eagle firmware and one of the plug-in revisions (0.3?) fixed it...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on December 02, 2016, 01:25:21 pm
I realized my Eagle firmware is quite old.  I'm having it updated.  Hopefully that will fix the issue.  In the meantime I put some checks in for zero values and now I don't get any 'nan' data recorded.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on December 02, 2016, 01:30:01 pm
I put in some triggers to see if I still have the Nan issue, and they have not alerted.  I think the Eagle firmware is the issue...

Sent from my SM-G900V using Tapatalk

Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on December 15, 2016, 12:45:22 am
Rainforest said they updated my unit, yet I still see the zeros.  But now that I look at it, I'm not sure they really updated:

  <FWVersion>1.4.48 (6952)</FWVersion>
  <HWVersion>3.2.3</HWVersion>

I think that's old.  Need to check again with them.  Here's what I see it goes bad:

<InstantaneousDemand>
  <DeviceMacId>0xd8d5b90000000ea2</DeviceMacId>
  <MeterMacId>0x0013500200a58e59</MeterMacId>
  <TimeStamp>0x00000000</TimeStamp>
  <Demand>0x000000</Demand>
  <Multiplier>0x00000000</Multiplier>
  <Divisor>0x00000000</Divisor>
  <DigitsRight>0x00</DigitsRight>
  <DigitsLeft>0x00</DigitsLeft>
  <SuppressLeadingZero>N</SuppressLeadingZero>
</InstantaneousDemand>
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on December 16, 2016, 02:45:32 pm
Weird: the 5002 port and the XML logged shows the old firmware version.  But if I use the web interface to the gateway, it does indeed show the new firmware.  I'm guessing that Rainforest deprecated the 5002 port and isn't updating it anymore.  They want you to use their cloud service which has a documented interface.  Nevertheless port 5002 works fine for me as long as I filter out the occasional bogus value, so I'll probably continue with that for now.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on December 16, 2016, 02:51:13 pm
Just so happens I installed the plug-in on a different Vera yesterday, using the 0.4 files from this thread, and it appears to work great - have not seen the nans.

I will check my Eagle firmware to confirm the version #...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: xeinth on March 11, 2017, 04:31:43 pm
I've had a couple instances in the last 2 months where this plugin wil cause constant lip restarts.  If I clear the IP address out, the restarts go away.   When this happens, the eagle seems to have lost connectivity to its cloud service (not sure which is the cause and which is the effect), but after rebooting and re entering the IP address in the plugin all is happy again.

Not sure if anyone else has seen this, or what is causing the plugin to restart constantly.  Even if the eagle loses its cloud conncectivity, the plugin shouldn't need to fail in this way.

X
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: IlDavo on March 18, 2017, 07:38:04 pm
Noob-alert:
Where does one obtain files for this plug-in? It's not listed on http://wiki.micasaverde.com/index.php/Luup_plugins_and_Luup_code#Plugins_and_code ?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: Brientim on March 18, 2017, 07:42:18 pm
Noob-alert:
Where does one obtain files for this plug-in? It's not listed on http://wiki.micasaverde.com/index.php/Luup_plugins_and_Luup_code#Plugins_and_code ?
See attachments on first post
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on April 15, 2017, 11:23:37 am
I filed a ticket with Rainforest to get upgraded to latest firmware, since I am on 1.4.23 (5099).  Will see how it impacts the plug-in, but I think others of you are already in firmware 2+...

https://rainforestautomation.com/wp-content/uploads/2015/11/EAGLE%20Upgrade%20Instructions.pdf (https://rainforestautomation.com/wp-content/uploads/2015/11/EAGLE%20Upgrade%20Instructions.pdf)
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on April 15, 2017, 12:04:50 pm
I'm curious to know what you see as the version on the internal port.  As far as I can tell they want you to gather the information from their cloud service (which is indeed possible, but why not collect it locally?).
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on April 15, 2017, 12:12:17 pm
I put notes in my ticket about this plug-in and using the 5002 port.  Will see how they reply...

Sent from my SM-G900V using Tapatalk

Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jamac on June 30, 2017, 05:54:32 am
Love this plugin! Is there any way to reset the DeliveredKWH, ReceivedKWH and NetKWH variables back to zero? I'd like to create a scene that did this monthly so that I can see the monthly totals.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: JJLINK on July 08, 2017, 01:49:45 pm
Has anyone figured out to pull in the Price/kWh from the Eagle? This would be very useful if Vera could act on time of use rate changes.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on July 09, 2017, 01:03:30 am
Yes, you can pull the price data.  I can't test it as my utility doesn't populate this, but the way you can do it is to add a routine that uses "get_price" and parses the return XML in addition to the existing "get_usage_data".

Note that this plugin is using port 5002 which appears to be deprecated.  I get bogus data every once in a while from it.  Eventually I'd like to try to switch it over to using the standard port 80 server.  I don't know if the issues I see are related to port 80 or not.  Also, Rainforest seems to expect that you will use their cloud service to get the data.  There is a python program on github to do just that.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on July 10, 2017, 01:40:05 pm
Love this plugin! Is there any way to reset the DeliveredKWH, ReceivedKWH and NetKWH variables back to zero? I'd like to create a scene that did this monthly so that I can see the monthly totals.
@jamac, Delivered and Received are pulled directly from the meter and Net is calculated from them.  There is no way to "reset" them.  But I suppose we could add some new variables to serve as a base.  DeliveredBase and ReceivedBase.  The "reset" button that you describe would update the bases.  Then you could calculate the new delta as DeliveredKWH - DeliveredBase.  What do you think of that?

Also, the Eagle is able to show the monthly totals in its local web server (I think).  You might try opening the local web page on it using Chrome with F12 to see the debug window.  Navigate to the page with the monthly totals.  Then see if there is a way to pull the monthly data directly from the server.  This might be easier than the above.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jamac on July 11, 2017, 04:39:58 am
Love this plugin! Is there any way to reset the DeliveredKWH, ReceivedKWH and NetKWH variables back to zero? I'd like to create a scene that did this monthly so that I can see the monthly totals.
@jamac, Delivered and Received are pulled directly from the meter and Net is calculated from them.  There is no way to "reset" them.  But I suppose we could add some new variables to serve as a base.  DeliveredBase and ReceivedBase.  The "reset" button that you describe would update the bases.  Then you could calculate the new delta as DeliveredKWH - DeliveredBase.  What do you think of that?

Also, the Eagle is able to show the monthly totals in its local web server (I think).  You might try opening the local web page on it using Chrome with F12 to see the debug window.  Navigate to the page with the monthly totals.  Then see if there is a way to pull the monthly data directly from the server.  This might be easier than the above.

Reset-able variables would be awesome. This would mirror the functionality offered by the Aeon Labs Home Energy Meter (HEM) and Smart Switches, both of which allow the user to reset the internal kWh counter. You can then create a scene to do that daily, weekly or monthly according to your preference.

I've had a look at the Rainforest Eagle's local and cloud portals and the 'consumption' view for a year shows the monthly NET totals. I'm not sure how this data could be extracted from the server... you have to scrape it somehow right? Anyway, having reset-able variables for delivered and received kWh would be a much nicer solution. Happy to roadtest a beta for you!  :)
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on July 14, 2017, 12:14:39 pm
I've attached an updated implementation file.  This uses port 80 to access the Eagle data instead of 5002.  It gets a JSON response instead of XML.  I mainly did this to see if I would stop getting bogus power data.  Unfortunately that did not happen, but it is easier to detect with the JSON which will return "nan" instead of giving a bogus timestamp.  The other advantages are that it is easier to parse the JSON, you can get access to anything that the internal web server displays, the values are formatted a little better, and you could more easily point this to the Rainforest cloud server if you wanted.  Otherwise there is not a lot of advantage of this over the original.

I did add two features:
1) the ResetKWH action now works.  This will save a base value for delivered and received and give the KWH as a delta from the saved values.
2) Price is now reported.  I have no way to test this as my utility does not populate it.

This loses automatic MacID detection.  I will try to look into this.

Installation:
You can update your existing device with the attached xml.  Upload the xml file, change the device to point to this file, and reload.

Or you can create a new device with robertmm's original files with the attached replacing the I_SmartMeterHAN1.xml.

You must set the IP.

Since there is no autodetect of the MacID, you MUST set it manually if not already set.  See the attached picture of the Eagle - get the MacID from the bottom.  The format must have "0x" in front of it.

If your Eagle has security turned on (optional, you can turn it off in the settings in the Eagle GUI, but I believe the default is on), then you must get the CloudId and the DeviceIN which is also on the bottom of the device.

Sample lua to set them below.  Replace the '46' with the Vera ID for this device, and replace the values with the ones from the bottom of your Eagle.

Code: [Select]
luup.variable_set("urn:smartmeter-han:serviceId:SmartMeterHAN1", "DeviceMACID", "0xabababababababab", 46)
luup.variable_set("urn:smartmeter-han:serviceId:SmartMeterHAN1", "DeviceIN", "1eabababadddddddd", 46)
luup.variable_set("urn:smartmeter-han:serviceId:SmartMeterHAN1", "CloudId", "000eee", 46)

Or, after the initial reload, set these 3 variables in the advanced tab appropriately.

Then reload the Vera.

Should you have any trouble, try the following curl test line on a unix box (must be a Windows version of curl too?).  Replace the IP with your Eagle IP, 6 digits before the : are the Cloud ID, 16 digits after the : are the IN, and the MacID is the 0xXXXXXXXXXXX delimited by <MacId>.  This should return the status of your Eagle in JSON format.  If you don't get the status back, the plugin won't work.

Code: [Select]
curl -d '<LocalCommand><Name>get_setting_data</Name><MacId>0xXXXXXXXX</MacID></LocalCommand>' http://XXXXXX:XXXXXXXXXXXX@192.168.1.201/cgi-bin/cgi_manager
Thanks to robertmm for the original code - this is a great plugin.

Also, I'm keeping the code in github here: https://github.com/jswim788/rainforest-eagle-vera
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jamac on July 14, 2017, 10:44:07 pm
This looks great.

A dumb question - presumably I need to update the local variables in the xml implementation file before uploading it, eg:

local HAN_IP                = "123.456.7.89"
local HAN_MACID         = "0xabababababab"
local HAN_IN                = "12341234a123a123"
local HAN_CLOUDID      = "000123"
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on July 15, 2017, 12:27:26 am
You don't need to change the xml.  Case 1 is if you are modifying an existing energy meter device and case 2 is for creating a new energy meter device.

Case 1: you already have the IP and likely the MACID.  If security is off, then you can likely just change the implementation file and reload and it should get the new file and start working.  If you do have security on, then you'll want to add those 2 variables to the device.  After you first install and reload the device, you should see DeviceIN and CloudId as blank in the advanced tab.  Fill these in with the appropriate values and reload.

Case 2: create the new device with robertmm's original files except the I_SmartMeterHAN1.xml replaced with this new one, then go into the tabs and set the IP, then set the variables in the advanced tab.  Reload the Vera to get it to start up with the new variables set.

See http://forum.micasaverde.com/index.php/topic,14767.msg325432.html#msg325432 for the latest files.  Also, I have them in github here: https://github.com/jswim788/rainforest-eagle-vera
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on July 18, 2017, 11:43:07 pm
I had Rainforest update my firmware - I had to remind them twice.  Now it is a mess.  Disconnected from meter.  No advanced settings to disable credentials.

I updated my ticket with my frustrations...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on July 25, 2017, 04:44:47 pm
I had Rainforest update my firmware - I had to remind them twice.  Now it is a mess.  Disconnected from meter.  No advanced settings to disable credentials.

I updated my ticket with my frustrations...

I got my Eagle re-paired with my meter.  Leaving it on the older plug-in code as it started working - WITHOUT any security updates.  I didn't add in the username/passowrd to the plug-in nor did I disable the security on the Eagle.  Meaning it looks to me like port 5002 isn't requiring a password.  When I try to connect via browser it says "Connection Dropped", but I get data from the plug-in...
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on July 25, 2017, 07:20:44 pm
What firmware do you have now?  I'm getting the impression that they started using port 5002, then shifted over to the web browser interface on port 80 but didn't remove the port 5002 access.  Also, it doesn't appear they've made any firmware changes recently, so maybe it is stuck as is.  2.3.4 was released in Dec 2015.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: wilme2 on July 25, 2017, 07:57:06 pm
What firmware do you have now?  I'm getting the impression that they started using port 5002, then shifted over to the web browser interface on port 80 but didn't remove the port 5002 access.  Also, it doesn't appear they've made any firmware changes recently, so maybe it is stuck as is.  2.3.4 was released in Dec 2015.

HW   3.2.3
FW   2.3.4.8466
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jamac on July 29, 2017, 02:53:35 am
I just can't get this to work.

I've uploaded the new implementation file as I_SmartMeterHAN1.xml (ie, replacing the existing implementation file) but I get the following error whenever I restart the Luup engine: "Rainforest Eagle[18] : Startup Lua Failed".

If i reload the old implementation file and restart the luup engine everything goes back to that way it was.

Any tips?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on August 09, 2017, 04:46:18 pm
There are 2 conditions where the startup can fail.
Code: [Select]
      if ((HAN_MACID or "") == "") then
        return false, "Please enter the DeviceMACID of your HAN device", "SmartMeterHAN1"
      end
      if (HAN_IP:match("%d+%.%d+%.%d+%.%d+") == nil) then
        return false, "Please enter the IP address of of your HAN device", "SmartMeterHAN1"
      end
Do you see either of these messages in the log file?  And do you have the DeviceMACID variable set (case sensitive)?  It will not auto-detect as the prior XML did.  "HAN_MACID" is the internal variable - "DeviceMACID" is the variable you need to set on the plugin.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jamac on November 06, 2017, 04:05:15 am
Back again. I'm really keen to get this plugin working but cannot.

I keep getting the message "Rainforrest Eagle[18]: Startup Lua Failed"

If I look at the log using http://[IP address]/cgi-bin/cmh/log.sh?Device=LuaUPnP i see the following message:

luup_log:18: Starting ZigBee HAN device, version 0.41js <0x2be5d680>
LuaInterface::CallFunction_Startup-1 device 18 function startup failed /usr/lib/lua/socket/http.lua:116: bad argument #2 to 'connect' (number expected, got string) <0x2be5d680>
LuImplementation::StartLua running startup code for 18 I_SmartMeterHAN1.xml failed <0x2be5d680>


Elsewhere I see repeats of the following message:
luup_log:18: SmartMeterHAN1: Cannot receive data from HAN device: closed <0x2c213680>
Device_Variable::m_szValue_set device: 18 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailure was: 1 now: 1 #hooks: 0 upnp: 0 skip: 0 v:0xee7b78/NONE duplicate:1 <0x2c213680>
Device_Variable::m_szValue_set device: 18 service: urn:micasaverde-com:serviceId:EnergyMetering1 variable: Watts was: 0 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xb6b2d8/NONE duplicate:1 <0x2c213680>
Device_Variable::m_szValue_set device: 18 service: urn:smartmeter-han:serviceId:SmartMeterHAN1 variable: LinkStrength was: 0 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xf4c728/NONE duplicate:1 <0x2c213680>
Device_Variable::m_szValue_set device: 18 service: urn:smartmeter-han:serviceId:SmartMeterHAN1 variable: LinkStatus was: ? now: ? #hooks: 1 upnp: 0 skip: 0 v:0xf4c920/NONE duplicate:1 <0x2c213680>


If I look at the device's ''advanced' tab the IP address, DeviceMACID, CloudId and DeviceIN all appear to be set properly. I've tried DeviceMACID with and without the leading '0x'.

Any idea what's going wrong?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jamac on November 06, 2017, 06:54:05 am
I've solved the above issue. I must have had a hidden character in the DeviceIN field in the 'advanced' tab. I re-entered the number again and the "startup lua failed" error disappeared.

However, I'm now getting a "Cant Detect Device" error and the log contains the following:

401   11/06/17 22:44:33.490   luup_log:18: Error connecting to Rainforest Eagle server port:  <0x2bcab680>

A port 80/5002 problem i assume?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 06, 2017, 11:55:10 am
I realize I have an error in the logging, so I've attached another implementation file which should allow us to see the error code.  However, I can tell that you are not getting a '200' response to the http call.  What is your 'CouldId' set to?  No special characters in there?  It should be 6 hex digits, no leading 0x, just 6 characters.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jamac on November 07, 2017, 03:36:58 am
It's working! After a few restarts and carefully re-entering the cloudID and other parameters a few times, it suddenly started working. All good so far. Thanks for the plugn and your guidance getting it up and running.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 11, 2017, 10:47:52 am
Will this work with the newer Eagle-200?  Amazon no longer sells the Eagle.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 11, 2017, 04:38:23 pm
I suspect it will work with the Eagle-200, but I have no way to test.  You could email and ask if the API is the same or similar.  They know that many people use the existing API's and would like to use code that is already out there.  Hopefully they took that into consideration.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 13, 2017, 05:34:44 pm
I installed the plugin, but its not working.  I get this message in the log "SmartMeterHAN1 : HAN device not found. Verify connection and IP address." and the status message on the device says "Lua Startup Failure".  I'm sure the ip address is correct.  Here is the API info from their website which has it for the Eagle-200: https://rainforestautomation.com/support/developer/
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 13, 2017, 06:02:17 pm
You are trying the files in the original post?  If so, it may be that the XML response at port 5002 is now disabled.  Try the files I have attached at this post instead: http://forum.micasaverde.com/index.php/topic,14767.msg325432.html#msg325432

I do recommend that you pick up the later implementation file from this post as well: http://forum.micasaverde.com/index.php/topic,14767.msg325466.html#msg325466

The latter makes it easier to install.  Upload the files, restart Vera, set the IP and MAC address (and the cloud ID and Device IN if you have security turned on) and restart again.  This uses port 80 - I think that has a better chance of working for the newer model.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 14, 2017, 04:15:33 am
I used the files you recommended.  I also ended up deleting and recreating the device. I no longer get the same error of the device not found or startup error, but do see a comm failure and of course not data.  Here are some of the log entries that look relevant:

 01   11/14/17 2:56:52.882   Device_LuaUPnP::CreateService can't parse xml /etc/cmh-ludl//S_SmartMeterHAN1.xml for 118/Eagle200 <0x2b29f000>
01   11/14/17 2:56:52.883   Device_LuaUPnP::CreateServices removing incomplete service from 118 <0x2b29f000>
03   11/14/17 2:57:01.893   luup_log:118: Starting ZigBee HAN device, version 0.41js __LEAK__ this:192512 start:458752 to 0xde8000 <0x2bbd3680>
02   11/14/17 2:57:02.100   ZWaveJobHandler::SetDeviceStatus XXX2 0/0/0/0 __LEAK__ this:77824 start:536576 to 0xdfb000 <0x2b9d3680>
01   11/14/17 2:57:02.248   luup_require can't find dkjson <0x2bbd3680>
06   11/14/17 2:57:02.309   Device_Variable::m_szValue_set device: 118 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailure was: 1 now: 1 #hooks: 0 upnp: 0 v:0xa82490/NONE duplicate:1 <0x2bbd3680>
03   11/14/17 2:57:02.310   luup_log:118: Starting ZigBee HAN device, version 0.41js <0x2bbd3680>
02   11/14/17 2:57:02.312   luup_require duplicate dkjson <0x2bbd3680>
06   11/14/17 2:57:02.358   Device_Variable::m_szValue_set device: 118 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailure was: 1 now: 1 #hooks: 0 upnp: 0 v:0xa82490/NONE duplicate:1 <0x2bbd3680>
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 14, 2017, 09:47:29 am
Let's start with the 2 issues:

1) you are missing dkjson.  You can download it from here http://dkolf.de/src/dkjson-lua.fsl/home and upload it to your Vera.

2) something is wrong with S_SmartMeterHAN1.xml - did it get uploaded correctly to your Vera or corrupted somehow?  Try uploading again.

After fixing both of the above, try a reboot.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 18, 2017, 06:28:46 am
I uploaded the dkjson file and reuploaded S_SmartMeterHAN1.xml and those errors are gone from the logs.  I still see the comm failure however:

03   11/18/17 5:05:01.554   luup_log:118: Starting ZigBee HAN device, version 0.41js <0x2bcdf680>
01   11/18/17 5:05:01.846   luup_require can't find lpeg <0x2bcdf680>
06   11/18/17 5:05:01.883   Device_Variable::m_szValue_set device: 118 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailure was: 1 now: 1 #hooks: 0 upnp: 0 v:0x8826c8/NONE duplicate:1 <0x2bcdf680>

I am getting output to the rainforest cloud.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 18, 2017, 10:53:40 am
2 suggestions:

1) go back to this post (http://forum.micasaverde.com/index.php/topic,14767.msg325432.html#msg325432) and download the implementation file that I just uploaded.  I fixed the logging so we should be better able to see what is going wrong.  Upload the file and reload and take a look at the log.

2) type this into your browser (replace the IP with your Eagle's IP): http://192.168.1.201/cgi-bin/cgi_manager   Does it ask for authentication?  If so, type in the CloudId and DeviceIN you put into the plugin.  In either case, what do you see if you do this?  Something like "{}" would be normal.  Maybe you have an error message?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 18, 2017, 01:49:18 pm
I did both those things.  Following item#2, I was prompted to authenticate then got "404 - Not Found".  I don't know what interfaces the original Eagle has, but when going to the host on port 80 with the Eagle 200, the only thing you can do is set up the wifi.  No other configuration settings are available.

I restarted Vera and the Eagle 200 for good measure.  Here are the logs with the new implementation file:
09   11/18/17 12:40:15.534   JobHandler_LuaUPnP::Run device 118 Eagle200 room 0 type urn:schemas-smartmeter-han:device:SmartMeterHAN1:1 id  parent 0/0xcf6148 upnp: 0 <0x2ab21000>
03   11/18/17 12:40:19.126   luup_log:118: Starting ZigBee HAN device, version 0.41js <0x2b455680>
06   11/18/17 12:40:19.355   Device_Variable::m_szValue_set device: 118 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailure was: 1 now: 1 #hooks: 0 upnp: 0 v:0xd0e860/NONE duplicate:1 <0x2b455680>
03   11/18/17 12:40:19.356   luup_log:118: Starting ZigBee HAN device, version 0.41js <0x2b455680>
02   11/18/17 12:40:19.358   luup_require duplicate dkjson <0x2b455680>
06   11/18/17 12:40:19.365   Device_Variable::m_szValue_set device: 118 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailure was: 1 now: 1 #hooks: 0 upnp: 0 v:0xd0e860/NONE duplicate:1 <0x2b455680>
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 18, 2017, 02:27:31 pm
Hmm, pretty sure you didn't get the latest I uploaded because it should have said 0.44js.  But that's irrelevant if you can't get anything on port 80.  There's no local access?  On mine I can get to the interface that you can see in the snippet I attached (just the IP address, no cgi added to it in the URL).  If you can get there, use Chrome and hit F12 to see what it is doing.  I looked at the network tab and can see the cgi-bin/cgi_manager calls.  I have to believe that there is something similar in the 200.  Take a look and see what you find.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 18, 2017, 02:55:59 pm
I don't have a device home page that looks like yours.  Actually there is discussion elsewhere like Amazon reviews about the lack of a local interface for the Eagle 200.  I think they released it before everything was built.  It doesn't work with the EnergyVUE mobile app either, but they are supposed to come out with a new app in Q1 2018.  I attached an image of my home screen.

You were correct on the implementation file.  I did something wrong.  Fixed and here is the output:
09   11/18/17 13:41:13.974   JobHandler_LuaUPnP::Run device 118 Eagle200 room 0 type urn:schemas-smartmeter-han:device:SmartMeterHAN1:1 id  parent 0/0xc99070 upnp: 0 <0x2ab36000>
03   11/18/17 13:41:16.617   luup_log:118: Starting ZigBee HAN device, version 0.44js <0x2b269680>
01   11/18/17 13:41:16.937   luup_require can't find lpeg <0x2b269680>
01   11/18/17 13:41:16.949   luup_log:118: Error connecting to Rainforest Eagle server port: 404 <0x2b269680>
06   11/18/17 13:41:16.950   Device_Variable::m_szValue_set device: 118 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailure was: 1 now: 1 #hooks: 0 upnp: 0 v:0xcb17b0/NONE duplicate:1 <0x2b269680>
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 18, 2017, 04:13:19 pm
I suppose that the plugin could try to fetch the data from the Rainforest servers.  Kind of goofy since it has the data locally, sends it out, then the plugin pulls it back from the cloud.  I'd have to think about that a bit.  There is an API for it, but it's definitely more complicated than the local access.

According the developer guide for the 200 it appears that there is a post manager.  Can you try accessing this (with your correct IP)?  http://192.168.1.201/cgi-bin/post_manager

You may not get anything back, but you are hoping to see no error.  If that works, then I think it is possible to access the data locally.  Unfortunately it appears to only support XML, not JSON, so I'd have to make a hybrid of the original code that parses XML.  If you are familiar with curl you can try doing some post requests and see if you can get responses.  In any case, see what you get with the URL above.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 18, 2017, 05:02:56 pm
Doing http://192.168.3.210/cgi-bin/post_manager gives a blank page - no error.  I don't know curl, but can learn.  Are there a few curl post requests I should try?
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 18, 2017, 06:16:40 pm
You would want to try something like this with curl:

curl --trace trace -X POST -i -H "Content-Type: text/xml" -u 'user:password' --data-binary '<Command><Name>wifi_status</Name></Command>' http://192.168.1.201/cgi-bin/post_manager

--trace trace puts the log information into the file named trace, -X POST makes it a post request, -H sets the content type, -i includes the HTTP response headers in the output

You need to figure out the user name and password.  The developer guide says the user name is the Cloud ID, and the password is the "EAGLE install code".  Not sure what that is, but maybe you do?

--data-binary gives the command we want, and it ends with the http URL - change the IP.  Also note that this is all one line.

This would be easier with direct access, but you'll likely need to fiddle with this a bit to get it to work.  Look into the 'trace' file each time you try to get some debug information.  If it does work, you should see some XML come back that indicates the WiFi status.  If you get that far, there is a good chance to make it work.

The next step would be to try this as the command instead of the one above: '<Command><Name>device_list</Name></Command>'
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 19, 2017, 11:38:07 am
The CloudID and Install Code are both printed on the sticker that comes with the Eagle 200 device.  I used those with the curl commands you sent and it all works perfectly. It also is in the log file, but here was the XML on screen:

HTTP/1.1 200 OK
Access-Control-Allow-Origin: http://homebase.rainforestautomation.com:8080
Access-Control-Allow-Headers: Authorization, Content-Type, Accept
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Credentials: true
Access-Control-Max-Age: 86400
Content-type: text/html
Transfer-Encoding: chunked
Date: Sun, 19 Nov 2017 16:31:08 GMT
Server: lighttpd/1.4.32

<DeviceList>
  <Device>
    <HardwareAddress>0x00078100006a18d7</HardwareAddress>
    <Manufacturer>Generic</Manufacturer>
    <ModelId>electric_meter</ModelId>
    <Protocol>Zigbee</Protocol>
    <LastContact>0x5a11b1cb</LastContact>
    <ConnectionStatus>Connected</ConnectionStatus>
    <NetworkAddress>0x0000</NetworkAddress>
  </Device>
</DeviceList>
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: ssenneff on November 19, 2017, 01:16:24 pm
Here is the trace file using the <All>Y</ALL> variables command.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on November 19, 2017, 09:49:38 pm
That's good news.  You could use this already in a scene if you wanted by turning off all of the debugging and use the curl within an io.popen() - something like this:

local handle = io.popen(<curl command>)
local result = handle:read("*a")
handle:close()

Then you could pattern match and find the variables.  In the meantime I will look at resurrecting the XML parsing functions and see if I can make it work.  May take a little time, though.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: vikram0228 on March 13, 2018, 02:38:10 pm
Can someone please write a simple HOW-TO on installing and setting up the Rainforest Eagle Plug-in.  PLEASE, PLEASE.  I will contribute $ to this effort or person.  I have read all 9 pages of this link and the instructions are just not clear to me. 

Many thanks
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on March 13, 2018, 02:58:07 pm
Can someone please write a simple HOW-TO on installing and setting up the Rainforest Eagle Plug-in.
Do you have the Model 100 or 200?  I just published version 0.66 and version 0.67 will be out next week.  You can try installing it from the marketplace (https://apps.mios.com/plugin.php?id=9056).  This is only tested with UI5 and with openLuup.  At least one user has successfully used this on UI7.

To install:
1) install from the marketplace
2) go to the advanced tab and fill in the IP address of the Eagle (this must be a static IP that you set up in your router)
3) fill in the Mac Address, the Install Code, and the Cloud ID from the bottom of your Eagle (see picture) also in the advanced tab - see 2nd picture (remove any spaces when filling in these codes)
4) fill in the EagleModel variable that you have in the advanced tab (this is not "Model" in the advanced tab)
5) reload

If you have any issues, post here and include a log file if possible.

There is one more variable that you can modify: MeteringType.  The default is 0 which means the grid only delivers energy to you.  1 means the grid only receives energy from you, and 2 means energy goes both ways (for example you have solar panels and the grid receives from you during the day and the delivers to you at night).

'From Grid' is the absolute number on the meter in kWh for energy delivered to you.  'To Grid' is the energy received by the grid (e.g., with solar).  'Current' is the net kWh, positive if the grid has delivered more to you, negative if the grid has received more from you.  'Reset' is used to reset the 'Current' value to zero whenever you would like.  I run it from a scene once per month.  Then 'Current' shows the net kWh I have received or delivered in the current month - or you could reset it on your billing date.

On UI5 the model 100 requires dkjson which you can get from here: http://dkolf.de/src/dkjson-lua.fsl/home
On openLuup the model 200 requires lxp which you can get: sudo apt-get install lua-expat
UI7 shouldn't need anything else: it already has dkjson and lxp
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: vikram0228 on March 13, 2018, 07:41:05 pm
Thanks for the instructions JSwim788.

I have a Veraplus with UI7 and the Eagle 200.  I uploaded the dkjson.lua file (assume that means that dkjson is now installed).  I set the IP, MAC, Model, Cloud and IN variables but continue to get a "cannot connect to device error"

I did not install openluup.  Is that also needed?

Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on March 13, 2018, 07:48:07 pm
You set the 'EagleModel', not the Model, right?

Can you get the log file from your Vera to see what it says after it reloaded?  It should have something interesting.  No, you don't need openLuup for the Vera.  And you don't need dkjson on UI7 as it is already loaded.  Shouldn't hurt to load another copy though.

I use the info viewer plugin to see the logs, but you can do it manually.  Here's a link: https://www.vesternet.com/resources/application-notes/apnt-32  You should see some information with 'Eagle' in the lines.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: vikram0228 on March 13, 2018, 08:01:43 pm
OMG Jswim788.  IT WORKS.... IT WORKS....

See the attached screenshot showing it in UI7

It shows actual KwH usage correctly.  Not sure what the "From Grid" value is.  Also what does Reset do.

My mistake was that I was putting in blank spaces in the MAC and IN values (as there were spaces on the eagle sticker)

How can I contribute?  Seriously.  If you wrote this,  you deserve something.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on March 13, 2018, 08:17:49 pm
I'll put a reminder to not put spaces in the instructions.  Glad to hear it works on UI7.

'From Grid' is the absolute number on the meter in kWh.  'Reset' is used to reset the 'Current' value whenever you would like.  I do it from a scene once per month.  Then 'Current' shows how many kWh you have used in the current month - or you could reset it on your billing date.  If you never reset then Current will always be equal to the 'From Grid'.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: guineau on May 11, 2018, 03:37:05 pm
Just set up a new Eagle-200 with PG&E.

I have a VeraPlus and installed this plugin. We have solar here and the plugin does not seem to handle the negative power values. It is displaying power as an unsigned integer:

4294963301 (0xFFFFF065) which is -3994 in decimal as a signed integer (and is what our solar panels are currently producing).

I do have MeteringType set to 2. The Rainforest Cloud site shows power values correctly.

Could you fix this? Then this will be awesome!!

john
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on May 20, 2018, 01:22:47 pm
See this thread for the latest version: http://forum.micasaverde.com/index.php/topic,79863.0.html

Can you grab the log lines where it updates this value so I can see what it is doing?  I can test solar with the 100, but I don't have the 200 with solar.  I'll take a look at the code and see if I can find the issue.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: BigE-TX on June 06, 2018, 06:03:01 pm
Mine isn't working that great.  Had the old plugin loaded an noticed it was losing the Eagle from time to time.  Would unplug Eagle power and usually it worked fine.  Thought I'd try this one w/o removing old "app"; neither worked.  I uninstalled both and your app sort of works.  It doesn't seem like it pulls data often enough and neither reloading the engine or refreshing the screen makes a difference.  For example, the android app from Eagle is showing values different, plus the value seems to stay in the Windows Vera screen even when AC is off.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on June 06, 2018, 06:22:29 pm
The polling rate is set by the "Pulse" variable.  I think it is set to 300 seconds by default, 5 minutes.  You can lower it if you wish.  My meter doesn't update the energy usage more often than that so there wasn't much point in going lower.  It does report power more often.

Check the log file to see if it is reporting any errors.  You have the Eagle 100?  The plugin is calling the Eagle's local web interface to extract the data.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: rklass on June 30, 2018, 04:12:00 pm
Hi,

Having issues getting your plugin to work. This is with Eagle-200, connected to my network via WiFi. I can use their POST interface to read data fine, so I'm pretty sure I have the correct numbers. Also the data shows up on Rainforest Cloud.
Here are log entries beginning with "luup_log:240", also attached is complete log since reboot (device 240).<-NOT, keeps failing to upload attachment, sorry...
It appears to initialize OK but then gets "nil status" connection problem every 5 minutes when it tries to read.

02   06/30/18 14:27:53.455   luup_log:240: SmartMeterHAN1(0.70js): Starting <0x76caa520>
03   06/30/18 14:27:53.456   luup_log:240: SmartMeterHAN1(0.70js): Eagle Model 200 <0x76caa520>
03   06/30/18 14:27:55.048   luup_log:240: SmartMeterHAN1(0.70js): Eagle 200: Found hardware address: 0x************ <0x76caa520>
03   06/30/18 14:27:55.048   luup_log:240: SmartMeterHAN1(0.70js): Connection status: Connected <0x76caa520>
02   06/30/18 14:28:06.631   luup_log:240: SmartMeterHAN1(0.70js): Connection problem, nil status  <0x754aa520>
02   06/30/18 14:33:06.538   luup_log:240: SmartMeterHAN1(0.70js): Connection problem, nil status  <0x754aa520>
02   06/30/18 14:38:06.426   luup_log:240: SmartMeterHAN1(0.70js): Connection problem, nil status  <0x754aa520>



Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on July 08, 2018, 03:07:04 pm
You need this file to work around a bug that Rainforest has with XML.  I don't yet have it in the Mios App Store - hopefully by next week.

https://github.com/jswim788/rainforest-eagle-vera/blob/master/L_SmartMeterHAN1.lua
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: rklass on July 18, 2018, 08:22:36 am
I loaded the file using the "upload" option under "Luup files", "Develop Apps". But now after a reboot it is giving an error at the top of the webpage:

Zigbee Smart Meter H[240]: Lua Engine Failed to Load
Rainforest Eagle: Lua error

From log:
35   07/18/18 7:01:49.592   ZigbeeJobHandler::ParseCustomDeviceType Id: 4341 <0x762c0520>
01   07/18/18 7:01:49.597   LuaInterface::LoadCode: [string "..."]:7: unexpected symbol near '<' <0x77d51320>
35   07/18/18 7:01:49.605   ZigbeeJobHandler::ParseCustomDeviceType Id: 4351 <0x762c0520>
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: jswim788 on July 18, 2018, 04:59:20 pm
Any chance that file got corrupted somehow?  I believe the error message is saying that line 7 has a '<', but it doesn't have that in the source code near line 7.  I suggest downloading the entire set of code from the green button here (https://github.com/jswim788/rainforest-eagle-vera), then getting the specific file.

If that doesn't work, let me know and we can work on this further.
Title: Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
Post by: rklass on July 18, 2018, 07:11:38 pm
Thanks, it appears to be working now!
Sorry, the issue was pretty much my fault, but I'm too embarrassed to explain...