We have moved at community.getvera.com

Author Topic: Plugin: Rainforest Eagle Model 100 and 200 Smart Meter  (Read 1148 times)

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Plugin: Rainforest Eagle Model 100 and 200 Smart Meter
« on: April 16, 2018, 02:23:20 pm »
I've just published an updated Rainforest Eagle Plugin that works with both the model 100 and 200 to read your whole house power consumption or generation when paired with a smart meter.  This is based on robertmm's original plugin.  It's been extensively rewritten to handle the Model 200 and switches from using the undocumented XML port to the partially documented web port on the Model 100.

You'll find it in the Mios app store here.  Current version is 0.74: https://apps.mios.com/plugin.php?id=9056

It's also available in the AltAppStore.  The model 100 has been tested on openLuup and UI5 Vera Lite.  The model 200 has been tested on openLuup and UI5 Vera Lite and UI7.

Installation
1) install from the marketplace
2) go to the advanced tab and fill in the IP address of the Eagle as the EagleIP device variable.  This is not the IP attribute in Vera.  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.

Notes
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

0.74 Release: New device variable is used for the Eagle IP address instead of the Vera attribute which is disappearing for some.  You must set the 'EagleIP' device variable to the fixed IP of your Eagle device.
« Last Edit: December 19, 2018, 11:27:14 am by jswim788 »

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1302
  • Karma: +33/-13
Re: Plugin: Rainforest Eagle Model 100 and 200 Smart Meter
« Reply #1 on: March 12, 2019, 04:01:18 pm »
I deleted by Eagle device I originally created from the 0.4 version, went to the app store and loaded the 0.74 version.  Followed the instructions below to the letter.  Eagle 100 on UI7/VeraSecure.

Code: [Select]
HW 3.2.3
FW 2.3.4.8466
ZB 1.4

"Eagle communication failure.Can't Detect Device"

Code: [Select]
02 03/12/19 14:49:42.139 luup_log:255: SmartMeterHAN1(0.74): Error connecting to Rainforest Eagle server port: 401 <0x72753520>
06 03/12/19 14:49:42.140 Device_Variable::m_szValue_set device: 255 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailureTime was: 0 now: 1552420182 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x72753520>
06 03/12/19 14:49:42.143 Device_Variable::m_szValue_set device: 255 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailure was: 0 now: 1 #hooks: 0 upnp: 0 skip: 0 v:0xee7780/NONE duplicate:0 <0x72753520>
06 03/12/19 14:49:42.165 Device_Variable::m_szValue_set device: 255 service: urn:micasaverde-com:serviceId:HaDevice1 variable: CommFailureTime was: 1552420182 now: 1552420182 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x72753520>
02 03/12/19 14:49:42.166 luup_log:255: SmartMeterHAN1(0.74): Unable to retrieve data from Eagle 100 <0x72753520>
« Last Edit: March 12, 2019, 04:06:42 pm by wilme2 »
Long Live UI5!  (OK finally made the switch to UI7 in January 2018, and am pretty happy....)

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Plugin: Rainforest Eagle Model 100 and 200 Smart Meter
« Reply #2 on: March 12, 2019, 04:14:20 pm »
Can you set the "Debug" variable to TRUE and restart and get the logs?  I'm interested in the log as it starts up.

401 means unauthorized, so I suspect something went wrong with the authentication.  Did you turn on authentication in your unit?  It should work.  The CloudId and DeviceIN must be correct for this to work.  No "0x" in front, right?  Just 6 digits for the CloudId, and 16 hex digits for the DeviceIN.  And don't mix up the MAC with the IN.
« Last Edit: March 12, 2019, 04:16:57 pm by jswim788 »

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1302
  • Karma: +33/-13
Re: Plugin: Rainforest Eagle Model 100 and 200 Smart Meter
« Reply #3 on: March 12, 2019, 04:23:34 pm »
Can you set the "Debug" variable to TRUE and restart and get the logs?  I'm interested in the log as it starts up.

401 means unauthorized, so I suspect something went wrong with the authentication.  Did you turn on authentication in your unit?  It should work.  The CloudId and DeviceIN must be correct for this to work.  No "0x" in front, right?  Just 6 digits for the CloudId, and 16 hex digits for the DeviceIN.

Sorry, I figured it out - was about to delete my post.  I entered everything exactly like on the bottom of my Eagle.  Which wasn't the right thing to do - my Cloud ID printed on the bottom is actually in caps/upper case.  Once I tested with my browser what I had entered into the device variable, I remembered I needed to change to lower case on that one...

BTW, the reason I upgraded was the old 0.4 code always left a banner at the top of UI7 showing "Eagle(#) Running LUA Startup".  I suspect some ending to a command block was missing that UI5 didn't really care about.  It worked, was just annoying.  Your code starts up clean and I don't get the banner hanging around.  Thanks!
« Last Edit: March 12, 2019, 04:27:18 pm by wilme2 »
Long Live UI5!  (OK finally made the switch to UI7 in January 2018, and am pretty happy....)

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Plugin: Rainforest Eagle Model 100 and 200 Smart Meter
« Reply #4 on: March 12, 2019, 04:27:14 pm »
Interesting, your Cloud ID is hex, not integers?  All the examples I've seen so far are not hex.  I could add a function to force it to lower case when used if need be.

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1302
  • Karma: +33/-13
Re: Plugin: Rainforest Eagle Model 100 and 200 Smart Meter
« Reply #5 on: March 12, 2019, 04:33:11 pm »
Interesting, your Cloud ID is hex, not integers?  All the examples I've seen so far are not hex.  I could add a function to force it to lower case when used if need be.

Yes, my Cloud ID is hex.  It is old, from June of 2013, likely they stopped using hex at some point.
Long Live UI5!  (OK finally made the switch to UI7 in January 2018, and am pretty happy....)

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Plugin: Rainforest Eagle Model 100 and 200 Smart Meter
« Reply #6 on: March 13, 2019, 12:20:03 am »
Should you wish to be an alpha tester, you can pick up a Lua file from https://github.com/jswim788/rainforest-eagle-vera/tree/development that has a line to automatically convert to lower case.  Let me know if you try it.  Thanks.