Skip to content

Rainforest EAGLE

David Luther edited this page Mar 30, 2016 · 5 revisions

#Rainforest EAGLE™ Energy Access Gateway# The Eagle lets you retrieve the data from your smart meter locally with out having to pull the data from the cloud.

You will need to add the gateway to your energy meter through your electric company. Here in Texas there is a website devoted for smart meters.

After the gateway is added to the meter you will need to disable local security.

In the web portal click the down arrow next to date. at the bottom of that page click the gear.


uncheck the security box.


While you are in the Eagle gateway page look at the URL at the top and note the IP and MAC for setting up the .RULES file.


In my setup I created separate item and rule files for power.


Group	GPersist (All)
Group	GMonitorPower
Group	GMonitorEnergy

Number   HousePowerInstant    "SmartMeter Power [%.3f]" 	<energy>	(GMonitorPower,GPersist)
Number   HouseEnergyDelivered "SmartMeter Energy Delivered [%.3f]" (GMonitorEnergy,GPersist)
Number   HouseEnergySent      "SmartMeter Energy Sent [%.3f]" (GMonitorEnergy,GPersist)
Number   HouseEnergyPrice     "SmartMeter Energy Price [%.3f]" (GMonitorEnergy,GPersist)
Number   HouseEnergyCost      "SmartMeter Energy Cost [%.3f]" (GMonitorEnergy,GPersist)


import org.openhab.core.library.types.*
import java.lang.Float
import java.lang.Long
import org.joda.time.DateTime

var DateTime lastTimestamp = null
var float lastDelivered
var float lastReceived
rule "Pull Data from Eagle"
    Time cron "0 0-59 * * * ?"
    var t = now
    val String EAGLE_MAC = "0xe1e100000e1e10"
    val String EAGLE_URL = ""
    var String postData = String::format("<LocalCommand>
      </LocalCommand>", EAGLE_MAC, EAGLE_MAC)
    var result = sendHttpPostRequest(EAGLE_URL, "application/x-www-form-urlencoded", postData)
    try {
        var long timestamp = Long::parseLong(transform("JSONPATH", "$.demand_timestamp", result))
        var DateTime currTimestamp = new DateTime(timestamp * 1000)
        var float price = Float::parseFloat(transform("JSONPATH", "$.price", result))
        var float currDemand = Float::parseFloat(transform("JSONPATH", "$.demand", result))
        var float currDelivered = Float::parseFloat(transform("JSONPATH", "$.summation_delivered", result))
        var float currReceived = Float::parseFloat(transform("JSONPATH", "$.summation_received", result))
        postUpdate(HousePowerInstant, currDemand * 1000)
        if (lastTimestamp != null && !lastTimestamp.equals(currTimestamp)) {
            var float used = currDelivered - lastDelivered
            var float sent = currReceived - lastReceived
            logDebug("eagle", String::format("Energy %s demand=%.3f received=%.3f delivered=%.3f", currTimestamp.toString,
              currDemand, used, sent))
            postUpdate(HouseEnergySent, sent * 1000)
            postUpdate(HouseEnergyDelivered, used * 1000)
            postUpdate(HouseEnergyCost, (used - sent) * 1000 * price)
        postUpdate(HouseEnergyPrice, price)
        lastDelivered = currDelivered
        lastReceived = currReceived
        lastTimestamp = currTimestamp  
    } catch (NumberFormatException nfe) {
        logError("eagle", "Bad Data " + result.replaceAll("\n", " "))
    var long x = now.getMillis - t.getMillis
    logInfo("eagle", "PERF Pull-Data-from-Eagle elapsed: " + String::valueOf(x) + "ms")

Note: When you update the EAGLE_URL and the EAGLE_MAC, note the MAC is 18 characters starting with "0x"



feature overview


Setup intro

Linux and OS X





User Interfaces



(link to openHAB forum)



Application Integration



A good source of inspiration and tips from users gathered over the years. Be aware that things may have changed since they were written and some examples might not work correctly.

Please update the wiki if you do come across any out of date information.

Binding configurations

Use case examples

Item definition examples

Sitemap definition examples

Collections of Rules on a single page

Single Rules


Syntax highlighting for external editors

Release Notes

Clone this wiki locally
You can’t perform that action at this time.