Integrating SRNE MPPT Inverter with HA

I have managed to integrate my SRNE inverter to HA using ESP32 & ESPHome addon.

Part of my yaml file is as follows.

esphome:
  name: srne
  friendly_name: SRNE

esp32:
  board: esp32dev
  framework:
    type: arduino


# Enable Home Assistant API
api:
  encryption:
    key: "+EMWnue33wLGXOUUcZdBgtEcWOJjQIPoN7E3WbVj2UA="

ota:
  password: "27a70d64573b33d2dc248577739abfa5"


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: 192.168.1.16
  manual_ip:
    static_ip: 192.168.1.16
    gateway: 192.168.1.1
    subnet: 255.255.255.0

uart:
 id: mod_bus
 tx_pin: 19
 rx_pin: 18
 baud_rate: 9600
 stop_bits: 1
 
modbus:
 id: tdt1_modbus
 flow_control_pin: 4
 
modbus_controller:
 - id: srne1
   address: 0x01
   modbus_id: tdt1_modbus
   setup_priority: -10
   update_interval: 15000ms #data refresh rate
                       
sensor:

 - platform: modbus_controller
   modbus_controller_id: srne1
   name: "Inverter Frequency" #name for HA
   id: srne_inverter_freq #id for HA
   register_type: holding
   address: 0x0218 
   unit_of_measurement: Hz 
   filters:
      - multiply: 0.01  

 - platform: modbus_controller
   modbus_controller_id: srne1
   name: "Output Priority" #name for HA
   id: srne_output_priority #id for HA
   register_type: holding
   address: 0xE204 

 - platform: modbus_controller
   modbus_controller_id: srne1
   name: "Charger Priority" #name for HA
   id: srne_charger_priority #id for HA
   register_type: holding
   address: 0xE20F 

Since E204 support read write both, how can I change the value of that registry through Home Assistant?

What I want to do is to change the Output priority UTI, SBU, SOL through HA automation.
Is this possible?

I tried the following way

switch:
  - platform: template
    name: "Output Priority Switch"
    id: output_priority_switch
    turn_on_action:
      - modbus.write_register:
          id: tdt1_modbus
          address: 0xE204
          value: 1
    turn_off_action:
      - modbus.write_register:
          id: tdt1_modbus
          address: 0xE204
          value: 0

But it gives me the error

switch.template: [source /config/esphome/srne.yaml:52]
platform: template
name: Output Priority Switch
id: output_priority_switch
turn_on_action:

Unable to find action with the name ‘modbus.write_register’.
modbus.write_register:
id: tdt1_modbus
address: 57860
value: 1

How can I do this?
Please help

Esphome is beyond my knowledge unfortunately. I have no clue :confused:

1 Like

under the select section use this:

select:

  • platform: modbus_controller
    modbus_controller_id: srne
    id: Output_priority
    name: ${name}_Output_priority
    address: 0xE204
    value_type: U_WORD
    icon: mdi:power
    optionsmap:
    “SOL”: 0
    “UTI”: 1
    “SBU”: 2

Hi @adambennett55

Thank you for the reply. This is how I put your code in my srne.yaml file

select:
 - platform: modbus_controller
   modbus_controller_id: srne1
   name: "Output Prority" #name for HA
   id: srne_output_priority #id for HA
   address: 0xE204
   value_type: U_WORD
   icon: mdi:power
   optionsmap:
      “SOL”: 0
      “UTI”: 1
      “SBU”: 2

it gives me following when I try to send the code to ESP32

sensor.modbus_controller: [source /config/esphome/srne.yaml:176]
  platform: modbus_controller
  modbus_controller_id: srne1
  name: Output Priority
  
  ID srne_output_priority redefined! Check select->0->id.
  id: srne_output_priority
  register_type: holding
  address: 57860
  disabled_by_default: False
  force_update: False
  bitmask: 0xFFFFFFFF
  skip_updates: 0
  force_new_range: False
  response_size: 0
  value_type: U_WORD
  register_count: 0

Please help

Unrelated, but if you have any Openwrt device around and don’t want to buy the bridge:

You can install the kmod-usb-serial-ch341 and use the usb port on your device to connect to the usb port in the srne inverter, then install mbusd on openwrt and it will act as a brige for you.

I happened to have one traveler router that I didn’t use anymore, so I set it up as a wifi client, and viola, I’m getting my metrics with the configuration that @Mattie posted above.

1 Like

A friend created the full esphome integration. I created a card to easily connect to it, https://github.com/SeByDocKy/myESPhome/blob/8dc25d9a12194c6a29289947f18026ab353aceae/code/srne.yaml

I actually got the Waveshare RS485 to ETH converter but I realized late that I would need to connect it to a router’s ethernet port. I use a Starlink device and I do not want to spend more money for an ethernet adapter, so I’m going the SRNE to HA through ESPHome route. Let’s see how it goes.

If it still matters you could buy a Unifi AP ac pro or another accesspoint able to wirelessly connect to a WiFi the Unifi AP then has a Ethernet port where you can plug in a waveshare gw.

This would cost more money than getting the ethernet adapter for my Starlink. If the ESP32 doesn’t work well, I’ll fall back to the Waveshare method.

Understandable

1 Like

@Dimumal can you share how you connected the Inverter to the ESP32? Do you have a wire schematic buy chance?

https://shorturl.at/hiowY

Did you ever get this working?

I too have the ASF10K I’m using a QinHeng Electronics CH340 serial converter rs485 to usb.
Connected pins 7,8 the converter.
When i connect HA with the following code

modbus:
  - name: modbus_hub
    type: serial
    port: /dev/ttyUSB0
    baudrate: 9600
    bytesize: 8
    method: rtu
    parity: E
    stopbits: 1

    delay: 0
    message_wait_milliseconds: 30
    timeout: 5 

I get no data.

I connected through minicom/php and the data looks like binary.

Snippet below

x40\x00\x10\x01\x82\x00\xc0\x10\x00\x00\x00\x48\x01\x00\x44\x04\x90\x00\x44\x40\x40\x45\x41\x00\x80\x04\x0c\x04\x40\x20\x40\x40\x40\x20\x10\x10\x10\x10\x23\x84\x04\x10\x00\x05\x04\x04\x09\x84\x04\x04\x02\x08
@
DLDD@(DDFB@���AH 0p�0@
@B@@ $�		 @@�0@@6@P@PD@@$@@DD@@D@��DD��D@@��@@@08 DDDD@@@���D@@TTD�!@@@�!$@2"А��@@�� @�����
                                                                                                  D@@@@���@�
@@PB@�
      @@HHH@`@(	@�
                  @@@�DF@BBRR����� @PPP" �%(	(@@�@@@2 @D@!D�D@J0DDB@ @JDDDJ"Ą H�J@@pD D!	@@  8

        �LDH��@��!!0HL	 @�@@�P�@2dP@@dDPPP
                                           @!@DB@@�@�D@@

Any help would be greatly appreciated

hi @Mattie thanks so much for sharing this. I have a PowMr 3k 24v AIO inverter and was going to hook up dc and ac monitors to get the readings because I couldn’t figure out how to get the data from the AIO itself, and now problem solved thanks to you; I ended up using an EW11. I was wondering if you made tweaks to the config file, I’ve been struggling with the following data attributes and other things and wondering if you figured them out:

  1. AC output load (Power, Current, Amps) - do you know the address for it, address 61501 I think is for load consumption from Mains only rather than all AC consumption for PV, Mains and battery. Did you use the inverter power to derive that?
  2. Can you reshare the modbus index again? I’ll share my config when I’m done to help contribute for future users
  3. Do you have all of the modbus tcp sensors in your HA configuration.yaml itself or did you create a different yaml file and reference it somehow?
  4. Were you able to get PV Voltage to work as a sensor? What was the address you used?

thanks again for sharing this, I was almost going to change about my AIO due to the lack of data visiblity or add a bunch of dc and ac clamps to the input and outputs

Hello @Koshman! I’m glad that you found this useful! I’m a bit surprised that you made it work with my code on a different manufacturer tho? Maybe those Chinese brands have these indexes in common. It will probably be better if you try to find the accurate index list for your specific device. Or else you risk wasting your time trying to get my SRNE translations to work :slight_smile:

I have a specific sensor in my device that gives me the AC Load output without the need for calculations. I did calculations for the battery use however. It isn’t totally accurate tho, but close enough.

I have put all my modbus code in my main configuration file. I find it easier to work with when I build templates and search for sensors. Not that esthetic maybe.

ok will do, did you simply ask the support for the ‘index list’ without any context or did you provide a reason for why you needed it?

Also yes, i think PowMr and SRNE are made in the same factory so thats why eitehr the majority or all indexes are the same.

Yes I just asked for the modbus index file and that I needed it to fetch data through a network gateway. If you’re curious I uploaded the srne index here, you could fiddle with it while you wait for the proper one :slight_smile:

1 Like

Since this post my ASF has gone completely dead from exposure to induction load.

Hi,

I just got PowMr hybrid inverter 6.5K 48V (POW-HVM6.5K-48V) and sadly discovered that as soon as the AV input is turned on, it switches to Bypass mode and uses grid power to feed the output no matter how much solar or battery power. So SBU configuration has no effect.

PowMr told me this is a known error with the model and can’t be fixed. They suggested that I use a time-controlled relay to control the ac input.

This is a no-go, as it should take the available solar and battery power into consideration.

Now I am thinking that if can integrate it to HA, then I can do much better control of when to switch the ac input on/off.

Anybody succeeded interfacing to POW-HVM6.5K-48V?

I’m using a shelly 16A plug for each of my inverters to monitor the AC consumption. That also gives me the possibility to cut the power to the inverters. Sometimes when the inverter is waiting for the battery voltage to rise and I quickly wanna change to inverter powered mode I turn the AC to the inverter to off thus making the inverter switch from AC to solar/battery power. Could easily be used in automations as long as you can trust your connection to the inverter to 100%. Things can easily go wrong if you for example loose the connection to the inverter after the AC power has been cut making it possible to draw the batterybank to 0%