Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Battery Data into Home Assistant

Featured Replies

Hi Everyone

I was looking at the Modbus Protocol document for the DEYE/Sunsynk inverters yesterday and noticed some interesting registry options at the end of the register. 

I assume that this is for the battery packs and caters for packs 1 - 15. 

Would be cool to be pulling that info into Home Assistant as well 🙂 

image.png.e25d2558e527d8569121e88984041ac8.png

 

 

  • 2 weeks later...
  • Author

 Hi Guys, 

In an attempt to pull data about the batteries from my inverter I added this code into my ESPhome code for my ESP32, 

############### Battery Pack Data #################

 
  - platform: modbus_controller            # 600 Battery Pack 1 Voltage
    modbus_controller_id: sunsynk
    name: "deye_battery pack1 Voltage"
    id: sunsynk_esphome_Batt_pack1_voltage
    register_type: holding
    address: 600
    unit_of_measurement: "V"
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 0.01
    value_type: U_WORD
 
  - platform: modbus_controller            # 601 Battery Pack 1 Current
    modbus_controller_id: sunsynk
    name: "deye battery_pack1_Current"
    id: sunsynk_esphome_battery_pack1_current
    register_type: holding
    address: 601
    unit_of_measurement: "A"
    accuracy_decimals: 1
    device_class: current
    state_class: measurement
    value_type: S_WORD
    filters:
      - multiply: 0.01
 
  - platform: modbus_controller            # 602 Battery Pack 1 Temperature
    modbus_controller_id: sunsynk
    name: "deye battery_pack1 Temperature"
    id: sunsynk_esphome_battery_pack1_temperature
    register_type: holding
    address: 602
    unit_of_measurement: "°C"
    accuracy_decimals: 1
    device_class: temperature
    state_class: measurement
    value_type: U_WORD
    filters:
      - offset: -1000
      - multiply: 0.1
 
  - platform: modbus_controller            # 603 Battery Pack 1 SOC
    modbus_controller_id: sunsynk
    name: "${friendly_name} battery_pack1_SOC"
    id: sunsynk_esphome_battery_pack1_soc
    register_type: holding
    address: 603
    unit_of_measurement: "%"
    accuracy_decimals: 0
    device_class: battery
    value_type: U_WORD
 
  - platform: modbus_controller            # 604 Battery Pack 1 Remaining Capacity
    modbus_controller_id: sunsynk
    name: "${friendly_name} battery_pack1_remaining_capacity"
    id: sunsynk_esphome_day_battery_pack1_remaining_capacity
    register_type: holding
    address: 604
    unit_of_measurement: "kWh"
    accuracy_decimals: 1
    device_class: energy
    state_class: total_increasing
    value_type: U_WORD
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller            # 605 Battery Pack 1 Total Capacity
    modbus_controller_id: sunsynk
    name: "${friendly_name} battery_pack1_total_capacity"
    id: sunsynk_esphome_day_battery_pack1_total_capacity
    register_type: holding
    address: 605
    unit_of_measurement: "kWh"
    accuracy_decimals: 1
    device_class: energy
    state_class: total_increasing
    value_type: U_WORD
    filters:
      - multiply: 0.1
 
  - platform: modbus_controller            # 606 Battery Pack 1 Charge Voltage
    modbus_controller_id: sunsynk
    name: "${friendly_name}_battery pack1_charge_voltage"
    id: sunsynk_esphome_Batt_pack1_charge_voltage
    register_type: holding
    address: 606
    unit_of_measurement: "V"
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 0.01
    value_type: U_WORD
 
  - platform: modbus_controller            # 607 Battery Pack 1 Charge Current
    modbus_controller_id: sunsynk
    name: "${friendly_name} battery_pack1_charge_Current"
    id: sunsynk_esphome_battery_pack1_charge_current
    register_type: holding
    address: 607
    unit_of_measurement: "A"
    accuracy_decimals: 1
    device_class: current
    state_class: measurement
    value_type: S_WORD
    filters:
      - multiply: 0.01
 
  - platform: modbus_controller            # 608 Battery Pack 1 Discharge Current
    modbus_controller_id: sunsynk
    name: "${friendly_name} battery_pack1_discharge_Current"
    id: sunsynk_esphome_battery_pack1_discharge_current
    register_type: holding
    address: 608
    unit_of_measurement: "A"
    accuracy_decimals: 1
    device_class: current
    state_class: measurement
    value_type: S_WORD
    filters:
      - multiply: 0.01
 
  - platform: modbus_controller            # 609 Battery Pack 1 Max Cell Voltage
    modbus_controller_id: sunsynk
    name: "${friendly_name}_battery pack1_maxcell_voltage"
    id: sunsynk_esphome_Batt_pack1_maxcell_voltage
    register_type: holding
    address: 609
    unit_of_measurement: "V"
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 0.01
    value_type: U_WORD
 
  - platform: modbus_controller            # 610 Battery Pack 1 Min Cell Voltage
    modbus_controller_id: sunsynk
    name: "${friendly_name}_battery pack1_mincell_voltage"
    id: sunsynk_esphome_Batt_pack1_mincell_voltage
    register_type: holding
    address: 610
    unit_of_measurement: "V"
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 0.01
    value_type: U_WORD
 
  - platform: modbus_controller            # 611 Battery Pack 1 Cycle Number
    modbus_controller_id: sunsynk
    name: "${friendly_name}_battery pack1_cycle_number"
    id: sunsynk_esphome_Batt_pack1_cycle_number
    register_type: holding
    address: 611
    accuracy_decimals: 1
    state_class: measurement
    value_type: U_WORD
    bitmask: 0x400
 
  - platform: modbus_controller            # 613 Battery Pack 1 Fault
    modbus_controller_id: sunsynk
    name: "${friendly_name}_battery pack1_fault"
    id: sunsynk_esphome_Batt_pack1_fault
    register_type: holding
    address: 613
    accuracy_decimals: 1
    state_class: measurement
    value_type: U_WORD
    bitmask: 0x400
 
I am getting this in the logs:
[11:58:28][D][modbus_controller:032]: Modbus command to device=1 register=0x258 countdown=0 no response received - removed from send queue
[11:58:29][D][modbus_controller:032]: Modbus command to device=1 register=0x265 countdown=0 no response received - removed from send queue
 
Any suggestions?
Would be cool to be able to pull some data from the inverter regarding number of cycles etc.
  • 2 weeks later...

I did try to get some battery data from the sunsynk at a point, but those 600 regs were empty. Have not tried recently & my ide was to rather quesry the battery directly.

  • 2 months later...
  • 6 months later...

Did any of you ever find a solution to this question? There's a RS232 port on Sunsynk batteries which might be useful but I have no clue on how to use it, ie. I can't find any documentation on it, eg. modbus details. Nor do I know whether that information should be extracted from the inverters instead?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.