EPEVER Modbus RS-485 Config

Hi Brynn,

I have an Epever 4210AN with an original epever rs485 to usb cable: CC-USB-RS485-150U
I have Home assistant installed in Proxmox on a minicPC.
I connected the USB cable to a port in the MiniPC, and i made a pass-through to the VM.

I can see the USB connection in Home assistant as /dev/ttyACM0
I tried your config but not working, any idea what to do next?
this is my config:

modbus:  
  - name: epever
    port: /dev/ttyACM0
    delay: 5
    close_comm_on_error: true
    retry_on_empty: true
    retries: 10
    type: serial
    baudrate: 115200
    bytesize: 8
    method: rtu
    parity: N
    stopbits: 1
    sensors:
      - name: "Battery Array Capacity 1"
        unit_of_measurement: "%"
        slave: 1
        device_class: battery
        address: 12570
        input_type: input
        scan_interval: 5
      - name: "Solar Power Watts 1" # 3102 and 3103 https://community.home-assistant.io/t/epever-modbus-rs-485-config/214397
        unit_of_measurement: W
        device_class: power
        slave: 1
        address: 12546
        input_type: input
        data_type: int32
        scale: 0.01
        count: 2
        precision: 2
        swap: word
        scan_interval: 5
      - name: "Solar Voltage 1" #3100
        unit_of_measurement: V
        slave: 1
        device_class: voltage
        address: 12544
        input_type: input
        scan_interval: 5
        scale: 0.01
        precision: 2
1 Like

Epever is tricky with Home Assistant because you have to compile the XRUSB driver for it to work. Your easiest option would be to buy an Epever eBox Wifi unit. They are really easy to setup.

After reading a lot of posts, I understand that the driver for the original cable is very hard to install in linux, I ordered a TTL USB module and I will go via ESPHOME path.
Thanks for replying.

1 Like

After a tinkering with the drivers i have found a good tutorial here: Exar XR21B1411 driver - Raspberry Pi Forums

I installed on an RPI a fresh Raspian, installed the drivers after that I installed the HASS core in docker. Now your config works like a charm. Thanks @Brynn

1 Like

That’s great news.

Hi
I have an Epever with Wifi Box and it is connected to my home network. Unfortunately, the configuration does not work. The entity is only displayed in light gray.

This entity (“sensor.epever_battery_current”) does not have a unique ID, so the settings cannot be managed from the UI. Check the documentation for more details.

Have you given it a name like this:

      - name: "Epever Battery Amps"
        device_class: current
        unit_of_measurement: A
        slave: 1
        address: 12549
        input_type: input
        scale: 0.001
        precision: 2
        scan_interval: 5

Hi, i have a Wifi Box 01, and i have change it to STA mode and added to my local network. ( not LSD ).
I have acess to the wifi box inside my network but i cant acess the data.

I have tryed several virtual port software and nothing work to get data to the epever software.

Also i have insered the latest modbus settings on homeassistant and still no data. I have tried TCP, rtuovertcp and i always get this error:

Pymodbus: hub1: Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response

The charger is a Tracer AN 50A, i can use the wifi box with the app, and since i put it inside my network i can acess the config menu in my local network.

modbus:
- type: rtuovertcp
  name: hub1
  host: 192.168.1.185
  port: 8088
  close_comm_on_error: false
  timeout: 9
  delay: 9
  message_wait_milliseconds: 50
  retry_on_empty: true
  retries: 10
  sensors:
      - name: "Battery Array Capacity IOT"
        unit_of_measurement: "%"
        slave: 1
        device_class: battery
        address: 12570
        input_type: input
        scan_interval: 5
      - name: "Solar Power Watts IOT" 
        unit_of_measurement: W
        device_class: power
        slave: 1
        address: 12546
        input_type: input
        data_type: int32
        scale: 0.01
        count: 2
        precision: 2
        swap: word
        scan_interval: 5
      - name: "Solar Voltage IOT" #3100
        unit_of_measurement: V
        slave: 1
        device_class: voltage
        address: 12544
        input_type: input
        scan_interval: 5
        scale: 0.01
        precision: 2

I have bought i wifi box and still canot get it to work with home assistant.

In the settings of your wifi unit ensure that it is using port 8088

Hi Miguel, have you tried adding the data_type to your sensors?

Here’s part of my working config for the WiFi Box:

modbus:
  - type: rtuovertcp
    name: epever
    host: 10.0.0.188
    port: 8088
    switches:
     - name: Load Switch
       slave: 1
       address: 2
       write_type: coil
       verify:
    sensors:
      - name: Battery
        address: 13082
        data_type: uint16
        slave: 1
        unit_of_measurement: V
        input_type: input        
        scale: 0.01
        precision: 2
        scan_interval: 10
      - name: Solar Power # 3102
        address: 12546
        slave: 1
        data_type: uint16
        input_type: input
        unit_of_measurement: W
        state_class: measurement
        device_class: power
        scale: 0.01

Humm, stil nothing.

Im sure the port is 8088, i scan IP and the port is open, and im conected to the wifi box. I still can’t decode any data.

I dont know what to do more.

I get this in home assistant.

Pymodbus: epever: Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
08:47:17 – (ERRO) Modbus

I now disabled the MT50 and using only the Wifi Box. The home assistant message changed but still not recieving data.

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:304
Integration: Modbus (documentation, issues)
First occurred: 16:33:20 (1 occurrences)
Last logged: 16:33:20

Pymodbus: epever: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 2 bytes (0 received)

Damn. Color me impressed. I’ve been using a Pi with a Python script to send the data over MQTT to my OpenHAB box. This would simplify it and free up a Pi for some other task.

I have same issue with modbus and eBox-TCP-02. No data received.

Works perfectly fine with AdamWelchUk nodered routine via mqqt.

How do you get the ip of the epever?

I have connected my epever charge controller to my HA RPI but don’t get any data with the below configuration.

Must I install any drivers? How do I find out which port my epever is using?

modbus:
  - name: "epever"
    type: rtuovertcp
    host: 192.168.1.100
    port: 8088
    delay: 5
    timeout: 10
    close_comm_on_error: false
    retry_on_empty: true
    retries: 20
    sensors:  
      - name: "epever PV Charging Equipment Rated Input Voltage" #0x003000
        unit_of_measurement: V
        slave: 1
        address: 12288
        input_type: input
        scale: 0.01
        precision: 1 
      - name: "epever PV Array Input Voltage" #0x003100
        unit_of_measurement: V
        slave: 1
        address: 12544
        input_type: input
        scale: 0.01
        precision: 2
      - name: "epever PV Array Input Current" # 0x003101
        unit_of_measurement: A
        slave: 1
        address: 12545
        input_type: input
        scale: 0.01
        precision: 2
      - name: "epever PV Array Power" # 3102 and 3103
        unit_of_measurement: W
        slave: 1
        address: 12546
        input_type: input
        scale: .01
        count: 2
        precision: 2
      - name: "epever PV Battery Temperature" #0x003110
        unit_of_measurement: °C
        slave: 1
        address: 12560
        input_type: input
        scale: 0.01
        precision: 2
      - name: "epever PV Device Temperature" #0x003111
        unit_of_measurement: °C
        slave: 1
        address: 12561
        input_type: input
        scale: 0.01
        precision: 2
      - name: "epever PV Battery State of Charge" #0x00311A
        unit_of_measurement: "%"
        slave: 1
        address: 12570
        input_type: input
        scale: 1
        precision: 0
      - name: "epever PV Battery Real Rated Voltage" #0x00311D
        unit_of_measurement: V
        slave: 1
        address: 12573
        input_type: input
        scale: .01
        precision: 0  
      - name: "epever PV Battery Status" #0x003200
        slave: 1
        address: 12800
        input_type: input
        scale: 1
        precision: 0 
      - name: "epever PV Charging Equipment Status" #0x003201
        slave: 1
        address: 12801
        input_type: input
        scale: 1
        precision: 0
      - name: "epever PV Maximum Battery Voltage Today" #0x003302
        unit_of_measurement: V
        slave: 1
        address: 13058
        input_type: input
        scale: 0.01
        precision: 2
      - name: "epever PV Minimum Battery Voltage Today" #0x003303
        unit_of_measurement: V
        slave: 1
        address: 13059
        input_type: input
        scale: 0.01
        precision: 2
      - name: "epever PV Consumed Energy Today" #0x003304 and 0x003305
        unit_of_measurement: KWh
        slave: 1
        address: 13060
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
      - name: "epever PV Consumed Energy This Month" #0x003306 and 07
        unit_of_measurement: KWh
        slave: 1
        address: 13062
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
      - name: "epever PV Consumed Energy This Year" #0x003308 & 09
        unit_of_measurement: KWh
        slave: 1
        address: 13064
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
      - name: "epever PV Total Consumed Energy" #0x00330A & 0B
        unit_of_measurement: KWh
        slave: 1
        address: 13066
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
      - name: "epever PV Generated Energy Today" #0x00330C & 0D
        unit_of_measurement: KWh
        slave: 1
        address: 13068
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
      - name: "epever PV Generated Energy This Month" #0x00330E & 0F
        unit_of_measurement: KWh
        slave: 1
        address: 13070
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
      - name: "epever PV Generated Energy This Year" #0x003310 & 11
        unit_of_measurement: KWh
        slave: 1
        address: 13072
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
      - name: "epever PV Total Generated Energy" #0x003312 & 13
        unit_of_measurement: KWh
        slave: 1
        address: 13074
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
      - name: "epever PV Battery Voltage" #0x00331A
        unit_of_measurement: V
        slave: 1
        address: 13082
        input_type: input
        scale: 0.01
        precision: 2
      - name: "epever PV Battery Current" #0x00331B & 1C
        unit_of_measurement: A
        slave: 1
        address: 13083
        input_type: input
        scale: 0.01
        precision: 2
        count: 2
1 Like

OMG, I got it to work using your settings. Unbelievable. Didn’t have to install any drivers on a clean RPI4 install. Thanks!!!

Hello,
Thank you very much for this post which helped me a lot!
Then I have a functional configuration, which I transmit to you below.
To begin I have an EPEVER XTRA3210N-XDS2.
I have then a machine for modbus with the software “mbusb”.

With a chinese cable and the “CH343” chip I have installed the driver:

I have configured as follows MBUSB

root@modbus:/etc/mbusd# cat mbusd-ttyCH343USB0.conf 
#############################################
#                                           #
#    Sample configuration file for mbusd    #
#                                           #
#############################################

########## Serial port settings #############

# Serial port device name
device = /dev/ttyCH343USB0

# Serial port speed
speed = 115200

# Serial port mode
mode = 8n1

# RS-485 data direction control type (addc, rts, sysfs_0, sysfs_1)
trx_control = addc

# Sysfs file to use to control data direction
# trx_sysfile =

############# TCP port settings #############

# TCP server address to bind
address = 0.0.0.0

# TCP server port number
port = 502

# Maximum number of simultaneous TCP connections
maxconn = 32

# Connection timeout value in seconds
timeout = 60

######### Request/response settings #########

# Maximum number of request retries
retries = 3

# Pause between requests in milliseconds
pause = 100

# Response wait time in milliseconds
wait = 500

# Reply on Broadcast
replyonbroadcast = no

I then connected it in modbus to Home Assitant

#EPEver eBox-Wifi-01 modbus
modbus:
  - type: tcp
    name: "Solar2EP"
    host: 192.168.1.240
    port: 502
    delay: 5
    timeout: 10
    close_comm_on_error: false
    retry_on_empty: true
    retries: 20
    # Modbus sensors for EPever Charge Controller 4 (4310 AN)
    sensors:
    - name: "Solaire Volt" 
      unique_id: epever.solarvolt
      unit_of_measurement: V
      slave: 1
      address: 12544
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Solaire Ampere" 
      unique_id: epever.solarapm
      unit_of_measurement: A
      slave: 1
      address: 12545
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Solaire Status"
      unique_id: epever.solarstatus
      slave: 1
      address: 12545
      input_type: input
      precision: 2
      swap: word
    - name: "Solaire Watt L"
      unique_id: epever.solarwatt
      unit_of_measurement: W
      slave: 1
      address: 12546
      input_type: input
      data_type: int32
      scale: 0.01
      count: 2
      precision: 2
      swap: word
    - name: "Solaire Watt H"
      unique_id: epever.solarwatt2
      unit_of_measurement: kWh
      slave: 1
      address: 12547
      input_type: input
      data_type: int32
      scale: 0.01
      count: 2
      precision: 2
      swap: word
#    - name: "Solaire kWh"
#      unique_id: epever.solairewattkwh
#      unit_of_measurement: "kWh"
#      slave: 1
#      address: 12546
#      input_type: input
#      data_type: int32
#      scale: 0.0000000001
#      count: 2
#      precision: 4
#      scan_interval: 20
#      device_class: energy
#      state_class: total_increasing
    - name: "Batterie Capacité"
      unique_id: epever.batcap
      unit_of_measurement: "%"
      slave: 1
      address: 12570
      input_type: input
    - name: "Charging status" 
      unique_id: epever.charginwatt
      unit_of_measurement: W
      slave: 1
      address: 12801
      input_type: input
      scale: 0.01
      count: 2
      precision: 2
      swap: word
    - name: "Batterie Max volt"
      unique_id: epever.batmaxvolt
      unit_of_measurement: V
      slave: 1
      address: 13058
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Batterie Min volt"
      unique_id: epever.batminvolt
      unit_of_measurement: V
      slave: 1
      address: 13059
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Batterie Volt"
      unique_id: epever.batvolt
      unit_of_measurement: V
      slave: 1
      address: 13082
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Batterie Ampere"
      unique_id: epever.batamp
      unit_of_measurement: A
      slave: 1
      address: 13083
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Consommation Ampere "
      unique_id: epever.loadamp2
      unit_of_measurement: A
      slave: 1
      address: 12557
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Consommation Watt L"
      unique_id: epever.loadwatt
      unit_of_measurement: W
      slave: 1
      address: 12558  # low 12550  high 12551 #12558
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Consommation Watt H"
      unique_id: epever.loadwattH
      unit_of_measurement: W
      slave: 1
      address: 12559  # low 12550  high 12551 #12558
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Consommation Volt"
      unique_id: epever.loadvolt
      unit_of_measurement: V
      slave: 1
      address: 12556
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Batterie Température"
      unique_id: epever.battemp
      unit_of_measurement: °C
      slave: 1
      address: 12560
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Controlleur Température"
      unique_id: epever.controltemp
      unit_of_measurement: °C
      slave: 1
      address: 12561
      input_type: input
      scale: 0.01
      precision: 2
    - name: "Generation KWh jour"
      unique_id: epever.productoday
      unit_of_measurement: KWh
      slave: 1
      address: 13068
      input_type: input
      data_type: int32
      scale: 0.01
      precision: 2
      count: 2
      swap: word
    - name: "Generation KWh jour 2 "
      unique_id: epever.producday
      unit_of_measurement: KWh
      slave: 1
      address: 13068
      input_type: input
      data_type: int32
      scale: 0.01
      precision: 2
      count: 2
      swap: word
    - name: "Generation KWh mois"
      unique_id: epever.producmonth
      unit_of_measurement: KWh
      slave: 1
      address: 13070
      input_type: input
      data_type: int32
      scale: 0.01
      precision: 2
      count: 2
      swap: word
    - name: "Generation KWh année"
      unique_id: epever.producyear
      unit_of_measurement: KWh
      slave: 1
      address: 13072
      input_type: input
      data_type: int32
      scale: 0.01
      precision: 2
      count: 2
      swap: word
    - name: "Generation KWh Total"
      unique_id: epever.productotal
      unit_of_measurement: KWh
      slave: 1
      address: 13074
      input_type: input
      data_type: int32
      scale: 0.01
      precision: 2
      count: 2
      swap: word

I’m still trying to understand the difference between PV ARRAY LOW and HIGH, that’s why there are high values on the panel

1 Like