Epever RS485 + Elfin EW11 WiFi Modbus (or MQTT)

Excellent! Maybe the factory reset after all your initial testing and reversed A-B lines was just what was required. I think anyone reading this will easily be able to use your process to help them get their project up and running.

I have reason to believe there is an EW11 firmware bug where the settings do not fully apply, even after a soft restart. Something with the memory perhaps. Will add a tip to hard restart in the case of problems to the notes in the OP.

1 Like

I’m still not sure what fixed it, but the factory reset seems most likely. I had reversed the A-B lines dozens of times in testing. It eventually became clear that the settings were not actually taking hold, so I wasn’t observing the actual results of various settings/tests I thought I’d done.

The EW11 can be found for about half the price of the Epever wifi box, and is a lot more flexible. They also seem to be actively releasing firmware updates, so maybe these glitches will be resolved. The Github Gist and HA config in the solution post should get folks going quick enough to not have to mess with a million saves and restarts. :laughing:

I still can’t get MQTT to receive any modbus data. Messing around with that again for an hour is partially what confirmed the settings-not-applying issue.

Now I just have to replicate the process for my Renogy inverter – which has RS485/modbus, but they won’t share any of the information, and just want to sell their proprietary bluetooth dongle which only works with their proprietary phone app. :face_vomiting:

Oh well, I learned enough with this detour that I might actually be able to reverse-engineer the registers on that one. :crazy_face:

Haha…best of luck…inverters are often very much locked down so do your research well on that project.

Thanks this helped me a out a lot. I wrote up most of the ICD into this post to help people

2 Likes

Have you set up any switches yet? I scrolled through your post and didn’t see any. I haven’t tried yet, but at some point I’ll probably work on being able to turn the “Load” on and off.

I will post when I get that done. I’ve done it before on my victron ccgx so should be easy

1 Like

I found this topic really helpfull to make my own system work with the EPEver eBox-Wifi-01.
I’m going to leave the link to my notes on how to make it work with Home Assistant, just in case someone else wants to do it.

Hello. Can you tell me how do you link elfin ew11 to epsolar? It.s only by Ethernet cable or we have to buy either the cable to split up the power from the serial port? Can you post a photo?

:warning: Please test these before plugging it in, because I am only going off of memory and could be wrong.

A regular ethernet cable won’t work. You have to make a custom cable because the pins are not standard and are different on both devices. I need to make another cable, and will try to document it better when I do. Until then, here are my notes on the pins. It has been a few months since I did this, and I don’t remember if I had to make changes when I actually wired it.

Also, this cable only works properly when plugged in a certain direction. Reversing the cable will cause it not to work, and may cause damage.

Correct EW11 - Epever Wiring

A+ White/Blue - Green
B- Green - Blue
VCC + White/Brown - Orange
GND - Brown - Brown

Did you ever work out how to add a Load on/off switch?

Second this, did you manage to get any switching working?

Never did. I do want to get switches working, but in my application I had to add air temperature sensors, and I’m already running the DC switching off ESPHome with a relay.

I have the official Epever wifi adapter waiting at the post office. I’m going to test it on my 2nd charge controller to see if I can figure it out, but I haven’t really messed with this since I originally got it set up.

Hey guys, I’m not a Home Assistant user (I tried it and decided it wasn’t for me) but I have been doing quite a lot of work with these EPEVER solar controllers and I managed to get load switching working for me.

The key thing is that the controller’s load settings have to be set to manual via the controller’s LCD’s front panel controls. These settings are probably the least intuitive and worst documented feature of the controller, but I think the correct settings are 117, 2n

Once it’s in manual mode then you have to write a 1 or a 0 to coil 0x0002 to turn the relay on or off. 0x0002 is the HEX address, and it seems that HA uses decimal addresses for the registers, but 2 is the same in HEX and Decimal, so that bit should be easy :slightly_smiling_face:

From what I’ve seen above about how you’d do this in HA, I guess it will be a register_type: output command with register: 2.
The bit I can’t tell from the posts above, is how you get HA to output the 1 or 0 values to turn the load on or off, but I’m guessing you guys can figure that bit out.

I’m communicating with my controllers using a Wemos D1 Mini and an RS485 converter, which serves as a Modbus to MQTT bridge. The problem I have at the moment is that one of my controllers, which is in Spain (I’m in the UK) has gone rogue and is trying to fry my batteries!
My attempts to remotely command my controller to shut down have been unsuccessful, so I’m currently turning on the load (garden lighting) as soon as the panel starts outputting anything, in an attempt to slow down the battery charging rate.

Anyone who has a solar system ought to put some time into working-out how they would deal with this scenario, and experiment with adjusting parameters like Battery temperature warning upper limit. It seems from my remote monitoring that my batteries are hitting 70 Celsius before the controller is shutting off, which worries me a little! :fire:

Pete.

2 Likes

I wanted to connect my EPever Triron N to Home Assistant with an Elfin EW11 and I am grateful for all your infos. Could not have managed without. Regarding the custom cable I had to add half a usb cable to get power to the EW11 (none provided by my RS485 plug). I have cut a standard RJ45 in halfes and connected the three cables like the list shows below. worked with modbus / home assistant. I hope this might help others with the custom cable

Used:

RJ45-Nr Elfin EPever USB
1 - - -
2 - - -
3 - - -
4 - blue -
5 whiteblue - -
6 green green -
7 whitebrown - red
8 brown brown black

Connections:

B- green (6) Elfin to blue (4) EPEver
A+ whiteblue (5) Elfin to green (6) EPever
VCC +5V whitebrown (7) Elfin to red USB
GND all 3 connected Elfin brown (8), EPever brown (8), black USB

1 Like

I now have a working ebox-WIFI-01 in addition to the EW11. I’m doing some early tests, but my main thing at this point would be to get switches working.

Modbus Switches

Official HA Documentation for Modbus Switches

Example configuration.yaml entry

modbus:
  - name: hub1
    type: tcp
    host: IP_ADDRESS
    port: 502
    switches:
      - name: Register1
        address: 11
        command_on: 1
        command_off: 0

Test configuration.yaml

(based on info from @Peterkn )

modbus:
  - type: tcp
    host: IP_ADDRESS
    port: 502
    name: hub1
    switches:
      - name: EPEver Load Switch
        address: 2
        input_type: coil
        command_on: 1
        command_off: 0

Result: Fails

1 Like

I got this working for my 3 epever charge controllers by putting it into my Switch config like this:

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
4 Likes

Thank you @Brynn. That worked for me on the first try. Just had to swap in hub: hub1 instead of hub: epever to match my config from a year ago.

That’s great news.