Energy Monitoring - OpenEVSE and Rainforest Automation Eagle Gateway February 12 2016

OpenEVSE Energy Monitoring  portal adds ( support for the Rainforest Automation Eagle Gateway. The Eagle gateway uses the Zigbee Wireless protocol to read energy consumption from compatible smart meters in real-time.

Combining data from OpenEVSE charging stations with consumption from the main power meters provides a clear picture of usage. Fusing data from multiple sources allows smarter decisions to optimizes charging such as limiting peak demand, sharing current with multiple EVs or dynamically altering charging current to finish charging at a specific time.

The Graph Below depicts total usage and production (5.8kw Solar) from the main panel via the Eagle Gateway with a Tesla Charging at ~6kw and a Leaf Charging at 1.44kw.



Source code - Python with Eagle_HTTP_API library.

 from eagle_http import *
import time, httplib, urllib, os

# info from Rainforest Automation account
eagle = eagle_http('user', 'password', 'device_ID')

eagle.noisy = False
run = 1
#Setup for OpenEVSE Data
host = ''
url_post = '/emoncms/input/post.json?node=13&devicekey='
with open ("DeviceKey.txt", "r") as key:
apikey =

#HTTP Header info
values = urllib.urlencode({'value' : '1234',})
headers = {
'User-Agent': 'python',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'text/plain', }

while int(run) == 1:
  Demand = int(eagle.InstantaneousDemand.Demand, 0)
  if Demand > 0x7FFFFFFF:
    Demand -= 0x100000000
  Multiplier = int(eagle.InstantaneousDemand.Multiplier, 16)
  Divisor = int(eagle.InstantaneousDemand.Divisor, 16)
  power = Demand
  power = str(power)

#read RAPI current from OpenEVSE and Post HTTP
input_power = '&json={Power:' + power + '}'
conn = httplib.HTTPSConnection(host)
url_power = url_post + apikey + input_power
conn.request("POST", url_power, values, headers)
response = conn.getresponse()
print "Power " + power + " kWh Sent to " + host