Solution updated below for Elfin EW11 and EPEver eBox-Wifi-01 in August 2021 for Modbus changes in core 7.1
How-to connect an Epever / Epsolar Tracer solar charge controller to Home Assistant. The output is RS485 via RJ45. The Epever eBox-WIFI-01 I tried first was bricked when attempting a by-the-book firmware update before I had a chance to test it with HA. Since I had a bad experience with that piece of hardware, I picked up an Elfin EW11, which also does wifi to RS485/Modbus.
Of note, the EW11 has the following protocols on the wifi side:
- Tcp server
- Tcp client
- Udp server
- Udp client
- Mqtt
- HTTP
- Telnetd
- WebSocket
- Ali IoT
Other than avoiding Ali Iot
, iām not all that particular about which one works. However, the default Tcp server
or MQTT
seem like the best options. Unfortunately, I havenāt been able to get either working. I thought it would be simple, like in the thread belowā¦
Continuing the discussion from Modbus TCP:
TCP Server / Modbus
Starting off, hereās my modbus config in HA:
modbus:
- type: tcp
host: 192.168.1.232
port: 8899
name: hub1
- type: rtuovertcp
host: 192.168.1.232
port: 8899
name: hub2
I have 2 hubs set up for testing purposes. Iām not sure which is correct for the Epever charge controller (CC).
Sensor section of configuration.yaml
- platform: modbus
registers:
- name: Bank 1 Voltage
hub: hub1
unit_of_measurement: V
slave: 1
register: 0x3004
register_type: input
- name: Bank 1 Vx
hub: hub2
unit_of_measurement: V
slave: 1
register: 0x3004
register_type: input
The CC modbus register manual [PDF] I found has the following statement:
Communication protocol is standard Modbus-RTU protocol.
This introduces a fork Iām not sure how to traverse. I donāt know if HA should see TCP or RTU after being output from the EW11, so Iāve tried both.
The EW11 manuals have a single mention of RTU in the UART section:
ā NONE: Default: None, transparent transmission, the received UART data will be directly sent to network.
ā Modbus: Modbus RTU to Modbus TCP.
ā Frame: Enable auto-frame function. Relevant parameters are set in Frame command.
Iām not completely sure how to interpret that. If I set the Serial Port protocol in the EW11 to None
, does that mean it passes raw RTU, in which case I would guess configuration.yaml should be set to rtuovertcp
? If I set the Serial Port Protocol to Modbus
, does HA want to see tcp
in configuration.yaml? I donāt know, but Iāve tried all 4 permutations with no success.
Hereās the Serial Port Settings for the EW11:
Hereās the settings screen for the Tcp server:
MQTT
I can configure the MQTT settings in the EW11 for it to connect to the Mosquitto broker Add-on in HA. As well, the logs show that it connects successfully. However, nothing new shows up in MQTT (devices, entities, etc.).
EW11 MQTT settings:
Since it was connecting, but not showing up, I pulled up MQTT Explorer, and connected to Mosquito broker. The topic shows up under ew11, but something is wrong (the epever
topic is a remnant from other failed tests):
Inconclusion
Soā¦ Iāve been working on this for a lot of hours ā juggling configurations as many different ways as I can think of, but Iām stumped.
Any ideas for getting this going in TCP/modbus or MQTT (or anything, really)?
Oh, I did have to wire a custom connector for this. Iāve gotten mixed information about the polarity of the A and B side of the RS485 connection. Iāve tried it both ways, but have mostly been conducting tests wired according to the Epever manual (linked above).
Edit: Notes now that itās working
-
Experienced multiple instances of settings not being applied after a save (āSubmitā), and not even being applied after a soft restart. The settings would appear correct in the UI, but not actually be applied. This sometimes appeared to be resolved by a power cycle, was sometimes resolved by uploading a known-good configuration file (Others ā Backup ā Restore), and perhaps even a factory reset (I believe pin 4 is the reset pin, and needs to be held down for something like 10 seconds while powered up).
-
The EW11 Manuals have a hard-coded link to an outdated file. It is to a .zip archive with a bunch of resources on modbus, and a few other things. This is the correct download page.
-
Modbus polling tool. The files in the link above also contain the most useful modbus app I found, as well as an activation that isnāt available if you download directly from the publisher. The UI isnāt necessarily intuitive, but it exposed data others didnāt. Hereās the quickstart guide at the developerās website.