SRNE inverter integration help

can i ask for modbus manual from who ? from powmr that sold me inverter ?

SRNE modbus manual you can get from PythonProtocolGateway/docs/SRNE_MODBUS_v3.9.pdf at 940a2ecf736549b9a802f122e4c4aea0e3a75edd · HotNoob/PythonProtocolGateway · GitHub

2 Likes

Thank you @Dimumal !!! I was finally able to get this to work with PowMR POW-SunSmart SP5K.

To those that are having issues… MAKE SURE you follow the wiring diagram! Initially I didn’t bother wiring the ground wire between inverter to the TTL-RS 485 board and it didn’t work. Took everything apart and redid it all over and finally worked. Also takes about 5-10 mins before I see any data fed into HA so be patient.

2 Likes

@Dimumal, your diagram says RJ45 pin 2 should be connected to TTL GND, but the color of the wire in your diagram is orange/white, which is RJ45 pin 1, not 2.

Was this a mistake?

(I am trying to make the connection, exactly like you did, and it’s not working)

It should be pin 2

1 Like

Great. It worked. Thanks a ton! My GND pin wasn’t properly connected.

2 Likes

Hey I just got my power inverter same as you. I am looking to get it into home assistant. Can you share your wiring diagram and esp home setup. I am a bit confused by the drawing on the first post. Also what is being used for the connection?

@Dimumal, maybe it’s because my inverter is different than yours (HF2430U60-100), but with your instructions, I was getting tons of CRC check warnings.

What I did different to solve it was to NOT remove R7. Everything else is the same. Now I don’t get any CRC check error at all.

Still, I’m very thankful. I’d not even be able to get started if it wasn’t for your guide.

This is great I got it working now to figure out what entities I need to putso I can get the energy dashboard running.

I’m not a tech guy. So I can’t help you out on the errors.

But removing R7 or not does not make any difference.

1 Like

So I made a few helpers to calculate watts and other values not present in the sensors. This led me to realize the battery current which is in amps always reports a positive amperage even though it by directional. When charging it should be negative as in going. Any ideas how to do that?

I think I found something with the charger Status value. It reports 1, 2, and 8. Though not sure what each of those mean. I also found that when the battery charges it reports 6000 amps which seems a bit much.

@jculina2012
I was seeing the same error message. Did you ever get an answer for this issue?

clause-3.5 solved it… add "platform: esphome right above password line in the ota: section,

I’ve got this section that covers the charge state.

  - platform: modbus_controller
    modbus_controller_id: srne1
    name: "Charge State" #name for HA
    id: srne_Charge_State #id for HA
    icon: mdi:list-Status
    register_type: holding
    address: 0x010B #register address (see modbus manual)
    raw_encode: HEXBYTES
    lambda: |-
      uint16_t value = modbus_controller::word_from_hex_str(x, 0);
      switch (value) {
        case 0: return std::string("Charge Off");
        case 1: return std::string("Quick Charge");
        case 2: return std::string("Const Voltage Charge");
        case 4: return std::string("Float Charge");
        case 5: return std::string("Reserved");
        case 6: return std::string("Li Battery Active");
        case 8: return std::string("Full");
        default: return std::string("Unknown");
      }
      return x;

And this section corrects the 6000 amps that you’re seeing. The reason for the 6000 is that it’s not taking into account that this register reports back a signed integer. I’ve also swapped around the current to show current draw from the battery as a negative value.

  - platform: modbus_controller
    modbus_controller_id: srne1
    name: "Battery Current" #name for HA
    id: srne_Battery_Current #id for HA
    register_type: holding
    address: 0x102 #register address (see modbus manual)
    value_type: S_WORD
    icon: mdi:current-dc
    state_class: measurement
    unit_of_measurement: A
    device_class: current
    force_update: True
    filters:
      - multiply: 0.1
      - lambda: |-
          return -x;
1 Like

Wow thanks this is really helpful. Especially the amps correction. My end goal is to be able to see my energy distribution live. The Energy dashboard is working great for hour by hour and daily. But I would like to have live.
I have everything working great except the battery. Essentially I would like to know how much energy it is discharging or charging. What I have done that works pretty well is a helper sensor hooked to an automation that runs every minute. This tells me the voltage of the battery 1 min ago. Then using a template sensor I check it against the current voltage. If it is greater then battery is charge less discharging.

Did you ever get two way communication. I have the sensors but I cannot change any values?

I created a switch to unlock the device by writing the password to the correct register. Assuming that your device password is zero as mine is.

switch:
# Password entry
  - platform: modbus_controller
    modbus_controller_id: srne1
    use_write_multiple: true
    name: "Unlock Modbus Device"
    register_type: holding
    address: 0xE203
    write_lambda: |-
      return {0};

I used this to monitor the lock state.

  - platform: modbus_controller
    modbus_controller_id: srne1
    name: "User Priority" #name for HA
    id: srne_PriorityFlag #id for HA
    icon: mdi:list-Status
    register_type: holding
    address: 0x0211 #register address (see modbus manual)
    raw_encode: HEXBYTES
    lambda: |-
      uint16_t value = modbus_controller::word_from_hex_str(x, 0);
      switch (value) {
        case 0: return std::string("No User Password");
        case 1: return std::string("User Password");
        case 4: return std::string("Manufacturer Password");
        default: return std::string("Unknown");
      }
      return x;

Then I could change whatever value I like using something like this…

  - platform: modbus_controller
    modbus_controller_id: srne1
    name: "Set Battery Float Voltage" #name for HA
    id: srne_set_BatFloatChgVolt #id for HA
    register_type: holding
    address: 0xE009 #register address (see modbus manual)
    unit_of_measurement: "V"
    device_class: Voltage
    value_type: U_WORD
    multiply: 10
    min_value: 12
    max_value: 14.4
    step: 0.1
    mode: SLIDER

My code isn’t pretty. Keep in mind you’ll have to calculate the correct multiplication for the voltage of your system. I just got lazy.

1 Like

Excellent. Do you have one for changing the charging priority such as grid solar hybrid etc. I live in a country with very unstable power at times 15 hours of power cuts. I would like to use automations to preserve and ensure my battery is always charged for those black outs.

I’ve got the same as Dimu’s code from back on Feb 24. I uploaded the full code that I’m currently running to Github. You should be able to find what you need there.

https://github.com/Gizzo/ESPHome_HF2430U60.git

“Resource expired”