Package: pyraven
Some code to talk to the Rainforest Automation “Radio Adapter for Viewing
Energy” (RAVEn).InstallationThe easiest way would bepip install pyravenYou could also install direct from this repository:Clone this repoIn the top-level directory (where thisREADME.rstis) runpip install--upgrade.SetupPrerequisitesYou should have already bound (paired) your USB stick to your smart meter.Binding/pairing your smart meterUnlike 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:Powercor/Citipower (Melbourne):They have a “My Energy” portal that you can sign up for athttps://customermeterdata.portal.powercor.com.au/customermeterdata/(correct as of Jan 2017). Once you’ve signed up, there’s a
pulldown from your name that allows you to “Manage my HAN
devices”, wherein you can bind your RAVEn to the meter.Jemena (Melbourne):Use their portal athttps://electricityoutlook.jemena.com.au/to
bind your USB deviceAusNet Services:Use the portal athttps://connect.ausnetservices.com.au/webui/to bind your deviceUnited Energy:they have astartlingly similarportal to Jemena, located athttps://energyeasy.ue.com.au/that you can use to set up a
bindingUsageThere’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 secondsSummation: 240 secondsProfile data: disabledScheduled prices: 90 secondsPrice: 90 secondsMessages: 120 secondsTime: 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.DocumentationThe XML protocol specification can bedownloaded from
Rainforest AutomationOther worksThere 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.EntropyPythonstreams data to plot.lypython-ravenPythonpublishes data to a Mosquitto server (MQTT)node-ravenNodeJSpublishes to an MQTT server