Custom Component: Rainforest Eagle-200 local meter reader

@gregtd I am using the older, 4 light unit. In looking at the Rainforest documentation for the older unit, it seems it should be returning a multiplier and a divisor but I do not see either in the response from the units.

It appears to be an issue of conversion from an integer return to decimle - see reference to this in their API guide - page 14 of: https://rainforestautomation.com/wp-content/uploads/2015/07/EAGLE_REST_API-1.1.pdf

@gregtd – interesting, i poked at it a bit more after that last reply, i manually set the multiplier & diviser through the web interface, set them to 1 & 1000 (those were flashing in there), and now the number comes back making sense. So I think this can be chalked up to a configuration issue on the rainforest.

@cwm Great, glad to hear it’s working! As I only have the Eagle-200.

Mine has stopped reporting into hass
Checking the logs
[homeassistant.components.rainforest_eagle.sensor] Failed to connect during setup: Couldn't determine device model.

Mine is already set to those values
When I hit the ‘set’ button I get the following message after confirming
Custom Multiplier & Divisor is sent off.

I’m also sending data to Wattvision, which is reporting correctly, so I think its a different issue to @cwm

So I’m wondering if this is due to negative consumption?
I have Solar, which means the Eagle shows negative demand

I saw a real number in hass (0.39Kw), and then it when back to the really big number
During this interval demand was positive (a cloud came over I assume)

Edit
Can confirm
Solar generation has now stopped, and the value in hassio looks about correct

I get this error no matter what I do. I tried the three inputs with single quotes, without single quotes, but nothing seems to work. I have the older 4 light eagle, which can be reached at the 192…111 IP, and is connected to wattvision and working fine (I even tried disabling wattvision). Hassio is in the official VM on esxi.

  - platform: rainforest_eagle
    ip_address: 192.168.1.111
    cloud_id: 00xxxx
    install_code: aa2e58c1xxxxxxxx

Logger: homeassistant.components.rainforest_eagle.sensor
Source: components/rainforest_eagle/sensor.py:81
Integration: rainforest_eagle ([documentation][issues]
First occurred: 8:51:03 AM (1 occurrences)
Last logged: 8:51:03 AM

Failed to connect during setup: Expecting value: line 1 column 1 (char 0)

I am getting the same error trying to set up my Eagle-200 5 light. I’m running HA on a Raspberry Pi.

Anyone find a fix for the “Expecting value:” error?

Sorry guys the forum e-mails were being filtered into the wrong folder.

I haven’t had any issues with eagle200_reader API and Home Assistant. But haven’t updated HA in a while, currently running 0.113.3.

My Rainforest Eagle-200 (5 light version) is running firmware 3.13.3.466.

I did notice that the Eagle API (4 light) was bumped from version 0.0.1 to 0.0.2. This fixes a negative number problem Issue # 1. HA will be using the updated API in 0.118

Though it would not solve the setup error @poohbah @dillon @gcbarrie are seeing.

Here is my configuration.yaml that I’m using, about the same as @poohbah

sensor:
  - platform: rainforest_eagle
    ip_address: 10.0.20.206
    cloud_id: 00xxxx
    install_code: 3251xxxxxxxxxxxx

Before enabling debug, what version of Home Assistant are you guys running?

Would it be possible for you to run the eagle200_reader API directly from the command line?
Download the eagle200_reader.py
Run the command python eagle200_reader.py ipaddr cloudid installcode
Replacing the above placeholders (ipaddr, cloudid, and installcode) with your actual values without quotes

EDIT: Looking at the code and the error message, it appears the Rainforest Eagle/Eagle-200 is not returning an expected value. I get the same error when I use an incorrect cloud_id or install_code. Can you verify that the values in your configuration.yaml are the same values that are printed on the bottom of the Eagle? Also, can you check through the Rainforest Portal under Settings >> Eagles if the Cloud ID and Install Code match as well?

Thanks for the insights. Turns out I was missing the last character of the Install Code! It seems to be running smoothly after correcting the code.

When I run this python command manually on a windows computer, using literally anything for cloudid and install code, I get the same “None” results. My eagle is the older type purchased in 2014, model rfa-z109. The bottom of the unit has the same values as the webpage except the install code is prefixed with “0x” on the webpage. This unit doesn’t have a cloud page like the eagle200, but mine does serve a local page from the device itself. The cloudid and install code below are not real, but they are the identical format as my unit.

python eagle200_reader.py 192.168.1.111 00162c aa1e49e152abc159
Instantanous Demand:     None kW
Total Energy Delivered:  None kWh
Total Energy Received:   None kWh
Total Net Energy:        None kWh

Home Assistant 0.117.6
Eagle FW 2.0.27

@poohbah That Eagle uses a different API. Home Assistant tries to determine which one you have and uses the correct API. In your case it should be using uEagle.

I would try to use uEagle from the command line and see what you get then. The uEagle client is here

The easiest way would be to run
pip3 install ueagle

Then paste the below into a file, change your values, and run the file

from uEagle import Eagle
 
CLOUD_ID = '012abc'
INSTALL_CODE = '0123456789abcdef'
ADDRESS = '192.168.1.123' #optional if your platform can resove mDNS
 
eagle = Eagle(CLOUD_ID, INSTALL_CODE, address=ADDRESS)
 
demand_data = eagle.get_instantaneous_demand()
print('Current Usage: {:.3f} kW'.format(demand_data['Demand'])).

I tried everything (except contacting support) but I was unable to get the eagle to respond to anything. I submitted a ticket to support and got several firmware updates and the problem is fixed.

Thanks for the help. It all works now.

1 Like

Sorry for the late reply. I am now on version 0.118.3, and I am still getting the same error in the logs. I triple and quadruple checked the install code and cloud ID.

However, I did try running the python code through the command line. That returned proper values. I’m at a loss for what the issue might be.

Here is my config:

- platform: rainforest_eagle
  ip_address: 192.168.1.99
  cloud_id: 00xxxx
  install_code: 4c41bdxxxxxxxxxx

Hmm…that is strange. Enabling debug won’t help. Just to be sure can you post your log?

What firmware version is your Eagle-200 running? I think you can get it through the Rainforest portal website.

Logger: homeassistant.components.rainforest_eagle.sensor
Source: components/rainforest_eagle/sensor.py:81
Integration: rainforest_eagle (documentation, issues)
First occurred: 1:39:34 PM (1 occurrences)
Last logged: 1:39:34 PM

Failed to connect during setup: Expecting value: line 1 column 1 (char 0)

The firmware version looks to be 3.13.3.466

That’s the same version I’m running. I can only think of some network configuration or wrong IP address of the Eagle. A wrong IP address would result in a different error message. I can’t think of anything else.

I think to debug it I’ll have to add logging to the sensor. Something I’ve been meaning to do.

EDIT: Even trying to debug this, I can’t just add logging to the Home Assistant sensor. The error is coming from the uEagle API library, which really should only give this cryptic error when the authentication fails (wrong cloud_id/install_code). Hmm…let me think about this some more

EDIT: Can you run tcpflow on the host that is running Home Assistant? Looking at the uEagle API code it appears the function is expecting the Eagle to return data in a JSON format. Either the format is messed up or it is returning HTML rather than JSON. From the host that is running Home Assistant stop Home Assistant and start this command:

sudo tcpflow -p -c -i en0 host x.x.x.x

Replace the above en0 with your ethernet device probably eth0 and replace x.x.x.x with the IP address of your Eagle, in your config above it was 192.168.1.99

The command will wait for some communication between the host and the Eagle, so now start Home Assistant and you should see some output.

EDIT: Another command you can try is wget from the host running Home Assistant

wget --ask-password --user=00abcd --post-data=“>\n\nget_network_info\n\nJSON\n” --header=“Content-Type’: application/xml” http://x.x.x.x/cgi-bin/post_manager`

Replacing 00abcd with your cloud_id and x.x.x.x with your Eagle IP address. The above command will prompt you for a password which is the install_code. Either it will download a file called post_manager or return an error. The post_manager file will contain the results from the command.

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

Is your CloudID digits only (no alpha characters)? Put single quotes around it in the configuration.yaml file.

- platform: rainforest_eagle
  ip_address: 192.168.1.99
  cloud_id: '001235'
  install_code: 4c41bdxxxxxxxxxx