Custom Component: Rainforest Eagle-200 local meter reader

I’m working on creating a custom component sensor that retrieves the instantanous power demand from the Eagle-200. I created this as I wanted to locally retrieve the electric meter readings rather than pulling or being pushed from Rainforest’s portal website.

Steps to install the component:

sensor:
  - platform: rainforest_eagle
    ip_address: 1.1.1.2
    cloud_id: 123456
    install_code: 4234343242343242

The component currently only exposes 3 attributes from the Eagle-200 and 1 attribute that gives a calculated value of the Net Summation

  • Instantanous Demand (kW)
  • Summation Energy Delivered (kWh)
  • Summation Energy Received (kWh)
  • Total Summation (Delivered minus Received) (kWh)

The Eagle supports being connected to other ZigBee devices other than the Power Company’s Electric Meter. If your Eagle is connected to more than the Electric Meter the code currently does not support this, but will soon! I need to update the code to support more than the Electric Meter.

Any suggestions/comments are welcomed and appreciated. I quickly wrote this last night.
Greg

2 Likes

Hi Greg,
This is exactly what I was looking for and tried it out.

It was working correctly for a couple of days then it had a hiccup in which it was giving the error that it is not getting a response within 10 seconds for about 10 hours or so.

I had to restart Home Assistant to get the feed back to normal. The only deviation from your instructions is that I put in a scan interval of 30 seconds.

Here is my feedback,

Regards,
doublea9

Thank you for the info. I was thinking of increasing the default scan period to 60 seconds.

I’ll look into why the hiccup may have occurred.
Greg

Hi doublea9,

I took a look at my code and it looks like maybe the eagle200_reader.py maybe hanging indefinitely because I’m not using a timeout value for the HTTP request. I’ll add the timeout and a couple more error handling cases and post the updated code to Github.

Greg

Hey, thank you for making this component how stable is it? Are you planning to submit it to HA for review?

@fxcoolby I’ve been running the component for the past 2 months without any major issues. The only issue I’ve had is a bug in the code running on the Rainforest Eagle-200. Sometimes when retrieving the usage data the device returns empty data. So in my code the power goes from some value to unknown to another value. Happens a few times an hour, when I poll it every 30seconds.

I contacted Rainforest about the bug and they said it would be fixed in an upcoming release.

I haven’t had the time to submit it for review. Maybe this summer

Greg

Awesome thank you so much

@fxcoolby I updated the eagle200_reader.py in GitHub, so that the code is not overwhelming the Eagle200 device.

@gregtd

Got this thing working this morning. So far so good. Installation instructions need some love though :grinning:

Awesome, I made a directory custom_components under my root folder and added rainforest directory to it. I downloaded and added all the component, however adding eagle as sensor doesn’t produce any values any idea

This is the error I get in my Config log “Integration rainforest_eagle not found when trying to verify its sensor platform.”

@fxcoolby You need to put everyting in custom_components/rainforest_eagle

These are the files you need:

eagle200_reader.py
manifest.json
sensor.py

Thanks for the response, do you put the custom_components under root folder or /Config folder

in my /config folder.

Deploying it kinda, messed up my HA I had to restore my HA from snapshot

You didn’t include init.py?

Nope. you don’t need those with Python3, apparently… I just learned that yesterday :slight_smile:

Awesome let me give it another try. Finger crossed. :grinning:

@fxcoolby :crossed_fingers:

I updated the installation instructions today. I’m getting ready to submit it to HA, so the required module ‘eagle200_reader’ has been posted to the Python Package Index and can be installed by running the ‘pip’ command in the instructions. Until the rainforest_eagle component is merged into a released HA build, the sensor will still have to be loaded as a custom_component. After installing the eagle python module only 3 files have to be copied over to the ‘/config/custom_component/rainforest_eagle’ directory.

Thank you so much for the updates, I have tried to incorporate this twice, both times it broke my HA, I had to reload from snapshots. It found an error with sensor.py when I looked up the logs. I am just going to wait for the official version. Can’t wait. :grinning: