This script sends the data from the SRNE SR-MT2410 solar charge controller to an MQTT server. I only tested this with this device, but maybe it also works for other charge controllers.
- TTL Cable: 895-TTL-232R-5V
- RJ12 cable
Pin RJ12 | RJ12 function | PIN TTL Cable | TTL function |
---|---|---|---|
1 | TX | 5 | RX |
2 | RX | 4 | TX |
3 | GND | 1 | GND |
All configuration values can be found in the MpptToMqttConfig.py:
import logging
serialPort = "/dev/tty.usbserial-FTBBWTC9"
logFileName = "MpptToMqtt.log"
logLevel = logging.ERROR
controllerName = "MpptController01"
mqttServer = "172.17.2.21"
mqttPort = 1883
reportInterval = 15
Topic | Description |
---|---|
/controllername/Led | Solarpanel led Bit 8: led on Bit 8 & Bit 7: blink fast Bit 8 & Bit 6: blink slow |
/controllername/ErrorCode | Error code |
/controllername/Icons | Bit 8: Lamp symbol Bit 7: Battery led blink slow Bit 6: Battery led blink fast |
/controllername/BatteryVoltage | Battery voltage |
/controllername/PvVoltage | PV voltage |
/controllername/ChargeCurrentAmpere | Current charge in ampere |
/controllername/LoadCurrentAmpere | Current load in ampere |
/controllername/Temperature | Temperature |
/controllername/ChargeAmpere | Total ampere charged |
/controllername/DischargeAmpere | Current discharge in ampere |
Topic | Description |
---|---|
/controllername/Command | Topic for commands. Only command at the moment is ResetChargeAmpere to reset the total ampere charged. |