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.

My Sunsynk 8Kw & data collection setup

Featured Replies

  • Replies 657
  • Views 178k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • If you want to try this card in home assistant follow these steps. 1. Create a new directory under www/community/ and name it sunsynk-card. If you don't have HACS installed you can create directo

  • Hi all. Here is my version to get Sunsynk 8.8 Modbus metrics in Home Assistant: Required Hardware: ESP32 Development Board @R149.95 https://www.diyelectronics.co.za/store/espressif-iot/1495-

  • Thought I would also contribute with something small. Not as impressive as what some of the others here but a contribution nonetheless. The GUI for Sunsynk System Mode, or lack thereof, has reall

Posted Images

22 minutes ago, georgelza said:

hmmm, looking at slipx06 repo and his custom: Sunsynk-Power-Flow-Card

thinking it's probably suppose to go with a very specific yaml file setup deployed onto the esp32.

what I got deployed atm... attached... can't recall who's this is... guessing there is a pre defined visualization/dashboard available for this...

at the moment I got a very dead screen, no values on dashboard/flow card, so guessing a total disconnect between the sensor names it wants and what the esp32 is bringing in.

looking at my notes, this is suppose to be slips Sunsynk 8000 yaml code for esp32 deployment.

if I go into Developer Tools and filter on Sunsynk I do see some sensors that is updating as per whats on the inverter control panel.

esphome:
  name: "sunsynk"
  friendly_name: Sunsynk

substitutions:
  settings_skipped_updates: "30"
  devicename: sunsynk
  device_description: "Sunsynk RS485 Logger"
  friendly_name: "SunSynk"
  
esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "uSF7p2o9ek------zOUUGTecm70="

ota:
  password: "5b3d7a336------df"


wifi:
  ssid: "muller"
  password: "08-----798"

  manual_ip:
    static_ip: 192.168.0.180
    gateway: 192.168.0.1
    subnet: 255.255.255.0
    
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-415E4C"
    password: "Pd-----Z5"

captive_portal:
    
# Enable time component to reset energy at midnight
# https://esphome.io/components/time.html#home-assistant-time-source
time:
  - platform: homeassistant
    id: homeassistant_time
    

uart:
  id: mod_bus
  tx_pin: 17
  rx_pin: 16
  baud_rate: 9600
  stop_bits: 1
 
modbus:
  id: sunsynk_modbus
  flow_control_pin: 4
 
modbus_controller:
  - id: sunsynk
    address: 0x01
    modbus_id: sunsynk_modbus
    setup_priority: -10
    update_interval: "15s"
    command_throttle: "50ms"

############################################### BINARY SENSORS ########################################
binary_sensor:           
  - platform: modbus_controller            # 194 Grid Connected Status
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid Connected Status"
    id: sunsynk_esphome_grid_connected_status
    register_type: holding
    address: 194

  - platform: modbus_controller           # 280 Gen Peak Shaving Status
    modbus_controller_id: sunsynk
    name: "${friendly_name} Gen Peak Shaving Status"
    id: sunsynk_esphome_gen_peak_shaving_status
    register_type: holding
    address: 280
    bitmask: 0x10

  - platform: modbus_controller           # 280 Grid Peak Shaving Status
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid Peak Shaving Status"
    id: sunsynk_esphome_grid_peak_shaving_status
    register_type: holding
    address: 280
    bitmask: 0x100

#                                               SENSORS                                               #
#######################################################################################################

############################################### BATTERY ###############################################
sensor:
  - platform: modbus_controller            # 182 Battery Temperature
    modbus_controller_id: sunsynk
    name: "${friendly_name} Battery Temperature"
    id: sunsynk_esphome_battery_temperature
    register_type: holding
    address: 182
    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            # 183 Battery Voltage
    modbus_controller_id: sunsynk
    name: "${friendly_name} Battery Voltage"
    id: sunsynk_esphome_battery_voltage
    register_type: holding
    address: 183
    unit_of_measurement: "V"
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 0.01
    value_type: U_WORD

  - platform: modbus_controller            # 184 Battery SOC
    modbus_controller_id: sunsynk
    name: "${friendly_name} Battery SOC"
    id: sunsynk_esphome_battery_soc
    register_type: holding
    address: 184
    unit_of_measurement: "%"
    accuracy_decimals: 0
    device_class: battery
    value_type: U_WORD

  - platform: modbus_controller            # 190 Battery Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Battery Power"
    id: sunsynk_esphome_battery_power
    register_type: holding
    address: 190
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    value_type: S_WORD

  - platform: modbus_controller            # 191 Battery Current
    modbus_controller_id: sunsynk
    name: "${friendly_name} Battery Current"
    id: sunsynk_esphome_battery_current
    register_type: holding
    address: 191
    unit_of_measurement: "A"
    accuracy_decimals: 1
    device_class: current
    state_class: measurement
    value_type: S_WORD
    filters:
      - multiply: 0.01

  - platform: modbus_controller            # 217 Battery Capacity Shutdown
    modbus_controller_id: sunsynk
    name: "${friendly_name} Battery Capacity Shutdown"
    id: sunsynk_esphome_battery_capacity_shutdown
    register_type: holding
    address: 217
    unit_of_measurement: "%"
    accuracy_decimals: 0
    device_class: battery

############################################### INVERTER ##############################################

  - platform: modbus_controller            # 175 Inverter Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Inverter Power"
    id: sunsynk_esphome_inverter_power
    register_type: holding
    address: 175
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    value_type: S_WORD

  - platform: modbus_controller            # 154 Inverter Voltage
    modbus_controller_id: sunsynk
    name: "${friendly_name} Inverter Voltage"
    id: sunsynk_esphome_inverter_voltage
    register_type: holding
    address: 154
    unit_of_measurement: "V"
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 0.1
    value_type: U_WORD 

  - platform: modbus_controller            # 164 Inverter Current
    modbus_controller_id: sunsynk
    name: "${friendly_name} Inverter Current"
    id: sunsynk_esphome_inverter_current
    register_type: holding
    address: 164
    unit_of_measurement: "A"
    accuracy_decimals: 1
    device_class: current
    state_class: measurement
    value_type: S_WORD
    filters:
      - multiply: 0.01

  - platform: modbus_controller            # 193 Inverter Frequency
    modbus_controller_id: sunsynk
    name: "${friendly_name} Inverter Frequency"
    id: sunsynk_esphome_inverter_frequency
    register_type: holding
    address: 193
    unit_of_measurement: "Hz"
    accuracy_decimals: 2
    filters:
      - multiply: 0.01
    value_type: U_WORD
    state_class: measurement

############################################### GRID ##################################################

  - platform: modbus_controller             # 079 Grid Frequency
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid Frequency"
    id: sunsynk_esphome_grid_frequency
    register_type: holding
    address: 79
    unit_of_measurement: "Hz"
    accuracy_decimals: 2
    filters:
      - multiply: 0.01
    value_type: U_WORD
    state_class: measurement

  - platform: modbus_controller             # 169 Grid Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid Power"
    id: sunsynk_esphome_grid_power_169
    register_type: holding
    address: 169
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: S_WORD

  - platform: modbus_controller             # 167 Grid LD Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid LD Power 167"
    id: sunsynk_esphome_grid_power_167
    register_type: holding
    address: 167
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: S_WORD

  - platform: modbus_controller             # 168 Grid L2 Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid L2 Power 168"
    id: sunsynk_esphome_grid_power_168
    register_type: holding
    address: 168
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: S_WORD

  - platform: modbus_controller             # 150 Grid Voltage
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid Voltage"
    id: sunsynk_esphome_grid_voltage
    register_type: holding
    address: 150
    unit_of_measurement: "V"
    accuracy_decimals: 1
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 0.1
    value_type: U_WORD 

  - platform: modbus_controller             # 160 Grid Current
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid Current"
    id: sunsynk_esphome_grid_current
    register_type: holding
    address: 160
    unit_of_measurement: "A"
    accuracy_decimals: 1
    device_class: current
    state_class: measurement
    value_type: S_WORD
    filters:
      - multiply: 0.01

  - platform: modbus_controller             # 172 Grid CT Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid CT Power"
    id: sunsynk_esphome_grid_ct_power
    register_type: holding
    address: 172
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: S_WORD

############################################### LOAD ################################################

  - platform: modbus_controller            # 178 Load Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Load Power"
    id: sunsynk_esphome_load_power
    register_type: holding
    address: 178
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: S_WORD

  - platform: modbus_controller            # 176 Load L1 Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Load L1 Power"
    id: sunsynk_esphome_load_l1_power
    register_type: holding
    address: 176
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: S_WORD

  - platform: modbus_controller            # 177 Load L2 Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} Load L2 Power"
    id: sunsynk_esphome_load_l2_power
    register_type: holding
    address: 177
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: S_WORD

  - platform: modbus_controller            # 192 Load Frequency
    modbus_controller_id: sunsynk
    name: "${friendly_name} Load Frequency"
    id: sunsynk_esphome_load_frequency
    register_type: holding
    address: 192
    unit_of_measurement: "Hz"
    accuracy_decimals: 2
    filters:
      - multiply: 0.01
    value_type: U_WORD
    state_class: measurement

############################################### SOLAR PV1 #############################################

  - platform: modbus_controller            # 186 PV1 Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} PV1 Power"
    id: sunsynk_esphome_pv1_power
    register_type: holding
    address: 186
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: U_WORD

  - platform: modbus_controller            # 109 PV1 Voltage
    modbus_controller_id: sunsynk
    name: "${friendly_name} PV1 Voltage"
    id: sunsynk_esphome_pv1_voltage
    register_type: holding
    address: 109
    unit_of_measurement: "V"
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 0.1
    value_type: U_WORD

  - platform: modbus_controller            # 110 PV1 Current
    modbus_controller_id: sunsynk
    name: "${friendly_name} PV1 Current"
    id: sunsynk_esphome_pv1_current
    register_type: holding
    address: 110
    unit_of_measurement: "A"
    accuracy_decimals: 1
    device_class: current
    state_class: measurement
    filters:
      - multiply: 0.1
    value_type: U_WORD

############################################### SOLAR PV2 #############################################

  - platform: modbus_controller            # 187 PV2 Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} PV2 Power"
    id: sunsynk_esphome_pv2_power
    register_type: holding
    address: 187
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: U_WORD

  - platform: modbus_controller            # 111 PV2 Voltage
    modbus_controller_id: sunsynk
    name: "${friendly_name} PV2 Voltage"
    id: sunsynk_esphome_pv2_voltage
    register_type: holding
    address: 111
    unit_of_measurement: "V"
    filters:
      - multiply: 0.1
    device_class: voltage
    state_class: measurement
    value_type: U_WORD

  - platform: modbus_controller            # 112 PV2 Current
    modbus_controller_id: sunsynk
    name: "${friendly_name} PV2 Current"
    id: sunsynk_esphome_pv2_current
    register_type: holding
    address: 112
    unit_of_measurement: "A"
    accuracy_decimals: 1
    device_class: current
    state_class: measurement
    filters:
      - multiply: 0.1
    value_type: U_WORD

############################################### SOLAR TOTAL ###########################################

  - platform: template                   # Sum of PV1 and PV2 to get total PV Power
    name: "${friendly_name} Solar Power"
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    lambda: |-
      return (id(sunsynk_esphome_pv1_power).state + id(sunsynk_esphome_pv2_power).state);
    update_interval: 5s

############################################### OUTPUTS ###############################################

  - platform: modbus_controller            # 166 Aux Power
    modbus_controller_id: sunsynk
    name: "${friendly_name} AUX Power"
    id: sunsynk_esphome_aux_power
    register_type: holding
    address: 166
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    value_type: S_WORD

  - platform: template                   # Essential Power based on register 175 + 167 - 166
    name: "${friendly_name} Essential Power"
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    lambda: |-
      return (id(sunsynk_esphome_inverter_power).state + id(sunsynk_esphome_grid_power_167).state - id(sunsynk_esphome_aux_power).state);
    update_interval: 5s

  - platform: template                   # Essential Power1 based on register 175 + 169 - 166
    name: "${friendly_name} Essential Power 1"
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    lambda: |-
      return (id(sunsynk_esphome_inverter_power).state + id(sunsynk_esphome_grid_power_169).state - id(sunsynk_esphome_aux_power).state);
    update_interval: 5s

  - platform: template                   # Nonessential Power 172 - 167
    name: "${friendly_name} Nonessential Power"
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    lambda: |-
      return (id(sunsynk_esphome_grid_ct_power).state - id(sunsynk_esphome_grid_power_167).state);
    update_interval: 5s

  - platform: template                   # Nonessential Power1 172 - 169
    name: "${friendly_name} Nonessential Power 1"
    unit_of_measurement: "W"
    accuracy_decimals: 0
    device_class: power
    state_class: measurement
    lambda: |-
      return (id(sunsynk_esphome_grid_ct_power).state - id(sunsynk_esphome_grid_power_169).state);
    update_interval: 5s

############################################### ENERGY ################################################

  - platform: modbus_controller            # 070 Day Battery Charge
    modbus_controller_id: sunsynk
    name: "${friendly_name} Day Battery Charge"
    id: sunsynk_esphome_day_battery_charge
    register_type: holding
    address: 70
    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            # 071 Day Battery Discharge
    modbus_controller_id: sunsynk
    name: "${friendly_name} Day Battery Discharge"
    id: sunsynk_esphome_day_battery_discharge
    register_type: holding
    address: 71
    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            # 072 Total Battery Charge
    modbus_controller_id: sunsynk
    name: "${friendly_name} Total Battery Charge"
    id: sunsynk_esphome_total_battery_charge
    register_type: holding
    address: 72
    unit_of_measurement: "kWh"
    accuracy_decimals: 1
    device_class: energy
    state_class: total_increasing
    value_type: U_DWORD_R
    filters:
     - multiply: 0.1

  - platform: modbus_controller            # 074 Total Battery Discharge
    modbus_controller_id: sunsynk
    name: "${friendly_name} Total Battery Discharge"
    id: sunsynk_esphome_total_battery_discharge
    register_type: holding
    address: 74
    unit_of_measurement: "kWh"
    accuracy_decimals: 0
    device_class: energy
    state_class: total_increasing
    value_type: U_DWORD_R
    filters:
     - multiply: 0.1

  - platform: modbus_controller            # 076 Day Grid Import
    modbus_controller_id: sunsynk
    name: "${friendly_name} Day Grid Import"
    id: sunsynk_esphome_day_grid_import
    register_type: holding
    address: 76
    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            # 077 Day Grid Export
    modbus_controller_id: sunsynk
    name: "${friendly_name} Day Grid Export"
    id: sunsynk_esphome_day_grid_export
    register_type: holding
    address: 77
    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            # 078 Total Grid Import
    modbus_controller_id: sunsynk
    name: "${friendly_name} Total Grid Import"
    id: sunsynk_esphome_total_grid_import
    register_type: holding
    address: 78
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    device_class: energy
    state_class: total_increasing
    value_type: U_WORD
    filters:
      - multiply: 0.1

  - platform: modbus_controller            # 081 Total Grid Export
    modbus_controller_id: sunsynk
    name: "${friendly_name} Total Grid Export"
    id: sunsynk_esphome_total_grid_export
    register_type: holding
    address: 81
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    device_class: energy
    state_class: total_increasing
    value_type: U_WORD
    filters:
      - multiply: 0.1

  - platform: modbus_controller            # 084 Day Load Energy
    modbus_controller_id: sunsynk
    name: "${friendly_name} Day Load Energy"
    id: sunsynk_esphome_day_load_energy
    register_type: holding
    address: 84
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.1
    value_type: U_WORD

  - platform: modbus_controller            # 085 Total Load Energy
    modbus_controller_id: sunsynk
    name: "${friendly_name} Total Load Energy"
    id: sunsynk_esphome_total_load_energy
    register_type: holding
    address: 85
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    device_class: energy
    state_class: total_increasing
    value_type: U_DWORD_R
    filters:
      - multiply: 0.1

  - platform: modbus_controller            # 096 Total PV Energy
    modbus_controller_id: sunsynk
    name: "${friendly_name} Total PV Energy"
    id: sunsynk_esphome_total_pv_energy
    register_type: holding
    address: 96
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.1
    value_type: U_DWORD_R  

  - platform: modbus_controller            # 108 Day PV Energy
    modbus_controller_id: sunsynk
    name: "${friendly_name} Day PV Energy"
    id: sunsynk_esphome_day_pv_energy
    register_type: holding
    address: 108
    unit_of_measurement: "kWh"
    accuracy_decimals: 1
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.1
    value_type: U_WORD

############################################### TEMPERATURE ################################################

  - platform: modbus_controller            # 090 DC Transformer Temperature
    modbus_controller_id: sunsynk
    name: "${friendly_name} DC Transformer Temperature"
    id: sunsynk_esphome_dc_transformer_temperature
    register_type: holding
    address: 090
    unit_of_measurement: "°C"
    accuracy_decimals: 1
    device_class: temperature
    state_class: measurement
    value_type: S_WORD
    filters:
      - offset: -1000
      - multiply:  0.1

  - platform: modbus_controller            # 091 Radiator Temperature
    modbus_controller_id: sunsynk
    name: "${friendly_name} Radiator Temperature"
    id: sunsynk_esphome_radiator_temperature
    register_type: holding
    address: 091
    unit_of_measurement: "°C"
    accuracy_decimals: 1
    device_class: temperature
    state_class: measurement
    value_type: S_WORD
    filters:
      - offset: -1000
      - multiply:  0.1

################################################ READ SETTINGS #############################################

  - platform: modbus_controller          # 250 System Mode Time 1
    modbus_controller_id: sunsynk
    name: "${friendly_name} System Mode Time1"
    id: sunsynk_esphome_system_mode_time1
    register_type: holding
    skip_updates: ${settings_skipped_updates}
    address: 250
    icon: "mdi:clock"

  - platform: modbus_controller          # 251 System Mode Time 2
    modbus_controller_id: sunsynk
    name: "${friendly_name} System Mode Time2"
    id: sunsynk_esphome_system_mode_time2
    register_type: holding
    skip_updates: ${settings_skipped_updates}
    address: 251   
    icon: "mdi:clock"

  - platform: modbus_controller          # 252 System Mode Time 3
    modbus_controller_id: sunsynk
    name: "${friendly_name} System Mode Time3"
    id: sunsynk_esphome_system_mode_time3
    register_type: holding
    skip_updates: ${settings_skipped_updates}
    address: 252
    icon: "mdi:clock"

  - platform: modbus_controller          # 253 System Mode Time 4
    modbus_controller_id: sunsynk
    name: "${friendly_name} System Mode Time4"
    id: sunsynk_esphome_system_mode_time4
    register_type: holding
    skip_updates: ${settings_skipped_updates}
    address: 253
    icon: "mdi:clock"

  - platform: modbus_controller          # 254 System Mode Time 5
    modbus_controller_id: sunsynk
    name: "${friendly_name} System Mode Time5"
    id: sunsynk_esphome_system_mode_time5
    register_type: holding
    skip_updates: ${settings_skipped_updates}
    address: 254
    icon: "mdi:clock"

  - platform: modbus_controller          # 255 System Mode Time 6
    modbus_controller_id: sunsynk
    name: "${friendly_name} System Mode Time6"
    id: sunsynk_esphome_system_mode_time6
    register_type: holding
    skip_updates: ${settings_skipped_updates}
    address: 255
    icon: "mdi:clock"

  - platform: modbus_controller        # 255 Grid Peak Shaving raw register value
    modbus_controller_id: sunsynk
    id: grid_peak_shaving_raw
    register_type: holding
    address: 280
    value_type: U_WORD

################################################ WRITE SETTINGS ############################################

switch:
  - platform: modbus_controller          # 247 Toggle Solar Sell
    use_write_multiple: true
    modbus_controller_id: sunsynk
    name: "${friendly_name} Toggle Solar sell"
    id: sunsynk_esphome_toggle_solar_sell
    register_type: holding
    address: 247
    bitmask: 1
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 248 Toggle System Timer
    use_write_multiple: true
    modbus_controller_id: sunsynk
    name: "${friendly_name} Toggle System Timer" 
    id: sunsynk_esphome_toggle_Time_of_Use
    register_type: holding
    address: 248
    bitmask: 1
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 243 Priority Load
    use_write_multiple: true
    modbus_controller_id: sunsynk
    name: "${friendly_name} Toggle Priority Load" 
    id: sunsynk_esphome_toggle_priority_load
    register_type: holding
    address: 243
    bitmask: 1
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 274 System Mode Grid Charge Time 1
    use_write_multiple: true
    modbus_controller_id: sunsynk
    name: "${friendly_name} System Mode Grid Charge Time1"
    id: sunsynk_esphome_toggle_grid_charge_time1
    register_type: holding
    address: 274
    bitmask: 1
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 275 System Mode Grid Charge Time 2
    modbus_controller_id: sunsynk
    use_write_multiple: true
    name: "${friendly_name} System Mode Grid Charge Time2"
    id: sunsynk_esphome_toggle_grid_charge_time2
    register_type: holding
    address: 275
    bitmask: 1
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 276 System Mode Grid Charge Time 3
    modbus_controller_id: sunsynk
    use_write_multiple: true
    name: "${friendly_name} System Mode Grid Charge Time3"
    id: sunsynk_esphome_toggle_grid_charge_time3
    register_type: holding
    address: 276
    bitmask: 1
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 277 System Mode Grid Charge Time 4
    modbus_controller_id: sunsynk
    use_write_multiple: true
    name: "${friendly_name} System Mode Grid Charge Time4"
    id: sunsynk_esphome_toggle_grid_charge_time4
    register_type: holding
    address: 277
    bitmask: 1
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 278 System Mode Grid Charge Time 5
    modbus_controller_id: sunsynk
    use_write_multiple: true
    name: "${friendly_name} System Mode Grid Charge Time5"
    id: sunsynk_esphome_toggle_grid_charge_time5
    register_type: holding
    address: 278
    bitmask: 1
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 279 System Mode Grid Charge Time 6
    modbus_controller_id: sunsynk
    use_write_multiple: true
    name: "${friendly_name} System Mode Grid Charge Time6"
    id: sunsynk_esphome_toggle_grid_charge_time6
    register_type: holding
    address: 279
    bitmask: 1
    icon: "mdi:toggle-switch"

number:
  - platform: modbus_controller         # 268 System Mode SoC Time 1
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_soc_time1
    name: "${friendly_name} System Mode SoC Time1"
    unit_of_measurement: "%"
    address: 268
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 269 System Mode SoC Time 2
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_soc_time2
    name: "${friendly_name} System Mode SoC Time2"
    unit_of_measurement: "%"
    address: 269
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 270 System Mode SoC Time 3
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_soc_time3
    name: "${friendly_name} System Mode SoC Time3"
    unit_of_measurement: "%"
    address: 270
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 271 System Mode SoC Time 4
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_soc_time4
    name: "${friendly_name} System Mode SoC Time4"
    unit_of_measurement: "%"
    address: 271
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 272 System Mode SoC Time 5
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_soc_time5
    name: "${friendly_name} System Mode SoC Time5"
    unit_of_measurement: "%"
    address: 272
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 273 System Mode SoC Time 6
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_soc_time6
    name: "${friendly_name} System Mode SoC Time6"
    unit_of_measurement: "%"
    address: 273
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 256 System Mode Power Time 1
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_power_time1
    name: "${friendly_name} System Mode Power Time1"
    unit_of_measurement: "W"
    address: 256
    min_value: 0
    max_value: 8000
    step: 100
    value_type: U_WORD  

  - platform: modbus_controller         # 257 System Mode Power Time 2
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_power_time2
    name: "${friendly_name} System Mode Power Time2"
    unit_of_measurement: "W"
    address: 257
    min_value: 0
    max_value: 8000
    step: 100
    value_type: U_WORD  

  - platform: modbus_controller         # 258 System Mode Power Time 3
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_power_time3
    name: "${friendly_name} System Mode Power Time3"
    unit_of_measurement: "W"
    address: 258
    min_value: 0
    max_value: 8000
    step: 100
    value_type: U_WORD  

  - platform: modbus_controller         # 259 System Mode Power Time 4
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_power_time4
    name: "${friendly_name} System Mode Power Time4"
    unit_of_measurement: "W"
    address: 259
    min_value: 0
    max_value: 8000
    step: 100
    value_type: U_WORD  

  - platform: modbus_controller         # 260 System Mode Power Time 5
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_power_time5
    name: "${friendly_name} System Mode Power Time5"
    unit_of_measurement: "W"
    address: 260
    min_value: 0
    max_value: 8000
    step: 100
    value_type: U_WORD  

  - platform: modbus_controller         # 261 System Mode Power Time 6
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_set_power_time6
    name: "${friendly_name} System Mode Power Time6"
    unit_of_measurement: "W"
    address: 261
    min_value: 0
    max_value: 8000
    step: 100
    value_type: U_WORD  

  - platform: modbus_controller         # 230 Grid Charge Battery current
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_grid_charge_bat_current
    name: "${friendly_name} Grid Charge Battery current"
    unit_of_measurement: "A"
    address: 230
    min_value: 0
    max_value: 185
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 210 Battery Max Charge current
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_bat_max_charge_current
    name: "${friendly_name} Battery Max Charge current"
    unit_of_measurement: "A"
    address: 210
    min_value: 0
    max_value: 185
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 211 Battery Max Discharge current
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_bat_max_discharge_current
    name: "${friendly_name} Battery Max Discharge current"
    unit_of_measurement: "A"
    address: 211
    min_value: 0
    max_value: 185
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller            # 293 Grid Peak Shaving Power
    use_write_multiple: true
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid Peak shaving power"
    id: sunsynk_grid_peak_shaving_power
    address: 293
    unit_of_measurement: "W"
    min_value: 0
    max_value: 8000
    step: 500
    value_type: U_WORD

  - platform: modbus_controller            # 245 Max Sell Power
    use_write_multiple: true
    modbus_controller_id: sunsynk
    name: "${friendly_name} Max Sell power"
    id: sunsynk_max_sell_power
    address: 245
    unit_of_measurement: "W"
    min_value: 0
    max_value: 8000
    step: 500
    value_type: U_WORD


################################################ TEXT SENSORS ##################################################

text_sensor:
  - platform: modbus_controller            # 059 Overall State
    modbus_controller_id: sunsynk
    name: "${friendly_name} Overall State"
    id: sunsynk_esphome_overall_state
    register_type: holding
    skip_updates: ${settings_skipped_updates}
    raw_encode: HEXBYTES
    address: 59
    lambda: |- 
      uint16_t value = modbus_controller::word_from_hex_str(x, 0);
      switch (value) {
        case 0: return std::string("standby");
        case 1: return std::string("selftest");
        case 2: return std::string("normal");
        case 3: return std::string("alarm");
        case 4: return std::string("fault");
        default: return std::string("unknown");
      }

  - platform: template
    name: "${friendly_name} Time Slot 1"
    id: sunsynk_esphome_time_slot_1
    icon: "mdi:clock"
    lambda: |-
        int minutes, hours;
        if (id(sunsynk_esphome_system_mode_time1).state) {
        minutes = static_cast<int>(id(sunsynk_esphome_system_mode_time1).state) % 100;
        hours = static_cast<int>(id(sunsynk_esphome_system_mode_time1).state) / 100;
        } else {
          minutes = 0;
          hours = 0;
        }
        char formatted_time[6];
        snprintf(formatted_time, sizeof(formatted_time), "%02d:%02d", hours, minutes);
        return esphome::optional<std::string>(formatted_time);
  - platform: template
    name: "${friendly_name} Time Slot 2"
    id: sunsynk_esphome_time_slot_2
    icon: "mdi:clock"
    lambda: |-
        int minutes, hours;
        if (id(sunsynk_esphome_system_mode_time2).state) {
        minutes = static_cast<int>(id(sunsynk_esphome_system_mode_time2).state) % 100;
        hours = static_cast<int>(id(sunsynk_esphome_system_mode_time2).state) / 100;
        } else {
          minutes = 0;
          hours = 0;
        }
        char formatted_time[6];
        snprintf(formatted_time, sizeof(formatted_time), "%02d:%02d", hours, minutes);
        return esphome::optional<std::string>(formatted_time);
  - platform: template
    name: "${friendly_name} Time Slot 3"
    id: sunsynk_esphome_time_slot_3
    icon: "mdi:clock"
    lambda: |-
        int minutes, hours;
        if (id(sunsynk_esphome_system_mode_time3).state) {
        minutes = static_cast<int>(id(sunsynk_esphome_system_mode_time3).state) % 100;
        hours = static_cast<int>(id(sunsynk_esphome_system_mode_time3).state) / 100;
        } else {
          minutes = 0;
          hours = 0;
        }
        char formatted_time[6];
        snprintf(formatted_time, sizeof(formatted_time), "%02d:%02d", hours, minutes);
        return esphome::optional<std::string>(formatted_time);
  - platform: template
    name: "${friendly_name} Time Slot 4"
    id: sunsynk_esphome_time_slot_4
    icon: "mdi:clock"
    lambda: |-
        int minutes, hours;
        if (id(sunsynk_esphome_system_mode_time4).state) {
        minutes = static_cast<int>(id(sunsynk_esphome_system_mode_time4).state) % 100;
        hours = static_cast<int>(id(sunsynk_esphome_system_mode_time4).state) / 100;
        } else {
          minutes = 0;
          hours = 0;
        }
        char formatted_time[6];
        snprintf(formatted_time, sizeof(formatted_time), "%02d:%02d", hours, minutes);
        return esphome::optional<std::string>(formatted_time);
  - platform: template
    name: "${friendly_name} Time Slot 5"
    id: sunsynk_esphome_time_slot_5
    icon: "mdi:clock"
    lambda: |-
        int minutes, hours;
        if (id(sunsynk_esphome_system_mode_time5).state) {
        minutes = static_cast<int>(id(sunsynk_esphome_system_mode_time5).state) % 100;
        hours = static_cast<int>(id(sunsynk_esphome_system_mode_time5).state) / 100;
        } else {
          minutes = 0;
          hours = 0;
        }
        char formatted_time[6];
        snprintf(formatted_time, sizeof(formatted_time), "%02d:%02d", hours, minutes);
        return esphome::optional<std::string>(formatted_time);
  - platform: template
    name: "${friendly_name} Time Slot 6"
    id: sunsynk_esphome_time_slot_6
    icon: "mdi:clock"
    lambda: |-
        int minutes, hours;
        if (id(sunsynk_esphome_system_mode_time6).state) {
        minutes = static_cast<int>(id(sunsynk_esphome_system_mode_time6).state) % 100;
        hours = static_cast<int>(id(sunsynk_esphome_system_mode_time6).state) / 100;
        } else {
          minutes = 0;
          hours = 0;
        }
        char formatted_time[6];
        snprintf(formatted_time, sizeof(formatted_time), "%02d:%02d", hours, minutes);
        return esphome::optional<std::string>(formatted_time);


################################################ SELECT SENSORS ################################################

select:
  - platform: modbus_controller                   #243 Select Energy Patern
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_select_energy_pattern
    name: "${friendly_name} Energy Pattern"
    address: 243
    value_type: U_WORD
    optionsmap:
      "Battery first": 0
      "Load first": 1   
         
  - platform: modbus_controller                   #244 Select Work Mode
    use_write_multiple: true
    modbus_controller_id: sunsynk
    id: sunsynk_esphome_select_work_mode
    name: "${friendly_name} Work Mode"
    address: 244
    value_type: U_WORD
    optionsmap:
      "Selling First": 0
      "Zero Export + Limit to Load Only": 1
      "Limited to Home": 2    

  - platform: modbus_controller                  #280 Select Grid Peak Shaving
    use_write_multiple: true
    modbus_controller_id: sunsynk
    name: "${friendly_name} Grid Peak Shaving"
    id: sunsynk_esphome_select_grid_peak_shaving
    address: 280
    value_type: U_WORD
    optionsmap:
      "Disabled": 0
      "Enabled": 256
    lambda: |-
      // we are only interested in the 8th bit binary 0001 0000 0000 need to map the options 0, 256 in select 
      //ESP_LOGE("main","Modbus Number incoming value = %d",x);
      //ESP_LOGE("main","Modbus eval value = %d",(x & 0x0100));
      if ((x & 0x0100) == 0)
        return  std::string("Disabled");
      if ((x & 0x0100) == 256)
        return  std::string("Enabled");
      return {};
    write_lambda: |-
      //ESP_LOGE("main","Modbus write gets = %d",value);
      uint16_t unmodified =  id(grid_peak_shaving_raw).state;
      //ESP_LOGE("main","Modbus write unmodified = %d", unmodified);
      // optionsmap should only return 2 values... 0 , 256 so bitmask with complement 0x0100 to ensure we keep the original values in register. then appply or with the value that was chosen
      uint16_t modified = ((unmodified & ~0x0100) | value);
      //ESP_LOGE("main","Modbus write to write = %d", modified);
      return modified;

 

In slipx's card, the entity names contains a number. Match that with your register address

1 minute ago, kellerza said:

In slipx's card, the entity names contains a number. Match that with your register address

hi Keller. problem was the entity names, my names seem to have a 2nd sunsynk_ at the beginning.

G

We are now at the same point. I dont get values with my splitter. Either the esp32 or battery bms doesn't come through. But my own crimped cable works fine. Even though I have checked the spittler with a multi tool and the pinouts are exactly straight end to end. I guess one of the "unused" battery pins are conflicting with the rs458 or I must double check my crimps. Its allso possible that there is interference with a unshielded cable. 

As for slipxs flow card I think it needs his yaml code as it will make things easier but not nessary. His yaml file can be found in the same folder as the flow card. 

Im also getting some of the double sunsynk names, for now I just renamed the sensors in the code of the flow chart. I think Im going to redo my setup from scratch to make sure there is no unused entity sensors as I deleted some of them with the double sunsynk name and it didn't make a difference. 

Lastly his code to set up the all in card for the charts are not working. Scoobs has a video on this to setup the graphs individually each one on its own card but you will have to put each sensor in manually. And organize the cards yourself. 

 

4 minutes ago, XianZA said:

We are now at the same point. I dont get values with my splitter. Either the esp32 or battery bms doesn't come through. But my own crimped cable works fine. Even though I have checked the spittler with a multi tool and the pinouts are exactly straight end to end. I guess one of the "unused" battery pins are conflicting with the rs458 or I must double check my crimps. Its allso possible that there is interference with a unshielded cable. 

As for slipxs flow card I think it needs his yaml code as it will make things easier but not nessary. His yaml file can be found in the same folder as the flow card. 

Im also getting some of the double sunsynk names, for now I just renamed the sensors in the code of the flow chart. I think Im going to redo my setup from scratch to make sure there is no unused entity sensors as I deleted some of them with the double sunsynk name and it didn't make a difference. 

Lastly his code to set up the all in card for the charts are not working. Scoobs has a video on this to setup the graphs individually each one on its own card but you will have to put each sensor in manually. And organize the cards yourself. 

 

checking, i'm guessing, as you are saying this very calmly that this does not cause any problems i'm yet to discover ?

i had a look, even if I plug the yellow cable directly into the BMS port, it stays all zero's... so my assumption was it was not caused by me...

G

25 minutes ago, georgelza said:

hi Keller. problem was the entity names, my names seem to have a 2nd sunsynk_ at the beginning.

G

Indeed the entity_id is the link between the two…

There has been some naming behaviour where the device name is prepended to the entity name to form the entity id. (Fixed it in my addon recently)

So you should remove the friendly_name part from all your sensors

name: "${friendly_name} xxxxx sensor

 

Ey Im not sure. if the cable is your battery coms plugged in to the bms port it should start communicating after like 20sec. I noticed the yellow cable alone took longer than my custom cable to start showing comms again. But yeah even though it couldn't com with the spiltter it didn't seem to do any harm as it still works with both my crimped cable and the yellow cable. Havnt had time to replace the yellow cable as it goes behind my dc breaker and behind the either breakers and in the trunking and thats possibly whats causing interference. I suspect maby rs458 is more sensitive to interence than the cam of the battery. Got a hubble battery btw. 

1 hour ago, XianZA said:

Hi @kellerza whats the main difference advantages/disadvantages between your implementation and slipx06s

Slipx’s made the lovelace/gui plugin, which can be used by any inverter, or any method of getting the inverter data

My addon is an alternative for the ESPhome solution (or solarassistant)

I documented why on my website, main reason I prefer the addon:

- Much less updates, but more accurate where it matters

- for something that potentially streams data every second, “the garage is too far” is not a good enough reason not to install a wire (I’m not against ESPHome, probably have 15 of them in/around the house, but its not for telemetry)

Edited by kellerza

42 minutes ago, georgelza said:

slipx06, any idea why I'd be having only day 3 showing potential PV and not tomorrow and day after...

G

Screenshot 2023-08-30 at 12.36.12.png

Did you only enable the “long term forecast”? 🤣

53 minutes ago, georgelza said:

slipx06, any idea why I'd be having only day 3 showing potential PV and not tomorrow and day after...

G

Screenshot 2023-08-30 at 12.36.12.png

Have you looked to see what your solcast sensor is reporting for tomorrow:

sensor.solcast_forecast_tomorrow

1 hour ago, slipx said:

Have you looked to see what your solcast sensor is reporting for tomorrow:

sensor.solcast_forecast_tomorrow

no value.

guess thats the problem... but why.

G

1 hour ago, kellerza said:

Slipx’s made the lovelace/gui plugin, which can be used by any inverter, or any method of getting the inverter data

My addon is an alternative for the ESPhome solution (or solarassistant)

I documented why on my website, main reason I prefer the addon:

- Much less updates, but more accurate where it matters

- for something that potentially streams data every second, “the garage is too far” is not a good enough reason not to install a wire (I’m not against ESPHome, probably have 15 of them in/around the house, but its not for telemetry)

Not gonna lie. I went with slipxs one as I didn't I understand yours and the whole mqqt thing. I was also under the impression that yours was outdated as it was a while ago that you mentioned updating something. 

6 minutes ago, georgelza said:

no value.

guess thats the problem... but why.

G

Try this one as a trouble shooti g step found under Add intergration. At the start I found solcast incredibly inaccurate. It also out of the blue just stopped updating 2 weeks ago. I dont know if you aware you need to apply for an api key and all that stuff

Screenshot_20230830_211849_Home Assistant.jpg

  • Author
19 minutes ago, XianZA said:

Try this one as a trouble shooti g step found under Add intergration. At the start I found solcast incredibly inaccurate. It also out of the blue just stopped updating 2 weeks ago. I dont know if you aware you need to apply for an api key and all that stuff

 

I have actually found Solcast to be very accurate.

I currently have 2 arrays mapped to my profile as I have an East/West split. 

Here is a record of my Forecast vs Actual produced, bearing in mind that not all the available power was used resulting in lower production totals.  

 

image.png.198dba4d6f2ed5828d597f58951e1310.png

 

4 hours ago, Sc00bs said:

I have actually found Solcast to be very accurate.

I currently have 2 arrays mapped to my profile as I have an East/West split. 

Here is a record of my Forecast vs Actual produced, bearing in mind that not all the available power was used resulting in lower production totals.  

 

image.png.198dba4d6f2ed5828d597f58951e1310.png

 

awesome will have to give it another shot

different question, on my mate HA platform, got the Custom Flex Horseshoe card installed, but when i try and add a dashboard using it it tells me no such entity/feature.

and yes have restarted.


G

12 hours ago, slipx said:

Have you looked to see what your solcast sensor is reporting for tomorrow:

sensor.solcast_forecast_tomorrow

think i found my problem. my tomorrow is shown as just sensor.forecast_tomorrow and not solcast_forecast_tomorrow.
amusing... for the Sunsynk i ended with sunsynk_sunsynk_<sensorname> and now I'm loosing a name, he he he...
G

Screenshot 2023-08-31 at 07.58.35.png

Edited by georgelza

 

Hi Guys

Just a heads up - I resolved my issue with our 5kW system. Its a newer unit and the integration only works on blue & blue/white.

Next question, has anyone successfully done an integration with 3 parallel Sunsynk inverters(16kW)? If someone could share some info regarding this integration that would be great? Do I need to have 3 separate controllers, ie one for each inverter? One master and obviously two slaves.

Thanks.

14 minutes ago, Donovan_kk1997 said:

 

Hi Guys

Just a heads up - I resolved my issue with our 5kW system. Its a newer unit and the integration only works on blue & blue/white.

Thanks.

elaborate please.

G

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.