Permalink
Browse files

Added copyright notice and updated README

  • Loading branch information...
dpoulson committed Jul 29, 2017
1 parent 207f530 commit 09cbb2e1994113a6db106e0fc68df754522f1d8c
Showing with 55 additions and 1 deletion.
  1. +20 −1 EPSolar.ino
  2. +35 −0 README.md
View
@@ -1,3 +1,21 @@
/*
Copyright (C) 2017 Darren Poulson <darren.poulson@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
@@ -17,6 +35,7 @@ const char* password = "trial3211";
const char* mqtt_server = "192.168.6.46";
#define OTA_HOSTNAME "SOLAR-CHARGE-MONITOR-1"
#define EPSOLAR_DEVICE_ID 1;
WiFiClient espClient;
PubSubClient client(espClient);
@@ -59,7 +78,7 @@ void setup() {
ESP.restart();
}
// Modbus slave ID 1
node.begin(1, Serial);
node.begin(EPSOLAR_DEVICE_ID, Serial);
node.preTransmission(preTransmission);
node.postTransmission(postTransmission);
// Port defaults to 8266
View
@@ -5,5 +5,40 @@ This project is to connect an EPSolar/EPEver Tracer Solar Charge Controller to a
# Hardware
I am developing this on a NodeMCU v1, but see no reason why it won't work with other similar hardware.
# MQTT
By default, this will write to queues under:
/EPSolar/<device ID>/<stat>
# Incorporating into OpenHAB
You will need the MQTT binding installed and configured to connect to the same MQTT instance. Once that is done, you can create an items file similar to this:
Number EPSolar_Temp "Temperature [%.2f °C]" { mqtt="<[mymosquitto:EPSolar/1/ctemp:state:default" }
Number EPSolar_BattVolt "Battery Voltage [%.2f V]" { mqtt="<[mymosquitto:EPSolar/1/bvoltage:state:default" }
Number EPSolar_BattRemain "Battery Remaining [%.2f %]" { mqtt="<[mymosquitto:EPSolar/1/bremaining:state:default" }
Number EPSolar_BattTemp "Battery Temp [%.2f °C]" { mqtt="<[mymosquitto:EPSolar/1/btemp:state:default" }
Number EPSolar_LoadPower "Load Power [%.2f W]" { mqtt="<[mymosquitto:EPSolar/1/lpower:state:default" }
Number EPSolar_LoadCurrent "Load Current [%.2f A]" { mqtt="<[mymosquitto:EPSolar/1/lcurrent:state:default" }
Number EPSolar_PVVolt "PV Voltage [%.2f V]" { mqtt="<[mymosquitto:EPSolar/1/pvvoltage:state:default" }
Number EPSolar_PVCurrent "PV Current [%.2f A]" { mqtt="<[mymosquitto:EPSolar/1/pvcurrent:state:default" }
Number EPSolar_PVPower "PV Power [%.2f W]" { mqtt="<[mymosquitto:EPSolar/1/pvpower:state:default" }
Number EPSolar_ChargeCurrent "Battery Charge Current [%.2f A]" { mqtt="<[mymosquitto:EPSolar/1/battChargeCurrent:state:default" }
Number EPSolar_PVVoltMax "PV Voltage MAX (today) [%.2f V]" { mqtt="<[mymosquitto:EPSolar/1/stats_today_pv_volt_max:state:default" }
Number EPSolar_PVVoltMin "PV Voltage MIN (today) [%.2f V]" { mqtt="<[mymosquitto:EPSolar/1/stats_today_pv_volt_min:state:default" }
This will store the results in these items.
For full graphing, follow this tutorial: https://community.openhab.org/t/influxdb-grafana-persistence-and-graphing/13761
# Author
Darren Poulson <darren.poulson@gmail.com>

0 comments on commit 09cbb2e

Please sign in to comment.