My place to chat and rant

Main menu

Post navigation

Pretty Solar Graphs

The first step on my solar progress is to get some graphs done, to get an idea of how much energy I can get from my solar panels on an average day. From this I can work out what I can conceivably run from my setup.

Background

Previously, I installed a simple solar setup for testing. This is using an EPEver Tracer1210A solar charge controller, from Tracer. It wasn’t the cheapest, but it had a lot of good reviews (watch out for cheap copied). The other benefit was the fact it had a serial output that talked modbus, or rs485. Intended for official devices, they do provide the protocol to allow third parties to read the system details.

After doing some searching, I discovered Jamin on github who had done some coding and circuit design to get the current details from the charge controller and push the results out to a service called Blynk.

My Project

Overview

This project gave me the starting point for what I wanted to do. My idea was to do this:

A little bit convoluted, I could probably have pushed straight to a database for logging, and do the graphs in grafana. I decided that pushing via MQTT would allow me to integrate the logging into my OpenHAB system, which would give me the capability to trigger home automation actions depending on the statistics from the charge controller. For example, it makes it very easy to use OpenHAB to send an email if the battery level gets low, and not only that it could turn off some of the load running off the battery as it gets to different levels.

Circuit

The circuit is pretty much a direct copy of what Jamin used, only adapted for a NodeMCU rather than a ESP8266 Mini Dev board.

Prototype of circuit. Ordered a 5110 LCD to add to it, and will neaten it all up then.

I did look into powering this from the 5V on the serial output of the charge controller, but according to the documentation this can only put out about 50mA of power, which probably won’t be enough to cover the usage by the NodeMCU.

My OpenHAB system is configured to store persistence data into an InfluxDB server, which is a common setup amongst the OpenHAB community and is well documented. This InfluxDB stores historic data on items in OpenHAB, which is searchable by Grafana. Grafana gives a nice interface to produce all the pretty solar graphs you might want.

Solar Graphs

Pretty Solar Graphs

This makes it really easy to see just what is happening, including the charging states as it you can see the switch from bulk to float charge on the battery voltage. This should allow me to make sure the charging is correct for the Lithium Ion batteries I want to eventually connect.

4 thoughts on “Pretty Solar Graphs”

I was about to start looking into a MQTT solution for the EPsolar myself when I found your project.
Uploaded it to a Wemos mini with a suitable 485-adapter attached, and it worked straight away!
(I previously uploaded data with the same hardware, but to Thingspeak.)

The only thing I modified needed to modify was to manually add MQTT username and password after “client.connect” somewhere around row 123.
This could maybe be a good thing to add upp there around row 35 with the other “credentials”
Would make for a smoother setup for novice users like me 🙂

Authentication is definitely something I want to add in at some point, as with all things like this its easier to develop without security.

I know about the values that aren’t reporting properly, not had the time to do any bug fixing or such like yet. Hoping to get some time to do that soon, but as always too many projects and too little time.

Glad you found it useful, and that it works with more than just my OpenHAB setup. But then, that was why I went with the MQTT route.