EPEVER Modbus RS-485 Config

I just got done doing part of my code to get Home Assistant working my EPEVER solar charge controller.

Here is the information and I hope it helps. I will ad

Using the eBOX-TCP-02 RS-485 to an 80amp solar charge controller. Some command didn’t work on my controller, but they might work on yours. Note some are commented out, so turn items on and off as needed. This all went into my configuration.yaml file. I plan to add includes later to my file.

modbus:
  - name: epever
    type: rtuovertcp
    host: putyouriphere
    port: putyourporthere

Then I put in this code to match most of the ICD
https://files.i4wifi.cz/inc/_doc/attach/StoItem/7068/MODBUS-Protocol-v25.pdf

#EPEVER
#Rated Data
      - name: PV Charging Equipment Rated Input Voltage #0x003000
        hub: epever
        unit_of_measurement: V
        slave: 1
        register: 12288
        register_type: input
        scale: 0.01
        precision: 1 
#      - name: PV Charging Equipment Rated Input Current #0x003001
#        hub: epever
#        unit_of_measurement: A
#        register: 12289
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Rated Input Power Low #0x003002
#        hub: epever
#        unit_of_measurement: W
#        register: 12290
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Rated Input Power High #0x003003
#        hub: epever
#        unit_of_measurement: W
#        register: 12291
#        register_type: input
#        scale: 0.01
#        precision: 1        
#      - name: PV Charging Equipment Rated Output Voltage #0x003004
#        hub: epever
#        unit_of_measurement: V
#        register: 12291
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Rated Output Current #0x003005
#        hub: epever
#        unit_of_measurement: A
#        register: 12292
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Rated Output Power #0x003006
#        hub: epever
#        unit_of_measurement: W
#        register: 12293
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Rated Output Power 2 #0x003007
#        hub: epever
#        unit_of_measurement: W
#        register: 12294
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Mode #0x003008
#        hub: epever
#        unit_of_measurement: "mode"
#        register: 12295
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Rated Output Current of Load #0x00300E
#        hub: epever
#        unit_of_measurement: A
#        register: 12302
#        register_type: input
#        scale: 0.01
#        precision: 1
##############################################################################
#Real-Time Data (Read only) input register
#      - name: PV Charging Equipment Input Voltage #0x003100
#        hub: epever
#        unit_of_measurement: V
#        register: 12544
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Input Current #0x003101
#        hub: epever
#        unit_of_measurement: A
#        register: 12545
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Input Power Low #0x003102
#        hub: epever
#        unit_of_measurement: W
#        register: 12546
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Input Power High #0x003103
#        hub: epever
#        unit_of_measurement: W
#        register: 12547
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Output Voltage #0x003104
#        hub: epever
#        unit_of_measurement: V
#        register: 12548
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Output Current #0x003105
#        hub: epever
#        unit_of_measurement: A
#        register: 12549
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Output Power Low #0x003106
#        hub: epever
#        unit_of_measurement: W
#        register: 12550
#        register_type: input
#        scale: 0.01
#        precision: 1
#      - name: PV Charging Equipment Output Power High #0x003106
#        hub: epever
#        unit_of_measurement: W
#        register: 12551
#        register_type: input
#        scale: 0.01
#        precision: 1
##############################################################################
#      - name: Over Temp Inside Device # 0x002000
#        hub: epever
#        slave: 1
#        register: 8192
#        register_type: input
#        scale: 1
#        precision: 0
#      - name: Day/Night # 0x00200C
#        hub: epever
#        slave: 1
#        register: 8204
#        register_type: input
#        scale: 1
#        precision: 0
        #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: PV Array Input Voltage #0x003100
        hub: epever
        unit_of_measurement: V
        slave: 1
        register: 12544
        register_type: input
        scale: 0.01
        precision: 2
      - name: PV Array Input Current # 0x003101
        hub: epever
        unit_of_measurement: A
        slave: 1
        register: 12545
        register_type: input
        scale: 0.01
        precision: 2
      - name: PV Array Power # 3102 and 3103
        hub: epever
        unit_of_measurement: W
        slave: 1
        register: 12546
        register_type: input
        scale: .01
        count: 2
        precision: 2
        reverse_order: true
      - name: PV Battery Temperature #0x003110
        hub: epever
        unit_of_measurement: °C
        slave: 1
        register: 12560
        register_type: input
        scale: 0.01
        precision: 2
      - name: PV Device Temperature #0x003111
        hub: epever
        unit_of_measurement: °C
        slave: 1
        register: 12561
        register_type: input
        scale: 0.01
        precision: 2
      - name: PV Battery State of Charge #0x00311A
        hub: epever
        unit_of_measurement: "%"
        slave: 1
        register: 12570
        register_type: input
        scale: 1
        precision: 0
      - name: PV Battery Real Rated Voltage #0x00311D
        hub: epever
        unit_of_measurement: V
        slave: 1
        register: 12573
        register_type: input
        scale: .01
        precision: 0  
      - name: PV Battery Status #0x003200
        hub: epever
        slave: 1
        register: 12800
        register_type: input
        scale: 1
        precision: 0 
        #######################################################################
        #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: PV Charging Equipment Status #0x003201
        hub: epever
        slave: 1
        register: 12801
        register_type: input
        scale: 1
        precision: 0
        #######################################################################
        #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: PV Maximum Battery Voltage Today #0x003302
        hub: epever
        unit_of_measurement: V
        slave: 1
        register: 13058
        register_type: input
        scale: 0.01
        precision: 2
      - name: PV Minimum Battery Voltage Today #0x003303
        hub: epever
        unit_of_measurement: V
        slave: 1
        register: 13059
        register_type: input
        scale: 0.01
        precision: 2
      - name: PV Consumed Energy Today #0x003304 and 0x003305
        hub: epever
        unit_of_measurement: KWh
        slave: 1
        register: 13060
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
      - name: PV Consumed Energy This Month #0x003306 and 07
        hub: epever
        unit_of_measurement: KWh
        slave: 1
        register: 13062
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
      - name: PV Consumed Energy This Year #0x003308 & 09
        hub: epever
        unit_of_measurement: KWh
        slave: 1
        register: 13064
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
      - name: PV Total Consumed Energy #0x00330A & 0B
        hub: epever
        unit_of_measurement: KWh
        slave: 1
        register: 13066
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
      - name: PV Generated Energy Today #0x00330C & 0D
        hub: epever
        unit_of_measurement: KWh
        slave: 1
        register: 13068
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
      - name: PV Generated Energy This Month #0x00330E & 0F
        hub: epever
        unit_of_measurement: KWh
        slave: 1
        register: 13070
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
      - name: PV Generated Energy This Year #0x003310 & 11
        hub: epever
        unit_of_measurement: KWh
        slave: 1
        register: 13072
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
      - name: PV Total Generated Energy #0x003312 & 13
        hub: epever
        unit_of_measurement: KWh
        slave: 1
        register: 13074
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
      - name: PV Battery Voltage #0x00331A
        hub: epever
        unit_of_measurement: V
        slave: 1
        register: 13082
        register_type: input
        scale: 0.01
        precision: 2
      - name: PV Battery Current #0x00331B & 1C
        hub: epever
        unit_of_measurement: A
        slave: 1
        register: 13083
        register_type: input
        scale: 0.01
        precision: 2
        count: 2
        reverse_order: true
###############################################################################

4 Likes

FYI : I started working on a component for esphome.
Still working on it but the basic functionality is ok https://github.com/martgras/esphome/tree/epever/esphome/components/epsolar

(only tested on a ESP32)

2 Likes

Thanks!
I just did the same with the eBox-Wifi-01, here is my documentation:

1 Like

My eBox-Wifi-01 is working great sending back data to my Home Assistant but does anyone know how to make a Switch to turn Load on and off on the charge controller from my Home Assistant?

1 Like

I seem to be struggling to get this setup, also did you manage to get the load switched on and off?

I didn’t manage to get the load switch to turn off and on from HASS. Here’s the config I use in configuration.yaml

# Modbus sensors for EPever Charge Controller 4 (2210 AN)
  - platform: modbus
    scan_interval: 60
    registers:
    - name: "Battery Array Capacity 4"
      hub: epever4
      unit_of_measurement: '%'
      slave: 1
      register: 12570
      register_type: input
    - name: "Solar Power Watts 4"
      hub: epever4
      unit_of_measurement: W
      slave: 1
      register: 12546
      register_type: input
      scale: .01
      count: 2
      precision: 2
      reverse_order: true
    - name: "Solar Amps 4" 
      hub: epever4
      unit_of_measurement: A
      slave: 1
      register: 12545
      register_type: input
      scale: 0.01
      precision: 2
    - name: "Solar Voltage 4" 
      hub: epever4
      unit_of_measurement: V
      slave: 1
      register: 12544
      register_type: input
      scale: 0.01
      precision: 2
    - name: "Battery Charging Watts 4" 
      hub: epever4
      unit_of_measurement: W
      slave: 1
      register: 12546
      register_type: input
      scale: .01
      count: 2
      precision: 2
      reverse_order: true
    - name: "Battery Charging Amps 4"
      hub: epever4
      unit_of_measurement: A
      slave: 1
      register: 13083
      register_type: input
      scale: 0.01
      precision: 2
      count: 1
      reverse_order: true
    - name: "Battery Voltage 4"
      hub: epever4
      unit_of_measurement: V
      slave: 1
      register: 13082
      register_type: input
      scale: 0.01
      precision: 2
    - name: Load Watts 4
      hub: epever4
      unit_of_measurement: W
      slave: 1
      register: 12558  # low 12550  high 12551 #12558
      register_type: input
      scale: 0.01
      precision: 2
    - name: Load Amps 4
      hub: epever4
      unit_of_measurement: A
      slave: 1
      register: 12549
      register_type: input
      scale: 0.001
      precision: 2
    - name: Load Volts 4
      hub: epever4
      unit_of_measurement: V
      slave: 1
      register: 12548
      register_type: input
      scale: 0.01
      precision: 2
    - name: "Battery Temperature 4"
      hub: epever4
      unit_of_measurement: °C
      slave: 1
      register: 12560
      register_type: input
      scale: 0.01
      precision: 2
    - name: "Controller Temperature 4"
      hub: epever4
      unit_of_measurement: °C
      slave: 1
      register: 12561
      register_type: input
      scale: 0.01
      precision: 2
    - name: Energy Generated Today 4
      hub: epever4     
      unit_of_measurement: KWh
      slave: 1
      register: 13068
      register_type: input
      scale: 0.01
      precision: 2
      count: 2
      reverse_order: true
    - name: Energy Generated this Month 4
      hub: epever4     
      unit_of_measurement: KWh
      slave: 1
      register: 13070
      register_type: input
      scale: 0.01
      precision: 2
      count: 2
      reverse_order: true
    - name: Energy Generated this Year 4
      hub: epever4     
      unit_of_measurement: KWh
      slave: 1
      register: 13072
      register_type: input
      scale: 0.01
      precision: 2
      count: 2
      reverse_order: true
    - name: Total Energy Generated 4
      hub: epever4
      unit_of_measurement: KWh
      slave: 1
      register: 13074
      register_type: input
      scale: 0.01
      precision: 2
      count: 2
      reverse_order: true
modbus:
  - type: tcp
    host: 10.240.1.4
    port: 8088
    name: epever4
    timeout: 2
  - type: rtuovertcp
    host: 10.240.1.4
    port: 8088
    name: epever4

Thanks I have managed to get this working now. Still would like to be able to switch the load on and off via home assistant can anyone help?

I can’t help with the load control. Instead I have a question for the EPEVER Modbus RS-485 crew.

My question is: Do you think that Home Assistant, with one e-Box-WiFi-01, connected to six EPEVER Tracer 1206-AN solar charge controllers via Modbus RS-485 daisy chain, can monitor and control each of the six connected 1206-ANs? Do they have unique identifiers? Has anyone tried to control more than one at a time?

Thanks.

Thats exactly what I have tried several times without luck. I even asked the seller and told me I need one device for each controller. I don’t think that’s true because RS-485 is meant to control several devices. I don’t have the ebox-wifi-01 but the ebox-TCP-02, but it’s the same protocol and wiring so it should work.
My controllers have a different id each one, but don’t know what else to do.

Gabriel,

Thank you for sharing your experience with Epever and Modus.

I’ll do some more investigating and post what I find after I receive my 1206AN.

Take care.

I’ve just got a eBox-wifi and had my 1st attempt to set it up tonight as per the instructions from gabrielpc but got something wrong so trying to do a reset but its not working. I’ve tried holding the reload button in for a few seconds as well as for more than 30 seconds but my joy, can anyone help please

I also Emailed Epever yesterday and they replied by sending me a link to a video to download and a document that shows how to do a reset procedure it but unfortunately it didn’t work for me. Its a rather fiddly procedure which for most will probably also require the use of a large magnifying glass.
As mine box it was from Amazon I’m returning it and getting another.
I’ll post the procedure on the forum in case its useful to others.

Here is the procedure sent to me by Epever

I’ve changed the wording of some of it slightly as it was written in rather “Broken English”

eBox WiFi module Restore Method

In the original design, some functions were reserved. We didn’t allow customers to modify it because it may cause the ebox to die. Recently we have received some complaints after some customers modify the settings after following a video on a website, and it can cause the ebox to die and loose signal.

So we now provide a way to recover the ebox, as below:

1、Power on the controller and WiFi module (The WiFi module power is supplied by controller)

2、Short circuit between the fourth pin of WiFi chip and the right pin of C7 using tweezers.

3、Release the tweezers and immediately push the reset button

4、Hold the reset button for five seconds or more

5、Release the button and immediately short circuit between the fourth pin of WiFi chip and the right pin of C7 again quickly.

6、The link light will flash (the WiFi module is restored).

This didn’t work for me but it may work for others.

I have the original pdf document they sent me and a video I down loaded via a link they also sent me which I can also pass on to any members if required

Gabriel,

I installed 6 of the EP-1206-AN solar charge controllers and tied them all onto the RS-485 bus using a Leviton 47689-B 1x9 Bridged Telephone Module, available many places. It has 9 - 110-style connectors that are connected in parallel to its printed circuit board.

Why 6 controllers? It is because I have 6 - 260W 60-cell solar panels and 8 - 12volt AGM batteries. I bought the panels from eBay and the batteries as “:blems” from a local solar supply store in Lemon Grove, CA. The panels are subject to shading from a neighbor’s trees, so best practice is to use one controller per panel. All 6 controllers are connected directly to the 24-volt battery bank. There are 4 sets of 2 - 12 volt batteries. Each 12 volt battery is 105AH, so the entire battery bank is 420AH at 24 volts.

Using the Epever SolarStation software, I was able to configure each EP-1206-AN with its own Device ID. In my case, the device IDs are just the numbers 1 through 6.

Here is the part that you may be missing when attempting to connect to more than one Epever charge controller: The default Device ID is 1. In order to configure the six 1206 controllers, I followed their instructions and made sure that only the 1206 that I was configuring was connected to the RS-485 bus. I then used the SolarStation software to set the Device ID to the desired number. This is done by opening the SolarStation app with just the one Epever controller connected. From the tool bar:
Choose: Port Config/Port Configuration/Serial Port Setting
Set the COM port that your RS-485 converter is connected to. In my case, it is a Waveshare USB-to-RS-485 isolated converter, and it shows up as COM4. Set the Port Configuration to COM4, Baud rate: 115200, and leave the Data Bits, Stop Bits, and Parity at the default 8,1,None.
Add the configured COM4 port (or whatever your’s is) and close that Serial Port Setting screen.

Next, choose: Parameters/Device Parameters/Device ID Settings
Select COM4 by clicking on the Port drop-down arrow
Select Read ID, it should come up with 1. This is where you can change it to 2 or 3 or whatever. Change it to 2, and Select Set ID. It will write the Device ID to the connected Epever controller.
Select Read ID, it should come back with 2.

The SolarStation software can now tell the difference between the Epever controllers if you give them each unique Device IDs like 1, 2, 3, 4, 5, and 6 (in my case).

I was able to use the SolarStation software to give each controller a name by right-clicking on the list of controllers under COM4, and selecting Edit Station. I called my controllers EP-1206-AN-1, EP-1206-AN-2, etc.

Once that is done, you should go through all of the settings and make sure they match your use case. In my case, I felt it was especially critical to change the Parameters/Control Parameter/Control Parameter to make sure that the Battery Type=Sealed, and that the Boost Duration was set to 90 min, and the Equalisation Duration was set to 0.

So, you should be able to use the freely downloadable SolarStation app to configure the Epever solar charge controllers, and then you can control them with either SolarStation or Home Assistant.

Let me know whether you were able to try this and whether it worked? I hope it does, so that I can use your notes and add these controllers to my Home Assistant setup.

Thanks! I already tried that without luck.
I think one of my controllers is bad, because today I tried with a USB to rs485 and it didn’t work. I probably caused an issue on it after trying many times to set the device id to 2, it stopped responding to the solar station.

This is what I use to control the load from HA on my EPEver. Hope this helps.

sensor:
  - platform: modbus
  scan_interval: 15
  coils:
    - name: Solar Load
      hub: hub1
      slave: 1
      coil: 2

Thanks. That has definitely helped. It wouldn’t work with my other epever sensors so I had to make it a binary_sensor:

binary_sensor:    
  - platform: modbus
    scan_interval: 60
    coils:
    - name: Solar Load 3
      hub: epever
      slave: 1
      coil: 2

However, were you able to make it a switch so you could turn it off and on?

I manged to get it working by putting those settings in my switch config:

switch:
  - platform: modbus
    scan_interval: 10
    coils:
    - name: Solar Load Switch 1
      hub: epever
      slave: 1
      coil: 2
    - name: Solar Load Switch 2
      hub: epever
      slave: 2
      coil: 2
    - name: Solar Load Switch 3
      hub: epever
      slave: 3
      coil: 2

Thanks a lot. I’ve been wanting to get this working for ages.

Awesome. Glad to hear it’s working for you.

Fyi I submitted a PR for esphome to improve modbus support : Modbus controller by martgras · Pull Request #1779 · esphome/esphome · GitHub

There’s an example for epever included that shows how to configure battery settings or the rtc clock

More details are in the readme esphome/esphome/components/modbus_controller at modbus_controller · martgras/esphome · GitHub

Greg & @gabrielpc , you might take a look at the Elfin EW11. They’re inexpensive and much more flexible than the e-Box models. They allow configuration of multiple interfaces on multiple ports within each device. I do have 2 Epever controllers, but only have one hooked up currently so I can’t test it. Having successfully set up both the e-Box-WiFi and the EW11, I can definitely say the config options on the latter are much more robust.