pv – a Python library to monitor/control PV Inverters

After having the solar electricity system installed, I can monitor the energy output of the inverter using Pro Control. However, because the software runs on Windows, I’d have to have a PC turned on just for that purpose wasting quite a bit of energy. So, my goal is to use a low-power embedded Debian box (which is usually on) to do the monitoring. Instead of just writing an application to do the job, I’ve decided to write a library others can use to write their own custom logging software.

pv can be found at http://pv.codeplex.com/, and should work for you if you have a Carbon Management Solutions CMS-2000 or Schneider Electric SunEzy 600E (judging from a sample protocol exchange).

I’ll have to give full credit to the folks at http://www.solarfreaks.com/cms2000-inverter-rs232-serial-port-hack-cms-2000-rs232-t271.html who did the initial work on reverse engineering the communication protocols. Building on what has already been done on working out the protocol, and doing a bit of reverse engineering myself, the library supports sending arbitrary data frames for further exploring, as well as the known protocols.

JinbaIttai wrote a Perl script to poll the inverter, but unfortunately I don’t particular like Perl. So, I decided to write my own in my language of choice – Python. Also, a word of thanks to Ingmar for providing a sample of the protocol for the SunEzy 600E.

There are still quite a number of data fields that remains a mystery – getting a hold of the protocol from the CMS-10000 would really, really help.

Here’s a list of the features in the library:

  • Craft custom frames to be sent to the serial port
  • Reads inverter parameters and status information
  • Verifies checksum for received frames
  • Enumerates all known messages for quick reference

The module comes with a working example. Just run the package like so:

pv

The code for this sample can be found in __main__.py.

  • Simon Chan

    Great work Edmund,

    I like your software! It is very readable, and looks well engineered. However when I tried to run it with my CMS 5000 inverter, it fell over. I have sent you an E-mail in the hope that you may be able to point me in the right direction to get it fixed!

    Well done,
    Simon Chan

  • http://www.edmundtse.com/ Edmund Tse
  • Peter

    Nice script, try integrating your script the API at http://pvoutput.org there are a few CMS systems registered there too.

  • http://www.edmundtse.com/ Edmund Tse

    Hi Peter,

    That’s a great idea. Would you like to help contribute to this?

  • Peter

    I’m not much of a python scripter though…

  • Wombatworks

    did you manage to get the CMS10000 working?

    Eric

    • http://www.edmundtse.com/ Edmund Tse

      No, not yet. I should make a post about how to help out with figuring out the protocol. Keep an eye out for that.

WordPress Themes