EPEVER Modbus RS-485 Config

The response I got from EPEVER support was that their dongle only supports the mobile phone app.

There is an MQTT config in the web GUI for it but don’t mess with it. I did and it quit reporting to their cloud and I had to restore default settings. I thought maybe I could point it to my local MQTT and get updates that way but it did not work.

1 Like

This device is severely f*cked up, it limits free choice of WIFI IDs and passwords. No, I do not want to change my whole WIFI just because Epever wants me to. I sold it directly after purchase… I did spent some time to get a ESP8266 talk to the Epever via modbus and thanks to ESPHOME data is flowing right into my HA.

I would like to bring up the USB-RS485 topic again.

With the communication cable cc-usb-rs485-150u.

How is it possible to interface with the mini PC? Do you have the YAML code?

Thanks in advance.

  1. Make sure it shows up as a piece of HW go Settings->System->HW->All Hardware
    make sure you see ttyUSB0 in the list with something like this…or similar
ttyUSB0
/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0
Subsystem:
tty
Device path:
/dev/ttyUSB0
ID:
/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0
Attributes:
DEVLINKS: >-
  /dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0
  /dev/serial/by-path/pci-0000:07:1b.0-usb-0:1:1.0-port0
DEVNAME: /dev/ttyUSB0
DEVPATH: >-
  /devices/pci0000:00/0000:00:1e.0/0000:05:02.0/0000:07:1b.0/usb9/9-1/9-1:1.0/ttyUSB0/tty/ttyUSB0
ID_BUS: usb
ID_MODEL: USB2.0-Ser_
ID_MODEL_ENC: USB2.0-Ser\x21
ID_MODEL_ID: '7523'
ID_PATH: pci-0000:07:1b.0-usb-0:1:1.0
ID_PATH_TAG: pci-0000_07_1b_0-usb-0_1_1_0
ID_REVISION: '0254'
ID_SERIAL: 1a86_USB2.0-Ser_
ID_TYPE: generic
ID_USB_DRIVER: ch341
ID_USB_INTERFACES: ':ff0102:'
ID_USB_INTERFACE_NUM: '00'
ID_USB_MODEL: USB2.0-Ser_
ID_USB_MODEL_ENC: USB2.0-Ser\x21
ID_USB_MODEL_ID: '7523'
ID_USB_REVISION: '0254'
ID_USB_SERIAL: 1a86_USB2.0-Ser_
ID_USB_TYPE: generic
ID_USB_VENDOR: 1a86
ID_USB_VENDOR_ENC: 1a86
ID_USB_VENDOR_ID: 1a86
ID_VENDOR: 1a86
ID_VENDOR_ENC: 1a86
ID_VENDOR_ID: 1a86
MAJOR: '188'
MINOR: '0'
SUBSYSTEM: tty
TAGS: ':systemd:'
USEC_INITIALIZED: '3228229'
  1. I then have this in my configuration.yaml
    modbus: !include_dir_merge_list modbus/
    and then this is in one of my files in the modbus directory
    Make sure your port is the same as what you find in the hardware config and also your slave ID’s on all your items match the slave ID of your unit. I have 3 units all with different slave ID’s. I gave you ID #1 because that is usually the default.
#EPEVER
  - type: serial
    name: EPEVER1
    method: rtu
    port: /dev/ttyUSB0
    baudrate: 115200
    stopbits: 1
    bytesize: 8
    parity: N
    binary_sensors:
      - name: PV1 Day/Night
        address: 8204
        input_type: discrete_input
        slave: 1
      - name: PV1 Over Temp
        address: 8192
        input_type: discrete_input
        slave: 1 
      - name: PV2 Day/Night
        address: 8204
        input_type: discrete_input
        slave: 2
      - name: PV2 Over Temp
        address: 8192
        input_type: discrete_input
        slave: 2 
      - name: PV3 Day/Night
        address: 8204
        input_type: discrete_input
        slave: 3
      - name: PV3 Over Temp
        address: 8192
        input_type: discrete_input
        slave: 3 

    sensors:
#EPEVER Controller 1
#Rated Data
      - name: PV1 Charging Equipment Rated Input Voltage #0x003000
        unit_of_measurement: V
        slave: 1
        address: 12288
        input_type: input
        scale: 0.01
        precision: 1
        data_type: uint16
      - name: PV1 Array Input Voltage #0x003100
        unit_of_measurement: V
        slave: 1
        address: 12544
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Array Input Current # 0x003101
        unit_of_measurement: A
        slave: 1
        address: 12545
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Array Power # 3102 and 3103
        unit_of_measurement: W
        slave: 1
        address: 12546
        input_type: input
        scale: .01
        #count: 2
        precision: 2
        swap: word
        data_type: uint32
      - name: PV1 Battery Temperature #0x003110
        unit_of_measurement: °C
        slave: 1
        address: 12560
        input_type: input
        scale: 0.01
        precision: 2
        data_type: int16
      - name: PV1 Device Temperature #0x003111
        unit_of_measurement: °C
        slave: 1
        address: 12561
        input_type: input
        scale: 0.01
        precision: 2
        data_type: int16
      - name: PV1 Battery State of Charge #0x00311A
        unit_of_measurement: "%"
        slave: 1
        address: 12570
        input_type: input
        scale: 1
        precision: 0
        data_type: uint16
      - name: PV1 Battery Status #0x003200
        slave: 1
        address: 12800
        input_type: input
        scale: 1
        precision: 0
        data_type: uint16
        #######################################################################
        #D15: 1-Wrong identification for rated voltage
        #D8: Battery inner resistance, abnormal 1, normal 0
        #D7-D4: 00H Normal, 01H Over, Temp.(Higher than the warning settings) 02H Low Temp.(Lower than the warning settings),
        #D3-D0: 00H Normal ,01H Over Voltage. , 02H Under Voltage, 03H Over discharge, 04H Fault
        #Status analysis
        #Array status:address 3201 bits D15-D10
        #Charging status:address 3201 bits D3-D2
        #Battery status: address 3200 bits D7-D0
        #Load status: address 3201 bits D9-D7,
        #Device status: address 3200 bit D15 address 3202 bits D13-D8,D6-D4 address 3201 bits D6 address 2000
        ############################################################################################
      - name: PV1 Charging Equipment Status #0x003201
        slave: 1
        address: 12801
        input_type: input
        scale: 1
        precision: 0
        data_type: uint16
        #######################################################################
        #D15-D14: Input voltage status. 00H normal, 01H No input power connected, 02H Higher input voltage , 03H Input voltage error.
        #D13: Charging MOSFET is short circuit.
        #D12: Charging or Anti-reverse MOSFET is open circuit.
        #D11: Anti-reverse MOSFET is short circuit.
        #D10: Input is over current.
        #D9: The load is over current.
        #D8: The load is short circuit.
        #D7: Load MOSFET is short circuit.
        #D6:Disequilibrium in three circuits.A17
        #D4: PV input is short circuit.
        #D3-D2: Charging status. 00H No charging,01H Float,02H Boost, 03H Equalization.
        #D1: 0 Normal, 1 Fault.
        #D0: 1 Running, 0 Standby.
        #Status analysis
        #Array status:address 3201 bits D15-D10
        #Charging status:address 3201 bits D3-D2
        #Battery status: address 3200 bits D7-D0
        #Load status: address 3201 bits D9-D7,
        #Device status: address 3200 bit D15 address 3202 bits D13-D8,D6-D4 address 3201 bits D6 address 2000
        ############################################################################################
      - name: PV1 Maximum Battery Voltage Today #0x003302
        unit_of_measurement: V
        slave: 1
        address: 13058
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Minimum Battery Voltage Today #0x003303
        unit_of_measurement: V
        slave: 1
        address: 13059
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Generated Energy Today #0x00330C & 0D
        unit_of_measurement: kWh
        slave: 1
        address: 13068
        input_type: input
        scale: 0.01
        precision: 2
        #count: 2
        swap: word
        data_type: int32
      - name: PV1 Generated Energy This Month #0x00330E & 0F
        unit_of_measurement: kWh
        slave: 1
        address: 13070
        input_type: input
        scale: 0.01
        precision: 2
        #count: 2
        swap: word
        data_type: int32
      - name: PV1 Generated Energy This Year #0x003310 & 11
        unit_of_measurement: kWh
        slave: 1
        address: 13072
        input_type: input
        scale: 0.01
        precision: 2
        #count: 2
        swap: word
        data_type: int32
      - name: PV1 Total Generated Energy #0x003312 & 13
        unit_of_measurement: kWh
        slave: 1
        address: 13074
        input_type: input
        scale: 0.01
        precision: 2
        #count: 2
        swap: word
        data_type: int32
      - name: PV1 Battery Voltage #0x00331A
        unit_of_measurement: V
        slave: 1
        address: 13082
        input_type: input
        scale: 0.01
        precision: 2
        data_type: uint16
      - name: PV1 Battery Current #0x00331B & 1C
        unit_of_measurement: A
        slave: 1
        address: 13083
        input_type: input
        scale: 0.01
        precision: 2
        #count: 2
        swap: word
        data_type: int32
###############################################################################

NO. never would used it ever again

Something is missing here.
I created file modbus with code from 2 and put line modbus: !include_dir_merge_list modbus/ in config.yaml
When trying to reboot it checks forever and not giving option to reboot.

Here is my Epever XTRA4415n YAML config working with WIFI to RS485 Stick ELFIN ew-11:

modbus:

  • name: 4415N
    type: rtuovertcp
    host: 192.168.0.8
    port: 9999
    timeout: 9
    sensors:
    • name: 4415N Solar Input V #3100
      scan_interval: 10
      unit_of_measurement: V
      slave: 1
      address: 12544
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Solar Input A #3101
      scan_interval: 10
      unit_of_measurement: A
      slave: 1
      address: 12545
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Solar Power #3102
      scan_interval: 10
      unit_of_measurement: W
      device_class: power
      slave: 1
      address: 12546
      input_type: input
      data_type: int32
      scale: 0.01
      precision: 2
      swap: word
    • name: 4415N Load Voltage V #310C
      scan_interval: 10
      unit_of_measurement: V
      slave: 1
      address: 12556
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Load Current A #310D
      scan_interval: 10
      unit_of_measurement: A
      slave: 1
      address: 12557
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Load Power #310E
      unit_of_measurement: W
      device_class: power
      slave: 1
      address: 12558
      input_type: input
      data_type: int32
      scale: 0.01
      precision: 2
      swap: word
      scan_interval: 10
    • name: 4415N Temperature Battery #3110
      scan_interval: 30
      unit_of_measurement: °C
      slave: 1
      address: 12560
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Temperature Ctrlr #3111
      scan_interval: 30
      unit_of_measurement: °C
      slave: 1
      address: 12561
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N SOC Battery #311A
      scan_interval: 30
      unit_of_measurement: “%”
      slave: 1
      address: 12570
      input_type: input
    • name: 4415N Max V Battery Today #3302
      scan_interval: 600
      unit_of_measurement: V
      slave: 1
      address: 13058
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N MIN V Battery Today #3303
      scan_interval: 600
      unit_of_measurement: V
      slave: 1
      address: 13059
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Consd Energy Today #3304
      scan_interval: 600
      unit_of_measurement: kWh
      slave: 1
      address: 13060
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Consd Energy t/m #3306
      scan_interval: 86400
      unit_of_measurement: kWh
      slave: 1
      address: 13062
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Consd Energy t/y #3308
      scan_interval: 86400
      unit_of_measurement: kWh
      slave: 1
      address: 13064
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Consd Energy total #330A
      scan_interval: 86400
      unit_of_measurement: kWh
      slave: 1
      address: 13066
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Generated Energy Today #330C
      scan_interval: 600
      unit_of_measurement: kWh
      slave: 1
      address: 13068
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Generated Energy t/m #330E
      scan_interval: 86400
      unit_of_measurement: kWh
      slave: 1
      address: 13070
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Generated Energy t/y #3310
      scan_interval: 86400
      unit_of_measurement: kWh
      slave: 1
      address: 13072
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Generated Energy total #3312
      scan_interval: 86400
      unit_of_measurement: kWh
      slave: 1
      address: 13074
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Battery Voltage #331A
      scan_interval: 20
      unit_of_measurement: V
      slave: 1
      address: 13082
      input_type: input
      scale: 0.01
      precision: 2
    • name: 4415N Battery Current #331B
      scan_interval: 20
      unit_of_measurement: A
      slave: 1
      address: 13083
      input_type: input
      scale: 0.01
      precision: 2

Michael

Is there a way to make this config,yaml into an Epever integration?

#Read the Real Time Clock in Epever Solar Controller (4415 XTRA) with Elfin EW11 Wifi-RS485 adapter:

#readRTC.py
import sys
import math
import time
import datetime
from pymodbus.client import ModbusTcpClient
from pymodbus.transaction import ModbusRtuFramer as ModbusFramer

def read_dtg():
  try:
             client = ModbusTcpClient("192.168.0.8", port=9999, framer=ModbusFramer)
             success = client.connect()
             reading = client.read_holding_registers(address=36883,count=3,slave=1)

             dtg_raw = reading.registers

             SCMI = dtg_raw[0]
             HRDY = dtg_raw[1]
             MOYR = dtg_raw[2]

             YR = math.trunc(MOYR/256)+2000
             MO = int(math.fmod(MOYR, 256))

             DY = math.trunc(HRDY/256)
             HR = int(math.fmod(HRDY, 256))

             MI = math.trunc(SCMI/256)
             SC = int(math.fmod(SCMI, 256))

             DTG= datetime.datetime (YR,MO,DY,HR,MI,SC)
             client.close
             return DTG
  except :
             return "Read_Error"

print ("Solar Controller DTG: ",read_dtg())


###################################################


#Set the Real Time Clock in Epever Solar Controller (4415 XTRA) with Elfin EW11 Wifi-RS485 adapter:

#writeRTC.py

import sys
import math
import time
import datetime
from pymodbus.client import ModbusTcpClient
from pymodbus.transaction import ModbusRtuFramer as ModbusFramer

def write_dtg():
  try:
            client = ModbusTcpClient("192.168.0.8", port=9999, framer=ModbusFramer)
            success = client.connect()


            RDTG=datetime.datetime.now()

            NYR= (RDTG.strftime("%y"))
            NMO= (RDTG.strftime("%m"))
            NDY= (RDTG.strftime("%d"))
            NHR= (RDTG.strftime("%H"))
            NMI= (RDTG.strftime("%M"))
            NSC= (RDTG.strftime("%S"))

            NMOYR=(int(NYR)*256+int(NMO))
            NHRDY=(int(NDY)*256+int(NHR))
            NSCMI=(int(NMI)*256+int(NSC))
            NDTG= [ NSCMI, NHRDY, NMOYR ]
            print ("setting new DTG to Epever RTC",RDTG)
            client.write_registers(address=36883,values=NDTG, slave=1 )
#            time.sleep (10)
            client.close

  except:
            return "Write Error"

write_dtg()



That is great just what I wanted but how do I implement the set real time?

scroll down the python code, it’s two parts, read and write!

1 Like

I’ve had this working for quite some time now, but I sometimes need to reboot the epever MPPT because the MPPT seems to get stuck somehow so it won’t generate power properly. After cutting power to it and bringing it back up again, things go back to normal operation. Is there a way to restart it via modbus so I don’t have to physically power cycle it?

Thanks for the clock setting trying to workout where to put the code though. new to this sorry

Put it in a file on your PC, install python and invoke “python filename.py” on the command line, set the proper ip-adress in the scripts

1 Like

Bought the Atom RS-485 kit, installed ESPhome, but struggling to get data, Could you share configs? (have tried different pinouts, but 3 + 5 or any other gives no results so think config is wrong)

I FINALLY MADE IT!

here is my guide to get Epever Tracer-AN series data in Home Assistant
My setup:

  • Epever Tracer-AN 3210
  • RPi3b+
  • Atomic RS-485 kit (connected to the RPi via USB to make updates possible from remote with more control)
  • Epever RS485 1M2S Extension Module (to get both Atom RS485 + MT50 working at same time)
  • Home Assistant 2024.7.4 (pretty much vanilla)
  • ESPHome

Combining both @martgras and several others I managed to puzzle together what probably is a simple solution, but I thought I would describe it for other non-pros like myself to save you the time :slight_smile:

Summary:
Connect Atom Lite with RS485 module with ethernet cable (3+5 pin) to Tracer, install ESPHome and set it up to match your Atom, and then get data flowing directly to entities in HomeAssistant

Guide to modbus and RS485 with ESP (Atom) and Epever Tracer on RPi with HAOS:

  1. Set up the Atomic RS-485 kit with easyLoader tool to make sure it has basic software
  2. Install ESPHome add-on in HA and connect the Atom to RPi with USB-C. Set up new device and “install” it (select connected to server and then the correct UART).
  3. Use “Edit” function on device in ESPHome interface and add WIFI settings that matches your network(s) and INSTALL:
wifi:
  networks:
  - ssid: "???"
    password: "???"
  - ssid: "???"
    password: "???"

NB! Comment out the battery setting example - or just use my config.

Atom should now reboot and connect to your network. When the web_server config is in you can watch the results from the ESP via http and the “visit” link on your device UI in ESPHome:

web_server:
  port: 80
  1. Add Integration when ESPhome device becomes online after reboot and a little while for HA to discover it. (see official guide here)
  2. copy basic setup from EPEVER MPPT Solar Charge Controller (Tracer-AN Series) | devices.esphome.io into your yaml file of your device - either via ESPHome “Edit” or in FileEditor - you find the YAML files in ESPHOME directory.
    5.1. Also copy additional files YAML from esphome.io into files locally (match names) or use my attached files, I corrected some spelling mistakes and missing definitions :slight_smile: .
    5.2. comment out included files besides realtime to make sure stuff works before you add more registers.
  3. Make sure you have the settings for Atom with RS-486 kit correct, THIS IS WHAT IS SPECIFIC FOR ESP DEVICE YOU USE AND DIFFERS FROM ESPHOME EXAMPLE:
esp32:
  board: m5stack-atom
  framework:
    type: arduino

uart:
  id: mod_bus
  tx_pin: 19
 # rx_pin: 18
  rx_pin: 22
  baud_rate: 115200
  stop_bits: 1

(+ the rest)

  1. Cut an Ethernet cable and make sure 3+4 are connected to A on RS485 module, and 5+6 are connected to B. (only 3+5 should be fine, but I was trying so many things before I understood that the problem was the PIN number in the UART setting…)
  2. Reboot Atom by clicking side button or run new install (always validate first) and check that you get connection - you can watch logs or device web page.
  3. Reload integration and VOILÁ see that entities are populated in HA :pray: :raised_hands:
  4. Check what registers you actually want, run new install and set things up in HA UI :slight_smile:
    IMG_4693
    IMG_4690

atomrs485.yaml
tracer-real-time.yaml
tracer-stats.yaml

1 Like

In case it helps anyone, I made a guide a year or so back for anyone wanting remote access for their Epever Hi series hybrid inverter in home assistant… see this thread:

1 Like

Hello, did someone knows how to change the modbus device id of the epever device? Default it’s set to “1” but I would like to change it because I have also a current shunt that can communicate via rs485 on the same cable, but it also has device id “1”, but I cant change it, it’s “hardcoded” in the firmware, and since the epever chargers could be used more than one in parallel, I think should be some way to change the device id… but cant find this information.

If you have a bluetooth or wifi adapter (or built in bluetooth) there’s a way to change the ID; I just don’t know the exact menu you have to get into to make that change. May also be possible with PC control software and the USB RS485 cable