GitXplorerGitXplorer
m

smartermeter

public
49 stars
15 forks
1 issues

Commits

List of commits on branch master.
Verified
4c13595abb6054f6b29139d44920145eb9eafa63

Merge pull request #37 from mcolyer/update-mechanize

mmcolyer committed 4 years ago
Verified
99d43249c7be92d56266eb65719f26b1d019d39a

Update mechanize to 2.7.7

mmcolyer committed 4 years ago
Verified
ac56ed48c9a7a3758fd2e77be7cca47cdf15f9ad

Merge pull request #35 from mcolyer/update-rubygems

committed 5 years ago
Verified
0ee526f35d79199f1153c89366576d655b7bf7f9

Update smartermeter.gemspec

committed 5 years ago
Unverified
910dc5a6d348e77b6c54931bff4b6ffa9c73e63f

Release 0.4.6

mmcolyer committed 5 years ago
Verified
f7f5a73412757f870ba023f97fceb6809d61369d

Merge pull request #31 from mcolyer/update-gems

mmcolyer committed 5 years ago

README

The README file for this repository.

SmarterMeter - the smarter way to read your PG&E SmartMeter

So I have PG&E SmartMeter and I like playing with data. However I didn't really want to jump through 37 hoops to see the data on PG&E's website. So I made this.

While making this library I discovered that PG&E doesn't even manage the software for the energy reporting. It's all done by OPower, not terribly useful but an interesting piece of trivia.

Getting Started

gem install smartermeter
smartermeter

Manipulating the data

After you've successfully downloaded one set of data, you should be able to manipulate it using ruby like so:

require 'rubygems'
require 'smartermeter'

config = YAML.load_file(File.expand_path("~/.smartermeter"))
csv_file = Dir.glob(File.join(config[:data_dir], "*.csv")).last

samples = SmarterMeter::Samples.parse_espi(csv_file)
kwh_used = samples.total_kwh
api = SmarterMeter::Services::BrighterPlanet.new
puts api.calculate_kg_carbon(kwh_used)

For futher information see the API docs

Pachube

Once you've configured SmarterMeter once, you might want to use it with Pachube, so you can visualize the results.

  1. Visit http://pachube.com and sign up for an account.
  2. Create a feed and a datastream.
  3. Copy the feed id (the last item in a feed url like 123 in https://pachube.com/feeds/123) and the datastream id (which is the name that you enter)
  4. Then append the following to your ~/.smartermeter file to automatically upload data as it's retrieved from PG&E.
    :transport: :pachube
    :pachube:
        :api_key: "your-api-key"
        :feed_id: "your-feed-id"
        :datastream_id: "your-datastream-id"

To Build the Windows Installer

In order to build the self contained binaries, you'll need Java 1.6 and (NSIS)1, both of which are available as packages in Ubuntu.

apt-get install nsis sun-java6-jre
git clone git://github.com/mcolyer/smartermeter.git
cd smartermeter
bundle install --path vendor/gems
rake package

The installer will be generated in pkg/

Questions

  • How much lag is there?

    It'll show you the last full day's worth of data. The PGE website claims that data becomes available around 3-10pm on the following day. However my experience says that it's sometimes available earlier.

  • How long is data saved for?

    I don't know. If you know tell me.

  • How can I help?

    Make sure it works, make cool things with it or send me git pull requests.

Sponsorship

I would like to thank Brighter Planet for including SmarterMeter as part of their Fellowship Program