Author Topic: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin  (Read 33326 times)

Offline ssenneff

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #120 on: November 19, 2017, 01:16:24 pm »
Here is the trace file using the <All>Y</ALL> variables command.

Offline jswim788

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +57/-2
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #121 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.

Offline vikram0228

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #122 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

Offline jswim788

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +57/-2
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #123 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
« Last Edit: March 14, 2018, 08:20:51 pm by jswim788 »

Offline vikram0228

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #124 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?


Offline jswim788

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +57/-2
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #125 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.

Offline vikram0228

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #126 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.

Offline jswim788

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +57/-2
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #127 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'.

Offline guineau

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #128 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
« Last Edit: May 11, 2018, 04:05:56 pm by guineau »

Offline jswim788

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +57/-2
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #129 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.
« Last Edit: May 20, 2018, 02:14:20 pm by jswim788 »

Offline BigE-TX

  • Sr. Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #130 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.

Offline jswim788

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +57/-2
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #131 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.

Offline rklass

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #132 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>




Offline jswim788

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +57/-2
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #133 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

Offline rklass

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Rainforest Automation Eagle ZigBee Smart Meter HAN Gateway Plugin
« Reply #134 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>