Coder Social home page Coder Social logo

Comments (18)

leo4417 avatar leo4417 commented on June 1, 2024 1

This works with my two SH10RT! I've completed the 2nd yaml, see below.

modbus_sungrow2.yaml.txt

I have an additional question: when I try to write a modbus register like this, it's not working. Do you have any idea? Actually the "Set battery SoC reserve" doesn't work either. Perhaps the same problem?

alias: Battery-SoC 17
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.battery_level
    above: 90
condition: []
action:
  - service: modbus.write_register
    data:
      address: 13100
      hub: SungrowSHx
      slave: 2
      value: 17
mode: single

from sungrow-shx-inverter-modbus-home-assistant.

leo4417 avatar leo4417 commented on June 1, 2024 1

Since the last update i get no data from my second inverter... Does anybody have an idea?

from sungrow-shx-inverter-modbus-home-assistant.

elektrinis avatar elektrinis commented on June 1, 2024

Good question. I will be installing a second one soon.

Can we keep this in English please.

from sungrow-shx-inverter-modbus-home-assistant.

mkaiser avatar mkaiser commented on June 1, 2024

hey,

that should work. See #16

Recently, one guy in the home assistant forum confirmed that he got it working:
https://community.home-assistant.io/t/sungrow-sh10-rt-modbus-integration/361356/35

from sungrow-shx-inverter-modbus-home-assistant.

Matze5593 avatar Matze5593 commented on June 1, 2024

Unfortunately, the method described in #16 does not work. i tried to avoid duplicate names by using the designation 2 or slave. but dying didn't help.
modbus_sungrow2.yaml.txt

from sungrow-shx-inverter-modbus-home-assistant.

mkaiser avatar mkaiser commented on June 1, 2024

copied this together with just 2 sensors, but I obviously cannot check without a second inverter, so I need your help here :)

When this works, the next step is more or less copy / paste for the other sensors

  1. copy the file (modbus_sungrow_inv2.yaml) next to the existing file (modbus_sungrow.yaml) in the integrations folder
  2. update your secrets.yaml accordingly (see the comments of modbus_sungrow_inv2.yaml
  3. Check and restart HA

modbus_sungrow_inv2.yaml.txt

from sungrow-shx-inverter-modbus-home-assistant.

mkaiser avatar mkaiser commented on June 1, 2024

great to know that this is working.

I will put this on the "ToDo" list, but final integration and documentation will take some time.

If you want to write to modbus register 13100 (reserved soc for backup), you need to decrement the address to 13099

copied from modbus_sungrow.yaml (arount line 1470)

    alias: "sungrow inverter update reserved soc for backup"
    description: "Updates reserved SoC for backup register"
    trigger:
      - platform: state
        entity_id:
          - input_number.set_sg_reserved_soc_for_backup
    condition: []
    action:
      - service: modbus.write_register
        data_template:
          hub: SungrowSHx
          slave: !secret sungrow_modbus_slave
          address: 13099 # reg 13100
          value: "{{ states('input_number.set_sg_reserved_soc_for_backup') | int}}"
    mode: single```


Does this help?

from sungrow-shx-inverter-modbus-home-assistant.

leo4417 avatar leo4417 commented on June 1, 2024

Yes, it works! Thanks!!
But for example, if I enter value: "70" the Battery SoC reserve (sensor.battery_soc_reserve) displays 7%, with "90" this changes to 9%, values above 100 have no effect. Where is my mistake?

from sungrow-shx-inverter-modbus-home-assistant.

leo4417 avatar leo4417 commented on June 1, 2024

This is known, I haven't seen it..

      - name: Battery SoC reserve 2
        unique_id: sg_battery_soc_reserve_2
        slave: !secret sungrow_modbus_slave_inv2
        address: 13099 # reg 13100
        input_type: holding
        count: 1
        data_type: uint16
        swap: word
        unit_of_measurement: "%"
        device_class: battery
        state_class: measurement
        scale: 1 **# NOT 0.1**
        scan_interval: 10

from sungrow-shx-inverter-modbus-home-assistant.

leo4417 avatar leo4417 commented on June 1, 2024

I tried to adjust the max_charge_power because battery system SunGrow SBR265 supports up to 17.520 W
Unfortunately this doesn't work... Perhaps the register isn't correct?

  set_sg_battery_max_charge_power:
    name: Set max battery charge power in W
    #initial: 40
    min: 0
    max: 17520
    step: 100

  set_sg_battery_max_discharge_power:
    name: Set max battery discharge power in W
    #initial: 40
    min: 0
    max: 17520
    step: 100

from sungrow-shx-inverter-modbus-home-assistant.

Matze5593 avatar Matze5593 commented on June 1, 2024

In the secret.yaml, the slave inverter must be set as a Modbus slave from 1 to 2 in order to be able to query data via the sh10rt's Modbus port

z.B

`
#first inverter Master
sungrow_modbus_host_ip: 192.168.178.xx
sungrow_modbus_port: 502
sungrow_modbus_slave: 1

########################################################################

#second inverter Slave
sungrow_modbus_host_ip_inv2: 192.168.178.xx
sungrow_modbus_port_inv2: 502
sungrow_modbus_slave_inv2: 2 `

from sungrow-shx-inverter-modbus-home-assistant.

bleughb avatar bleughb commented on June 1, 2024

This works with my two SH10RT! I've completed the 2nd yaml, see below.

modbus_sungrow2.yaml.txt

I have an additional question: when I try to write a modbus register like this, it's not working. Do you have any idea? Actually the "Set battery SoC reserve" doesn't work either. Perhaps the same problem?

alias: Battery-SoC 17
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.battery_level
    above: 90
condition: []
action:
  - service: modbus.write_register
    data:
      address: 13100
      hub: SungrowSHx
      slave: 2
      value: 17
mode: single

Thankyou.
Your YAML file worked perfectly for my TWO SG5.0RS
I'd spent a couple of hours trying to create a second modbus_sungrow.yaml file to handle two inverters!
Now I can plot my 4 MPPT string currents

from sungrow-shx-inverter-modbus-home-assistant.

bleughb avatar bleughb commented on June 1, 2024

Quick heads up RE the dual YAML files - reduce increase the scan_interval time ...the default will flood the Winet-s devices and knock them offline.
i've taken mine to 60s at the moment and will see how it goes

from sungrow-shx-inverter-modbus-home-assistant.

Matze5593 avatar Matze5593 commented on June 1, 2024

hi, i have problems with the power mppt 1/2. I don't understand how the code works and my mistake lies. I just don't get any values ​​for the power. Could you please help me

`

  • name: MPPT1 voltage inv 2
    unique_id: sg_mppt1_voltage_inv2
    slave: !secret sungrow_modbus_slave_inv2
    address: 5010 # reg 5011
    input_type: input
    count: 1
    data_type: uint16
    swap: word
    precision: 1
    unit_of_measurement: V
    device_class: Voltage
    scale: 0.1
    scan_interval: 10

    • name: MPPT1 current inv 2
      unique_id: sg_mppt1_current_inv2
      slave: !secret sungrow_modbus_slave_inv2
      address: 5011 # reg 5012
      input_type: input
      count: 1
      data_type: uint16
      swap: word
      precision: 2
      unit_of_measurement: A
      device_class: Current
      scale: 0.1
      scan_interval: 10

    • name: MPPT2 voltage inv 2
      unique_id: sg_mppt2_voltage_inv2
      slave: !secret sungrow_modbus_slave_inv2
      address: 5012 # reg 5013
      input_type: input
      count: 1
      data_type: uint16
      swap: word
      precision: 1
      unit_of_measurement: V
      device_class: Voltage
      scale: 0.1
      scan_interval: 10

    • name: MPPT2 current inv 2
      unique_id: sg_mppt2_current_inv2
      slave: !secret sungrow_modbus_slave_inv2
      address: 5013 # reg 5014
      input_type: input
      count: 1
      data_type: uint16
      swap: word
      precision: 2
      unit_of_measurement: A
      device_class: Current
      scale: 0.1
      scan_interval: 10

    • name: Total DC power inv 2
      unique_id: sg_total_dc_power_inv2
      slave: !secret sungrow_modbus_slave_inv2
      address: 5016 # reg 5017
      input_type: input
      count: 2
      data_type: uint32
      swap: word
      precision: 0
      unit_of_measurement: W
      device_class: power
      state_class: measurement
      scale: 1
      scan_interval: 10
      sensor:
      name: MPPT1_inv2 power
      unique_id: sg_mppt1_power_inv2
      unit_of_measurement: W
      device_class: power
      availability: "{{states('sensor.mppt1_voltage_inv2')|is_number and states('sensor.mppt1_current_inv2')|is_number }}"
      state: "{{ (states('sensor.mppt1_voltage_inv2') | float * states('sensor.mppt1_current_inv2') | float) |int }}"

name: MPPT2_inv2 power
unique_id: sg_mppt2_power_inv2
unit_of_measurement: W
device_class: power
availability: "{{states('sensor.mppt2_voltage_inv2')|is_number and states('sensor.mppt2_current_inv2')|is_number }}"
state: "{{ (states('sensor.mppt2_voltage_inv2') | float * states('sensor.mppt2_current_inv2') | float) |int }}"

from sungrow-shx-inverter-modbus-home-assistant.

Wolkenstuermer avatar Wolkenstuermer commented on June 1, 2024

Last HA Update broke my complete Sungrow INtegration for SH and SG... Think there are some issues between Modbus in HA Core and the Code (there is something with regards to uint/int16 needs swap: none ... but this did not help...

I will get deeper into this during the next week.

from sungrow-shx-inverter-modbus-home-assistant.

dylan09 avatar dylan09 commented on June 1, 2024

Are you using the latest version of modbus.yaml file? There the error with swap is fixed.

Since HA 2023.9.x there are some new, weird ModBus issues. See 158

There you will find a link to the HA issue regarding the problems with ModBus.

from sungrow-shx-inverter-modbus-home-assistant.

roennieinator avatar roennieinator commented on June 1, 2024

I created a .yaml config file for my second inverter that works with Home Assistant 10.1.
I only included the sensors I really need, so of you like, feel free to complete the file - I was too lazy :)

If you want to use this, please follow the instructions given earlier in this thread.
Thanks to @bleughb for the "inspiration" (I basically stole your way of doing the config).

second_inverter_version_10_1.yml.txt

from sungrow-shx-inverter-modbus-home-assistant.

howi303 avatar howi303 commented on June 1, 2024

Has anyone two SH10RT-V112 as Master/Slave working and both combined shown in a flow chart?

from sungrow-shx-inverter-modbus-home-assistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.