Jump to content

My Sunsynk 8Kw & data collection setup


Recommended Posts

On 2022/04/06 at 10:27 AM, BrettC said:

Yes, the Esphome Modbus specs do say an ESP32 is preferred although an ESP8266 should work too.

https://esphome.io/components/modbus_controller.html

busy trying to flash my esp32 with esp home... keeps on failing, where as the esp8266 (slightly smaller chip) went easily, this is on my MAC, did try on a Windows box also, same issue with esp32. I'd prefer to use the esp8266, it being a bit cheaper... but if it's going to cause problems then I'll have to figure out how to get the esp32 working... ps I did use arduino to flash a simple getchipid onto the esp32 and it worked (from MAC).

can add the esp32 shows a red light while connected where as the esp8266 showed a blue.

hmm, let me see if i can find a distro of esp home that i can flash using arduino

ideas ?

G

Edited by georgelza
Link to comment
Share on other sites

On 2022/11/06 at 12:53 PM, system32 said:

Grafana 9.2.3 Canvas Visualizations can do a similar thing.
https://grafana.com/docs/grafana/next/panels-visualizations/visualizations/canvas/

image.thumb.png.b95814713b40644b4d0b3260d120ad4e.png

system32, any chance you're good at Grafana and/or SVG... 

I got a sensor that measure water level of a water tank, and would love to input a percentage full and have it visually display it in HA, minnyou I'd love to be able to show the same JoJo tank in Grafana and show / water level based on a input %.

G

Link to comment
Share on other sites

On 2023/03/02 at 5:15 PM, CorneSchutte said:

"My" ESPHome code, which is a combination of others work before me.

But I believe the Deye registers are completely different?

esphome:
  name: "sunsynk"

preferences:
  flash_write_interval: 5min

esp32:
  board: esp32dev
  framework:
    type: arduino

#################################### GLOBALS ####################################
substitutions:
  modbus_update_interval: "3s"
  settings_skipped_updates: "10"
  query_throttle: "50ms"
  device_name: sunsynk
  friendly_name: SunSynk Link

#################################### STATIC SECTION ####################################
wifi:
  ssid: XXXX
  password: XXX
  fast_connect: true

ota:
  safe_mode: true
  reboot_timeout: 10min
  num_attempts: 5

web_server:
  port: 80

#captive_portal:

# Enable logging
#logger:
#  baud_rate: 0

# Enable Home Assistant API
api:


# https://esphome.io/components/time.html#home-assistant-time-source
time:
  - platform: homeassistant
    id: homeassistant_time

#################################### STATIC SECTION ####################################

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_esphome
   address: 0x01
   modbus_id: sunsynk_modbus
   setup_priority: -10
   update_interval: ${modbus_update_interval}
   command_throttle: ${query_throttle}

switch:
  - platform: restart
    name: "${friendly_name} Restart"

  - platform: modbus_controller      # 248 Toggle System Timer
    use_write_multiple: true
    modbus_controller_id: sunsynk_esphome
    name: "Toggle System Timer" 
    id: sunsynk_esphome_toggle_Time_of_Use
    register_type: holding
    address: 248
    bitmask: 1
    entity_category: config
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 274 Toggle Grid Charge Timezone1
    use_write_multiple: true
    modbus_controller_id: sunsynk_esphome
    name: "Toggle Grid Charge Timezone1"
    id: sunsynk_esphome_toggle_grid_charge_timezone1
    register_type: holding
    address: 274
    bitmask: 1
    entity_category: config
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 275 Toggle Grid Charge Timezone2
    modbus_controller_id: sunsynk_esphome
    use_write_multiple: true
    name: "Toggle Grid Charge Timezone2"
    id: sunsynk_esphome_toggle_grid_charge_timezone2
    register_type: holding
    address: 275
    bitmask: 1
    entity_category: config
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 276 Toggle Grid Charge Timezone3
    modbus_controller_id: sunsynk_esphome
    use_write_multiple: true
    name: "Toggle Grid Charge Timezone3"
    id: sunsynk_esphome_toggle_grid_charge_timezone3
    register_type: holding
    address: 276
    bitmask: 1
    entity_category: config
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 277 Toggle Grid Charge Timezone4
    modbus_controller_id: sunsynk_esphome
    use_write_multiple: true
    name: "Toggle Grid Charge Timezone4"
    id: sunsynk_esphome_toggle_grid_charge_timezone4
    register_type: holding
    address: 277
    bitmask: 1
    entity_category: config
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 278 Toggle Grid Charge Timezone5
    modbus_controller_id: sunsynk_esphome
    use_write_multiple: true
    name: "Toggle Grid Charge Timezone5"
    id: sunsynk_esphome_toggle_grid_charge_timezone5
    register_type: holding
    address: 278
    bitmask: 1
    entity_category: config
    icon: "mdi:toggle-switch"

  - platform: modbus_controller          # 279 Toggle Grid Charge Timezone6
    modbus_controller_id: sunsynk_esphome
    use_write_multiple: true
    name: "Toggle Grid Charge Timezone6"
    id: sunsynk_esphome_toggle_grid_charge_timezone6
    register_type: holding
    address: 279
    bitmask: 1
    entity_category: config
    icon: "mdi:toggle-switch"

number:
  - platform: modbus_controller         # 268 Settings SoC Timezone1
    use_write_multiple: true
    modbus_controller_id: sunsynk_esphome
    id: sunsynk_esphome_set_soc_timezone1
    name: "Set SoC Timezone1"
    unit_of_measurement: "%"
    address: 268
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 269 Settings SoC Timezone2
    use_write_multiple: true
    modbus_controller_id: sunsynk_esphome
    id: sunsynk_esphome_set_soc_timezone2
    name: "Set SoC Timezone2"
    unit_of_measurement: "%"
    address: 269
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 270 Settings SoC Timezone3
    use_write_multiple: true
    modbus_controller_id: sunsynk_esphome
    id: sunsynk_esphome_set_soc_timezone3
    name: "Set SoC Timezone3"
    unit_of_measurement: "%"
    address: 270
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 271 Settings SoC Timezone4
    use_write_multiple: true
    modbus_controller_id: sunsynk_esphome
    id: sunsynk_esphome_set_soc_timezone4
    name: "Set SoC Timezone4"
    unit_of_measurement: "%"
    address: 271
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 272 Settings SoC Timezone5
    use_write_multiple: true
    modbus_controller_id: sunsynk_esphome
    id: sunsynk_esphome_set_soc_timezone5
    name: "Set SoC Timezone5"
    unit_of_measurement: "%"
    address: 272
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

  - platform: modbus_controller         # 273 Settings SoC Timezone6
    use_write_multiple: true
    modbus_controller_id: sunsynk_esphome
    id: sunsynk_esphome_set_soc_timezone6
    name: "Set SoC Timezone6"
    unit_of_measurement: "%"
    address: 273
    min_value: 0
    max_value: 100
    step: 5
    value_type: U_WORD  

sensor: 
   
 - platform: wifi_signal
   name: WiFi signal ${device_name} 
   id: wifi_s
   internal: true
   update_interval: 60s
 - platform: template
   name: Wifi ${device_name}
   unit_of_measurement: '%'
   accuracy_decimals: 0
   icon: "mdi:wifi"
   lambda: |-
        if (id(wifi_s).state < -92.0)
          return 1.0;
        if (id(wifi_s).state > -21.0)
          return 100.0;
        else
          return round(( -0.0154 * id(wifi_s).state * id(wifi_s).state ) - ( 0.3794 * id(wifi_s).state ) + 98.182 );
   update_interval: 60s
 - platform: uptime
   filters:
      - lambda: return x / 3600;
   unit_of_measurement: hours
   name: ${device_name} Uptime

 - platform: modbus_controller          #72 Battery Charge Total
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Charge Total"
   id: sunsynk_esphome_battery_charge_total
   register_type: holding
   address: 72
   unit_of_measurement: "kWh"
   accuracy_decimals: 1
   device_class: energy
   state_class: total_increasing
   filters:
    - lambda: |-
           x = x / -1;
           if (x > 32767) return (0 - x + 65535) /10;
           else return (0 - x) /10;
 - platform: modbus_controller          #74 Battery Discharge Total
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Discharge Total"
   id: sunsynk_esphome_battery_discharge_total
   register_type: holding
   address: 74
   unit_of_measurement: "kWh"
   accuracy_decimals: 0
   device_class: energy
   state_class: total_increasing
   filters:
    - lambda: |-
           if (x > 32767) return (x - 65535) /10;
           else return (x) /10;

 - platform: modbus_controller          # 81 Grid Export Total (Sell)
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Export Total (Sell)"
   id: sunsynk_esphome_grid_export_total_sell
   register_type: holding
   address: 81
   unit_of_measurement: "kWh"
   accuracy_decimals: 2
   device_class: energy
   state_class: total_increasing
   filters:
    - lambda: |-
           if (x > 32767) return (x - 65535) / 10;
           else return x /10;

 - platform: modbus_controller          # 78 Grid Import Total (Buy)
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Import Total (Buy)"
   id: sunsynk_esphome_grid_import_total_buy
   register_type: holding
   address: 78
   unit_of_measurement: "kWh"
   accuracy_decimals: 0
   device_class: energy
   state_class: total_increasing
   filters: #GOOD
    - lambda: |-
           x = x / -1;
           if (x > 32767) return (0 - x + 65535) /1;
           else return (0 - x) /1;
  
 - platform: modbus_controller          # 85 Load Power Total
   modbus_controller_id: sunsynk_esphome
   name: "SS Load Power Total"
   id: sunsynk_esphome_load_power_total
   register_type: holding
   address: 85
   unit_of_measurement: "kWh"
   accuracy_decimals: 0
   device_class: energy
   state_class: total_increasing
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (0 - x + 65535) /1;
           else return (0 - x) /1;
  
 - platform: modbus_controller
   modbus_controller_id: sunsynk_esphome
   name: "SS Total PV Power (kWh)"
   id: sunsynk_esphome_total_pv_power_kwh
   register_type: holding
   address: 96
   unit_of_measurement: "kWh"
   accuracy_decimals: 2
   device_class: energy
   state_class: total_increasing
   filters:
     - multiply: 0.1

 - platform: modbus_controller          # 169 Grid Power
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Power"
   id: sunsynk_esphome_grid_power
   register_type: holding
   address: 169
   unit_of_measurement: "W"
   accuracy_decimals: 0
   device_class: power
   state_class: measurement
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 178 Load Power
   modbus_controller_id: sunsynk_esphome
   name: "SS 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
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller       # 186 PV1 Power
   modbus_controller_id: sunsynk_esphome
   name: "SS PV1 Power"
   id: sunsynk_esphome_pv1_power
   register_type: holding
   address: 186
   unit_of_measurement: "W"
   accuracy_decimals: 2
   device_class: power
   state_class: measurement
   
 - platform: modbus_controller       # 187 PV2 Power
   modbus_controller_id: sunsynk_esphome
   name: "SS PV2 Power"
   id: sunsynk_esphome_pv2_power
   register_type: holding
   address: 187
   unit_of_measurement: "W"
   accuracy_decimals: 2
   device_class: power
   state_class: measurement

 - platform: template           # PV Total Power
   name: "SS PV Power"
   id: sunsynk_esphome_pv_power
   unit_of_measurement: "W"
   accuracy_decimals: 2
   device_class: power
   state_class: measurement
   update_interval: 15s
   lambda: |-
     return (id(sunsynk_esphome_pv1_power).state + id(sunsynk_esphome_pv2_power).state);

 - platform: total_daily_energy     # PV Daily Energy
   name: 'SS PV Daily Energy'
   id: sunsynk_esphome_pv_daily_energy
   power_id: sunsynk_esphome_pv_power
   unit_of_measurement: 'kWh'
   icon: mdi:circle-slice-3
   state_class: total_increasing
   device_class: energy
   accuracy_decimals: 2
   restore: true
   filters:
      # Multiplication factor from W to kW is 0.001
      - multiply: 0.001

 - platform: modbus_controller  # 190 Battery Output
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Output Power"
   id: sunsynk_esphome_battery_output_power
   register_type: holding
   address: 190
   unit_of_measurement: "W"
   accuracy_decimals: 2
   device_class: power
   state_class: measurement
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;


 - platform: modbus_controller          # 184 Battery SOC
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery SOC"
   id: sunsynk_esphome_battery_soc
   register_type: holding
   address: 184
   unit_of_measurement: "%"
   accuracy_decimals: 0
   device_class: battery
   state_class: measurement
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 184 Battery Usable SOC
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Usable SOC"
   id: sunsynk_esphome_battery_usable_soc
   register_type: holding
   address: 184
   unit_of_measurement: "%"
   accuracy_decimals: 0
   device_class: battery
   state_class: measurement
   filters: #GOOD
   # battery normally charges to 99%, shutdown level is 20%, so subtract 19 from value and calculate as percentage divided by 80
    - lambda: |-
       
           if (x > 32767) {
              int y = ((((x - 65535) -19) /80) *100) /1; 
              if (y > 100) return 100;
              return y;
           }
           else {
              int y = (((x -19) /80) *100) /1;
              if (y > 100) return 100;
              return y;
           }
          
 - platform: modbus_controller          # 216 Battery Charging Efficiency
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Charging Efficiency"
   id: sunsynk_esphome_battery_charging_efficiency
   register_type: holding
   address: 216
   unit_of_measurement: "%"
   accuracy_decimals: 1
   device_class: battery
   state_class: measurement
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /10;
           else return (x) /10;

# - platform: modbus_controller          # 013 Firmware Control Board
#   modbus_controller_id: sunsynk_esphome
#   name: "SS Firmware Control Board"
#   id: sunsynk_esphome_firmware_control_board
#   register_type: holding
#   address: 13

# - platform: modbus_controller          # 013 Firmware Comms Board
#   modbus_controller_id: sunsynk_esphome
#   name: "SS Firmware Comms Board"
#   id: sunsynk_esphome_firmware_comms_board
#   register_type: holding
#   address: 14

 - platform: modbus_controller          # 079 Grid Frequency
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Frequency"
   id: sunsynk_esphome_grid_frequency
   register_type: holding
   address: 79
   unit_of_measurement: "hz"
   accuracy_decimals: 2
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /100;
           else return (x) /100;
   #device_class: none
   state_class: measurement
   
 - platform: modbus_controller          # 192 Load Frequency
   modbus_controller_id: sunsynk_esphome
   name: "SS Load Frequency"
   id: sunsynk_esphome_load_frequency
   register_type: holding
   address: 192
   unit_of_measurement: "hz"
   accuracy_decimals: 2
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /100;
           else return (x) /100;
   #device_class: none
   state_class: measurement
   
 - platform: modbus_controller          # 154 Grid Inverter Voltage
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Inverter Voltage"
   id: sunsynk_esphome_grid_inverter_voltage
   register_type: holding
   address: 154
   unit_of_measurement: "V"
   accuracy_decimals: 1
   filters: #GOOD
     - lambda: |-
           if (x > 32767) return (x - 65535) /10;
           else return (x) /10;
   device_class: voltage
   state_class: measurement
   
 - platform: modbus_controller         # 150 Grid Voltage
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Voltage"
   id: sunsynk_esphome_grid_voltage
   register_type: holding
   address: 150
   unit_of_measurement: "V"
   accuracy_decimals: 1
   filters: #GOOD
     - lambda: |-
           if (x > 32767) return (x - 65535) /10;
           else return (x) /10;
   device_class: voltage
   state_class: measurement

  
 - platform: modbus_controller         # 154 Grid Inverter Voltage
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Voltage"
   id: sunsynk_inverter_grid_voltage
   register_type: holding
   address: 154
   unit_of_measurement: "V"
   accuracy_decimals: 1
   filters: #GOOD
     - lambda: |-
           if (x > 32767) return (x - 65535) /10;
           else return (x) /10;
   device_class: voltage
   state_class: measurement

 - platform: modbus_controller          # 183 Battery Voltage
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Voltage"
   id: sunsynk_esphome_battery_voltage
   register_type: holding
   address: 183
   unit_of_measurement: "V"
   accuracy_decimals: 1
   filters: #GOOD
     - lambda: |-
           if (x > 32767) return (x - 65535) / 100;
           else return x / 100;
   device_class: voltage
   state_class: measurement

 - platform: modbus_controller          # 312 Battery Charge Voltage
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Charge Voltage"
   id: sunsynk_esphome_battery_charge_voltage
   register_type: holding
   address: 312
   unit_of_measurement: "V"
   accuracy_decimals: 1
   filters: #GOOD
     - lambda: |-
           x = x / -1;
           if (x > 32767) return (0 - x + 65535) /100;
           else return (0 - x) /100;
   device_class: voltage
   state_class: measurement

 - platform: modbus_controller          # 167 Grid Inverter Load
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Inverter Load"
   id: sunsynk_esphome_grid_inverter_load
   register_type: holding
   address: 167
   unit_of_measurement: "W"
   accuracy_decimals: 0
   filters: #GOOD
     - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
   device_class: power
   state_class: measurement

 - platform: modbus_controller          # 172 Grid External Power
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid External Power"
   id: sunsynk_esphome_grid_external_power
   register_type: holding
   address: 172
   unit_of_measurement: "W"
   accuracy_decimals: 0
   filters: #GOOD
     - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
   device_class: power
   state_class: measurement

 - platform: total_daily_energy        # Grid External Daily Energy
   name: 'SS Grid External Daily Energy'
   id: sunsynk_esphome_grid_external_daily_energy
   power_id: sunsynk_esphome_grid_external_power
   unit_of_measurement: 'kWh'
   icon: mdi:circle-slice-3
   state_class: total_increasing
   device_class: energy
   accuracy_decimals: 2
   restore: true
   filters:
      # Multiplication factor from W to kW is 0.001
      - multiply: 0.001

 - platform: modbus_controller          # 166 Aux Output Power
   modbus_controller_id: sunsynk_esphome
   name: "SS Aux Output Power"
   id: sunsynk_esphome_aux_output_power
   register_type: holding
   address: 166
   unit_of_measurement: "W"
   accuracy_decimals: 0
   filters: #GOOD
     - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
   device_class: power
   state_class: measurement

 - platform: modbus_controller          # 164 Inverter Output Current
   modbus_controller_id: sunsynk_esphome
   name: "SS Inverter Output Current"
   id: sunsynk_esphome_inverter_output_current
   register_type: holding
   address: 191
   unit_of_measurement: "A"
   accuracy_decimals: 1
   device_class: current
   state_class: measurement
   filters: #GOOD
    - lambda: |-
          if (x > 32767) return (0 - x + 65535) /100;
          else return (0 - x) /100;

 - platform: modbus_controller          # 191 Battery Output Current
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Output Current"
   id: sunsynk_esphome_battery_output_current
   register_type: holding
   address: 191
   unit_of_measurement: "A"
   accuracy_decimals: 1
   device_class: current
   state_class: measurement
   filters: #GOOD
    - lambda: |-
          if (x > 32767) return (0 - x + 65535) /100;
          else return (0 - x) /100;

 - platform: modbus_controller          # 182 Battery Temperature
   modbus_controller_id: sunsynk_esphome
   name: "SS 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
   filters: # GOOD
    - lambda: |-
           if (x > 32767) return ((x - 65535)-1000) / 10;
           else return ((x)-1000) / 10;


 - platform: modbus_controller          # 090 DC Transformer Temperature
   modbus_controller_id: sunsynk_esphome
   name: "SS DC Transformer Temperature"
   id: sunsynk_esphome_dctransformer_temperature
   register_type: holding
   address: 090
   unit_of_measurement: "°C"
   accuracy_decimals: 1
   device_class: temperature
   state_class: measurement
   filters: # GOOD
    - lambda: |-
           if (x > 32767) return ((x - 65535)-1000) / 10;
           else return ((x)-1000) / 10;

 - platform: modbus_controller          # 091 Radiator Temperature
   modbus_controller_id: sunsynk_esphome
   name: "SS DC 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
   filters: # GOOD
    - lambda: |-
           if (x > 32767) return ((x - 65535)-1000) / 10;
           else return ((x)-1000) / 10;
  
 - platform: modbus_controller          #076 Grid Import Day (Buy)
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Import Day (Buy)"
   id: sunsynk_esphome_grid_import_day
   register_type: holding
   address: 76
   unit_of_measurement: "kWh"
   accuracy_decimals: 0
   device_class: energy
   state_class: total_increasing
   filters: # GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) / 10;
           else return x /10;

 - platform: modbus_controller          # 070 Battery Charge Day
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Charge Day"
   id: sunsynk_esphome_battery_charge_day
   register_type: holding
   address: 70
   unit_of_measurement: "kWh"
   accuracy_decimals: 1
   device_class: energy
   state_class: total_increasing
   filters: #GOOD
    - lambda: |-
           x = x / 10;
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 071 Battery Discharge Day
   modbus_controller_id: sunsynk_esphome
   name: "SS Battery Discharge Day"
   id: sunsynk_esphome_battery_discharge_day
   register_type: holding
   address: 71
   unit_of_measurement: "kWh"
   accuracy_decimals: 1
   device_class: energy
   state_class: total_increasing
   filters: #GOOD
    - lambda: |-
           x = x / 10;
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 175 Inverter Output Power
   modbus_controller_id: sunsynk_esphome
   name: "SS Inverter Output Power"
   id: sunsynk_esphome_inverter_output_power
   register_type: holding
   address: 175
   unit_of_measurement: "W"
   accuracy_decimals: 1
   device_class: power
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (0 - x + 65535) /-1;
           else return (0 - x) /-1;

################################################ READ SETTINGS ################################################
 - platform: modbus_controller          # 250 Settings Timezone1
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Timezone1"
   id: sunsynk_esphome_setting_timezone1
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 250
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
          
 - platform: modbus_controller          # 251 Settings Timezone2
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Timezone2"
   id: sunsynk_esphome_setting_timezone2
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 251
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 252 Settings Timezone3
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Timezone3"
   id: sunsynk_esphome_setting_timezone3
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 252
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 253 Settings Timezone4
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Timezone4"
   id: sunsynk_esphome_setting_timezone4
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 253
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 254 Settings Timezone5
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Timezone5"
   id: sunsynk_esphome_setting_timezone5
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 254
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 255 Settings Timezone6
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Timezone6"
   id: sunsynk_esphome_setting_timezone6
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 255
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 256 Settings Sell Mode Timezone1
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Sell Mode Timezone1"
   id: sunsynk_esphome_setting_sellmode_timezone1
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 256
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 257 Settings Sell Mode Timezone2
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Sell Mode Timezone2"
   id: sunsynk_esphome_setting_sellmode_timezone2
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 257
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 258 Settings Sell Mode Timezone3
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Sell Mode Timezone3"
   id: sunsynk_esphome_setting_sellmode_timezone3
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 258
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 259 Settings Sell Mode Timezone4
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Sell Mode Timezone4"
   id: sunsynk_esphome_setting_sellmode_timezone4
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 259
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 260 Settings Sell Mode Timezone5
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Sell Mode Timezone5"
   id: sunsynk_esphome_setting_sellmode_timezone5
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 260
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 261 Settings Sell Mode Timezone6
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Sell Mode Timezone6"
   id: sunsynk_esphome_setting_sellmode_timezone6
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 261
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
 - platform: modbus_controller          # 245 Settings Export Limit
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Export Limit"
   id: sunsynk_esphome_setting_export_limit
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 245
   unit_of_measurement: "W"
   device_class: power
   state_class: measurement
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
           
 - platform: modbus_controller          # 217 Settings Battery Shutdown
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Battery Shutdown"
   id: sunsynk_esphome_setting_battery_shutdown
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 217
   unit_of_measurement: "%"
   device_class: battery
   state_class: measurement
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 219 Settings Battery Low
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Battery Low"
   id: sunsynk_esphome_setting_battery_low
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 219
   unit_of_measurement: "%"
   device_class: battery
   state_class: measurement
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 218 Settings Battery Restart
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Battery Restart"
   id: sunsynk_esphome_setting_battery_restart
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 218
   unit_of_measurement: "%"
   device_class: battery
   state_class: measurement
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 210 Settings Battery Max Charge Current
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Battery Max Charge Current"
   id: sunsynk_esphome_setting_battery_max_charge_current
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 210
   device_class: current
   state_class: measurement
   unit_of_measurement: "A"   
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;

 - platform: modbus_controller          # 211 Settings Battery Max Discharge Current
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Max Discharge Current"
   id: sunsynk_esphome_setting_battery_max_discharge_current
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 211
   device_class: current
   state_class: measurement
   unit_of_measurement: "A"   
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;
           
 - platform: modbus_controller          # 230 Settings Grid Charge Current
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Grid Charge Current"
   id: sunsynk_esphome_setting_grid_charge_current
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 230
   device_class: current
   state_class: measurement
   unit_of_measurement: "A"   
   filters: #GOOD
    - lambda: |-
           if (x > 32767) return (x - 65535) /1;
           else return (x) /1;     

 - platform: total_daily_energy
   name: 'SS Inverter Daily Energy'
   id: sunsynk_esphome_inverter_daily_energy
   power_id: sunsynk_esphome_inverter_output_power
   unit_of_measurement: 'kWh'
   icon: mdi:circle-slice-3
   state_class: total_increasing
   device_class: energy
   accuracy_decimals: 2
   restore: true
   filters:
      # Multiplication factor from W to kW is 0.001
      - multiply: 0.001

############################################### BINARY SENSORS ###############################################
binary_sensor:

 - platform: status
   name: Status ${device_name}

 - platform: modbus_controller          # 194 Grid Connected Status
   modbus_controller_id: sunsynk_esphome
   name: "SS Grid Connected Status"
   id: sunsynk_esphome_grid_connected_status
   register_type: holding
   address: 194



############################################### BINARY SENSORS SETTINGS ###############################################  



 - platform: modbus_controller          # 244 Settings Load Limit Enabled
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Load Limit Enabled"
   id: sunsynk_esphome_setting_load_limit2
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 244


 - platform: modbus_controller          # 247 Settings Solar Export Enabled
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Solar Export Enabled"
   id: sunsynk_esphome_setting_solar_export_enabled
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 247

 - platform: modbus_controller          # 232 Settings Battery Grid Charge Enabled
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Battery Grid Charge Enabled"
   id: sunsynk_esphome_setting_battery_grid_charge_enabled
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   address: 232


############################################### TEXT SENSORS SETTINGS ############################################### 
text_sensor:
 - platform: wifi_info
   ssid:
      name: SSID ${device_name}
   bssid:
      name: BSSID ${device_name}
      id: bssid_id

 - platform: modbus_controller          # 243 Settings Energy Management Model (PL)
   modbus_controller_id: sunsynk_esphome
   name: "SSS Setting Energy Management Model"
   id: sunsynk_esphome_setting_energy_management_model
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   raw_encode: HEXBYTES
   address: 243
   lambda: |-
      uint16_t value = modbus_controller::word_from_hex_str(x, 0);
      switch (value) {
        case 0: return std::string("Battery Priority Mode");
        case 1: return std::string("Load First Mode");
        default: return std::string("Unknown");
      }
 - platform: modbus_controller          # 059 Overall State
   modbus_controller_id: sunsynk_esphome
   name: "SS Overall State"
   id: sunsynk_esphome_overall_state
   register_type: holding
   skip_updates: ${settings_skipped_updates}
   raw_encode: HEXBYTES
   address: 59
   lambda: |- # It is not clear what each of these states mean. TODO Fill in the string values once known
      uint16_t value = modbus_controller::word_from_hex_str(x, 0);
      switch (value) {
        case 0: return std::string("0");
        case 1: return std::string("1");
        case 2: return std::string("2");
        case 3: return std::string("3");
        case 4: return std::string("4");
        case 5: return std::string("5");
        default: return std::string("Unknown");
      }

I hope it helps!

Hi Corne.

I'm trying to figure things out. eventually got esp home installed on my esp32 using the esphome-web-tool.

I'm guessing I need to get the above code onto my esp home now ?

do you have matching HA dashboards ? and/or Grafana?

I will use Sc00bs esp32 -> RS485 dev board wiring to connect the R485 to the esp32.

Please help, never used a esp32 before, nor esphome.

PS: inverter is a 5Kw Sunsynk...

G

Edited by georgelza
adding information
Link to comment
Share on other sites

... ok I'm slowly working through the 13 odd pages here...

I got a esp32 that I've been able to flash with the demo image using https://esphome.github.io/esp-web-tools/

but now i'm lost... discovered you can't load you devices after the flash, it seems you include your devices in the image you flash.

Can someone help.

have a sunsynk 5.5 Kw inverter that I want to integrate with HA using one of these examples.

G

 

Link to comment
Share on other sites

On 2023/04/18 at 9:00 AM, roadkill said:

@system32 @Sc00bs  Thanks for confirming, I thought as much. It would be nice to have the added safety of having the geyser on non essential, but i suppose it is not necessary and also the reason i am going for an 8kw instead of the 5kw so i can add more panels at a later stage. 

hi, so I'm helping a friend n his Sunsynk atm, but I have a Victron, but how I did it...

Put my Geysers and stove on the non essential, but they are connected to the db onto a contractor, which then connected to a isolator.

I use 4 channel sonoff tasmotized with which In control/ open/close the contacts points. so my load is carried by a contractor, I control them via sonoffs. The sonoffs themself are on my essential circuit so they always powered.

with this setup of contractors and sonoffs it allows me to intelligently control my geysers and pool pump via timers in HA or NodeRed flow.

G

Edited by georgelza
adding some comments
Link to comment
Share on other sites

On 2022/07/14 at 7:46 AM, Farcus said:

Excellent work i have my setup all have gone with Pi zero sending Data to HA on pi 4b and all looking really good.
Now with the load shedding animal i need to be able to change my charge settings on my Sunsynk Inverter similar to the settings that you can change on Solar Assistant 
A lot of work that i still need to get going on grafana but i have some graphs working lekker thanks to Scoobs and Bloubul 7 

I just need to figure out how i can change these settings on my inverter and if possible have the schedule changed automaticlly with these hectic schedules we have at the moment but for now if i can just change it using Home assistant or Nodered and write back to the inverter 



 

Screenshot 2022-07-14 at 07.33.27.png

Farcus.

I'd be keen to know how you did this on a Pi platform, I have some lying around and would love to understand/know, might be easier for me as I know them vs the ESP32 platform/builds.

please DM me.

G

Link to comment
Share on other sites

Hi Folks,

Been building the ESP32 and RS485 project up to connect to an inverter (I am UK based).

Anyway bought an ESP32 DEV board and this TTL > RS485 board

I've wired them up as described and followed the instructions. I can now see the ESP board in Home Assistant fine but when I click on it there is only 1 entity which is "ESPHome Web 137a18 Firmware".

I have tried the following:

  • Removed the R7 resistor
  • Tried a second TTL > RS485 board
  • Tried a second network cable
  • Reversed the network cable wires that are in the TTL > RS485 board
  • Remove the plugin fully (Including removing the old directory left) in Home Assistant
  • Flashed the board a few times.
  • Re-seated the RJ45 into the inverter 
  • Reheck and re-soldered the wires again 

When I check the logs I only get a few lines around the setup see the attachment INFO attached ESPHome 2023.7.1.txt (I have hashed out the MAC), there is no data coming from the Inverter other than the output.

I am not sure what else I can do.

Any help I would be greatful.

Regards Ivan



 

esp.jpg

rs485 board 1.jpg

rs485 board 2.jpg

rs485.jpg

INFO ESPHome 2023.7.1.txt

Edited by Ivan Endicott
Link to comment
Share on other sites

29 minutes ago, Ivan Endicott said:

Hi Folks,

Been building the ESP32 and RS485 project up to connect to an inverter (I am UK based).

Anyway bought an ESP32 DEV board and this TTL > RS485 board

I've wired them up as described and followed the instructions. I can now see the ESP board in Home Assistant fine but when I click on it there is only 1 entity which is "ESPHome Web 137a18 Firmware".

I have tried the following:

  • Removed the R7 resistor
  • Tried a second TTL > RS485 board
  • Tried a second network cable
  • Reversed the network cable wires that are in the TTL > RS485 board
  • Remove the plugin fully (Including removing the old directory left) in Home Assistant
  • Flashed the board a few times.
  • Re-seated the RJ45 into the inverter 
  • Reheck and re-soldered the wires again 

When I check the logs I only get a few lines around the setup see the attachment INFO attached ESPHome 2023.7.1.txt (I have hashed out the MAC), there is no data coming from the Inverter other than the output.

I am not sure what else I can do.

Any help I would be greatful.

Regards Ivan



 

esp.jpg

rs485 board 1.jpg

rs485 board 2.jpg

rs485.jpg

INFO ESPHome 2023.7.1.txt 1.69 kB · 1 download

Not sure if this will help but I found that I initially needed to add just the ESP32 to HA with nothing connected it. Once it's added to HA and online, add the rest of the YAML code to it and upload it wirelessly.

Once this is done, connect the TTL > RS485 board to the ESP32.

Then try connecting it to the inverter.

Hope this helps :)

Link to comment
Share on other sites

15 minutes ago, Muttley said:

Not sure if this will help but I found that I initially needed to add just the ESP32 to HA with nothing connected it. Once it's added to HA and online, add the rest of the YAML code to it and upload it wirelessly.

Once this is done, connect the TTL > RS485 board to the ESP32.

Then try connecting it to the inverter.

Hope this helps :)

When you say the rest of the YAML code, which part are you referring to please?

Edited by Ivan Endicott
Link to comment
Share on other sites

1 hour ago, Ivan Endicott said:

When you say the rest of the YAML code, which part are you referring to please?

I'm not sure what Inverter you have (assuming it's an 8KW Sunsynk as this is where you've posted but this is the code I'm using courtesy of @slip

As he is using a Nodemcu, you'll need to change this plus Wi-Fi details etc but everything from the captive portal should be copy and paste

esp32:
  board: esp32dev
  framework:
    type: arduino

 

Link to comment
Share on other sites

14 minutes ago, Muttley said:

I'm not sure what Inverter you have (assuming it's an 8KW Sunsynk as this is where you've posted but this is the code I'm using courtesy of @slip

As he is using a Nodemcu, you'll need to change this plus Wi-Fi details etc but everything from the captive portal should be copy and paste

esp32:
  board: esp32dev
  framework:
    type: arduino

 

OK so I have the 5.5kW inverter and I have also change the board to the one listed. I have wired it up like the diagram and adjusted the following config based on the PINOUT diagram, I am much closure but not yet across the line.

I can see lots of logs coming out the ESP32 unit now which is a step in the right direction.
 

uart:
id: mod_bus
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 9600
stop_bits: 1
 
modbus:
id: sunsynk_modbus
flow_control_pin: GPIO4

pins.jpg

wiring.jpg

Link to comment
Share on other sites

Hi thanks for the advice @XAB@XAB it turned out to be exactly this. All the guides say top left port and it even says RS458. I came accros that 2 in 1 port and thought to myself there is no ways as mine is has a dedicated RS458 and its on the top left. Anyway when reading @fStofs post I thought just maybe and the plugged out battery cable and it just worked. sorry I couldn't reply been working. Made myself a 2 in one cable for the time being and have ordered one of those rj45 splitters. Just need to get the rest of the dashboards graphs working as some of the sensors have esphome in them.

Screenshot_20230813_104505_Home Assistant.jpg

Link to comment
Share on other sites

Hi @georgelza Im also new to esp32 but once you do it correctly one time its starts to make sense and become quite simple. I got a blue led on my esp32 when using GPIO2 and GPIO3 trying to troubleshoot.. But the esp32 supposed to be red led when its working. Make sure you using the top middle port marked RS458/CAN. If your battery is in there just unplug it to test. I also struggled the first 2 weeks as the esp did not have full wifi. Post some pics so we can see at which step you stuck at

Edited by XianZA
Link to comment
Share on other sites

so some figuring out.

esphome web tool will and can work... you just have to press the "boot" button on the esp32 when you click on the install option in the web tool... 

what makes it more interesting... doing this for a friend, so trying to figure out as much as I can at my house, now to go and install the physical bits at his, allowing me to return to my house to then remotely work on his HA deployment.

eventually figure out that I install ESPHome as a add on onto my HA. I then flash the esp32 and tell it to register with the local esphome running on ha. at that point I can add the yaml in esphome running on my HA to then do the sunsynk config.

need to relook at various bits of yaml i copied to make sure I copy/past the Sunsynk 5.5 kW yaml and not the 8.5, as they are all over the sight... just keeping track of the things i made notes off.

about to pop over to friend, see if i can do the physical on prem bits.

will "remove" the R7 resister also, as it seems it's a common across the board best option.

G

Link to comment
Share on other sites

Hi @georgelzayou getting there. I also looked at all the different code. I never saw a difference between the 8kw and 5kw. Eventually I settled on slipx version as his seems to be the most versatile and upto date. And he has intergrated certain things from other peoples code but most importantly hes got some things in that others dont have. In the end he has a 8kw and I used his code just fine on my 5kw

 

Link to comment
Share on other sites

Hi Folks,

I am well and truly stuck. I have the the setup by @Sc00bs in his video https://www.youtube.com/watch?v=VxhmD2GAJv4", not sure if I have to fully remove this before I start with the ESP32Dev \ RS485 build?

I have the SunSynk 5.5kW inverter plus batteries. I have check the wiring and can confirm I have followed this wiring diagram to the letter.

wiring.jpg.ef850055fc64efa615ecfbf06020a35c.jpg

I have installed the drivers from the ESP website and can see the ESP module when I plug it into my Windows PC on serial port 7. 

In Home Assistant I add the ESPHome add-on and then prepare the ESP module for initial setup where it joins the ESP module to my Wifi network, this is sucessful, I then click on Adopt in ESP add-on plugin.

I then remove the module from the USB port and plug it into a USB powersupply. After a few seconds the Add-on in Home Assistant shows as online.

I then add the device in Home Assistant under Device and Services.

I go back to ESPHome and click edit, to view the YAML that is installed on the board, I then copy in slipx06's code and change the  board: esp32dev, I update the encryption key.

I also update as the pins I am using are different from the one slipx06 uses.

 

Quote

uart:
  id: mod_bus
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 9600
  stop_bits: 1
 
modbus:
  id: sunsynk_modbus
  flow_control_pin: GPIO4

I also update the fall back SSID \ Password and the OTA password. I then Save and Install the settings and all appears to run through. I start to receive logs but entity values never appear in Home Assistant and they are marked as Unknown.

I have download the log  Log.txt

and noticed there are lots of these

[11:07:11][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=81 count=1
[11:07:11][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=84 count=3

and these

 

[11:07:07][D][modbus_controller:032]: Modbus command to device=1 register=0xBE countdown=0 no response received - removed from send queue
[11:07:09][D][modbus_controller:032]: Modbus command to device=1 register=0xF3 countdown=0 no response received - removed from send queue

Is this normal?

I've also noticed when I push the code down it displays a warning about using Pin 4 for flow control, again is this normal?

Regards Ivan

 

Link to comment
Share on other sites

54 minutes ago, XianZA said:

Hi @georgelzayou getting there. I also looked at all the different code. I never saw a difference between the 8kw and 5kw. Eventually I settled on slipx version as his seems to be the most versatile and upto date. And he has intergrated certain things from other peoples code but most importantly hes got some things in that others dont have. In the end he has a 8kw and I used his code just fine on my 5kw

 

pls send me your yaml you pushed onto the esp32,

are you running 5.5 or 8.5 kw inverter

looking for code for 5.5

G

Link to comment
Share on other sites

3 hours ago, XianZA said:

Hi @georgelzayou getting there. I also looked at all the different code. I never saw a difference between the 8kw and 5kw. Eventually I settled on slipx version as his seems to be the most versatile and upto date. And he has intergrated certain things from other peoples code but most importantly hes got some things in that others dont have. In the end he has a 8kw and I used his code just fine on my 5kw

 

which size inverter you running, looking for the current goto yaml file for the 5.5, and if you have an associated dashboard yaml also... ?

G

Link to comment
Share on other sites

1 hour ago, georgelza said:

which size inverter you running, looking for the current goto yaml file for the 5.5, and if you have an associated dashboard yaml also... ?

G

 

Hi George,

Are you running a sunsynk 5.5 inverter and trying to get the ESP32Dev board and TTL>RS485 board working?
I am almost there but I am seeing in the logs

Errors like this

[23:46:01][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=154 count=1
[23:46:01][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=160 count=1
[23:46:01][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=164 count=1

and 

[23:46:05][D][modbus_controller:032]: Modbus command to device=1 register=0xA0 countdown=0 no response received - removed from send queue
[23:46:06][D][modbus_controller:032]: Modbus command to device=1 register=0xA4 countdown=0 no response received - removed from send queue
[23:46:08][D][modbus_controller:032]: Modbus command to device=1 register=0xA6 countdown=0 no response received - removed from send queue

Are you by any chance seeing the same?

Link to comment
Share on other sites

4 hours ago, Ivan Endicott said:

Hi Folks,

I am well and truly stuck. I have the the setup by @Sc00bs in his video https://www.youtube.com/watch?v=VxhmD2GAJv4", not sure if I have to fully remove this before I start with the ESP32Dev \ RS485 build?

I have the SunSynk 5.5kW inverter plus batteries. I have check the wiring and can confirm I have followed this wiring diagram to the letter.

wiring.jpg.ef850055fc64efa615ecfbf06020a35c.jpg

I have installed the drivers from the ESP website and can see the ESP module when I plug it into my Windows PC on serial port 7. 

In Home Assistant I add the ESPHome add-on and then prepare the ESP module for initial setup where it joins the ESP module to my Wifi network, this is sucessful, I then click on Adopt in ESP add-on plugin.

I then remove the module from the USB port and plug it into a USB powersupply. After a few seconds the Add-on in Home Assistant shows as online.

I then add the device in Home Assistant under Device and Services.

I go back to ESPHome and click edit, to view the YAML that is installed on the board, I then copy in slipx06's code and change the  board: esp32dev, I update the encryption key.

I also update as the pins I am using are different from the one slipx06 uses.

 

I also update the fall back SSID \ Password and the OTA password. I then Save and Install the settings and all appears to run through. I start to receive logs but entity values never appear in Home Assistant and they are marked as Unknown.

I have download the log  Log.txt

and noticed there are lots of these

[11:07:11][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=81 count=1
[11:07:11][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=84 count=3

and these

 

[11:07:07][D][modbus_controller:032]: Modbus command to device=1 register=0xBE countdown=0 no response received - removed from send queue
[11:07:09][D][modbus_controller:032]: Modbus command to device=1 register=0xF3 countdown=0 no response received - removed from send queue

Is this normal?

I've also noticed when I push the code down it displays a warning about using Pin 4 for flow control, again is this normal?

Regards Ivan

 

mind pointing me to slipx's code... can't recall if his was for a 5.5Kw or 8.5KW inverter.

atm my HA running ESPHome on a little Pi3 is crashing when trying to compile/link/install the bits onto the ESP32.

what you running your HA on? wish my friend have upgraded his Pi3=>Pi4 by now...

 

Link to comment
Share on other sites

35 minutes ago, Ivan Endicott said:

 

Hi George,

Are you running a sunsynk 5.5 inverter and trying to get the ESP32Dev board and TTL>RS485 board working?
I am almost there but I am seeing in the logs

Errors like this

[23:46:01][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=154 count=1
[23:46:01][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=160 count=1
[23:46:01][W][modbus_controller:113]: Duplicate modbus command found: type=0x3 address=164 count=1

and 

[23:46:05][D][modbus_controller:032]: Modbus command to device=1 register=0xA0 countdown=0 no response received - removed from send queue
[23:46:06][D][modbus_controller:032]: Modbus command to device=1 register=0xA4 countdown=0 no response received - removed from send queue
[23:46:08][D][modbus_controller:032]: Modbus command to device=1 register=0xA6 countdown=0 no response received - removed from send queue

Are you by any chance seeing the same?

you ahead of me...

i'm not getting it compiled on the RPi3b

G

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...