mcolyer / smartermeter

A ruby library to access PG&E SmartMeter data
http://matt.colyer.name/projects/smartermeter/
MIT License
48 stars 15 forks source link

pachube upload failure #21

Closed tels7ar closed 12 years ago

tels7ar commented 12 years ago

Got my pachube connection set up yesterday, but smartermeter crapped out on it's upload attempt as follows:

(erb):1:in `block in request_body': undefined method `kwh' for #<Array:0x000000019a19f0> (NoMethodError)
        from (erb):1:in `select'
        from (erb):1:in `request_body'
        from /usr/lib/ruby/1.9.1/erb.rb:838:in `eval'
        from /usr/lib/ruby/1.9.1/erb.rb:838:in `result'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/services/pachube.rb:38:in `request_body'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/services/pachube.rb:24:in `upload'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/daemon.rb:212:in `upload'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/daemon.rb:194:in `block (2 levels) in fetch_dates'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/daemon.rb:178:in `each'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/daemon.rb:178:in `block in fetch_dates'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/daemon.rb:166:in `connect'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/daemon.rb:177:in `fetch_dates'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/daemon.rb:125:in `run'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/lib/smartermeter/daemon.rb:20:in `start'
        from /home/philiph/.gem/ruby/1.9.1/gems/smartermeter-0.4.1/bin/smartermeter:11:in `<top (required)>'
        from /usr/bin/smartermeter:19:in `load'
        from /usr/bin/smartermeter:19:in `<main>'

can you tell me how to trigger this for debugging? I don't want to have to wait 24 hours to see if pachube upload will work or not. Thanks!

mcolyer commented 12 years ago

So if you remove the latest .csv from your data directory (which is configured in ~/.smartermeter) then it should attempt to upload to pachube again.

As for the error I'm looking into it now.

mcolyer commented 12 years ago

If you upgrade to smartermeter v0.4.2 (already on rubygems) it should fix your issue.