Skip to main content

Interface with the Rainforest Automation RAVEn USB stick

Project description

Travis build badge for pyraven PyPI version badge

Some code to talk to the Rainforest Automation “Radio Adapter for Viewing Energy” (RAVEn).


The easiest way would be pip install pyraven

You could also install direct from this repository:

  1. Clone this repo

  2. In the top-level directory (where this README.rst is) run pip install --upgrade .



You should have already bound (paired) your USB stick to your smart meter.

Binding/pairing your smart meter

Unlike many other devices, the RAVEn doesn’t require a specific “bind to the meter” command to be issued to it. Instead, your energy wholesaler or retailer will have to configure your smart meter to bind with the RAVEn stick. Once the meter has been told to bind to the device, there will usually be a 10-minute window during which you simply have to have the USB stick plugged in and close enough to the meter. The LED will stop flashing, and will turn on solidly once the stick is bound.

Different retailers and wholesalers will have different methods of setting up a binding. Some I know of are:


There’s a simple CLI, used to assist in the development of the library itself. Once your USB stick is set up and bound to your meter, you can use the CLI to monitor the current instantaneous demand reported by your meter:

localhost$ raven
{'status': 'Connected', 'shortaddr': '0xd131', 'link_strength': 100, 'extpanid': 1234567890123456L, 'is_connected': True, 'channel': 11, 'description': 'Successfully Joined'}
{'divisor': 1000, 'summation_delivered': 2220.575, 'raw_summation_received': 0, 'timstamp': '2018-03-27T02:45:45Z', 'raw_summation_delivered': 2220575, 'multiplier': 1, 'summation_received': 0.0}
{'divisor': 1000, 'summation_delivered': 2220.575, 'raw_summation_received': 0, 'timstamp': '2018-03-27T02:45:45Z', 'raw_summation_delivered': 2220575, 'multiplier': 1, 'summation_received': 0.0}
{'timestamp': '2018-03-27T02:47:56Z', 'raw_demand': 142, 'multiplier': 1, 'divisor': 1000, 'demand': 0.142}

and so on.

Instantaneous readings show the current demand, and the summation includes power delivered to the grid (eg from a PV array).

The frequency of different types of data delivery are set by the schedule in the USB stick. By default, they are:

  • Instantaneous demand: 8 seconds

  • Summation: 240 seconds

  • Profile data: disabled

  • Scheduled prices: 90 seconds

  • Price: 90 seconds

  • Messages: 120 seconds

  • Time: 900 seconds (reports the current time known to the meter)

However, the meter I have has no pricing data (this seems to be common in Australia, because wholesalers and retailers are different entities, and the retailer applies the pricing based on their own peculiar calculations from the raw consumption data) and so the price elements are never emitted.

Similarly, if there are no messages to be consumed, the RAVEn will not emit a message element.

In practice, this means that you’ll usually only get the instantaneous demand and summation outputs.


The XML protocol specification can be downloaded from Rainforest Automation

Other works

There are other open-source projects which cover some of the same ground. My intents in re-inventing this wheel were to provide a more complete and standardised Python implementation that could be used as a library by others, instead of the fairly implementation-specific versions already out there.

  • Entropy
    • Python

    • streams data to

  • python-raven
    • Python

    • publishes data to a Mosquitto server (MQTT)

  • node-raven
    • NodeJS

    • publishes to an MQTT server

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyraven-0.1.4.tar.gz (8.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page