Code Monkey home page Code Monkey logo

sungrow-wallbox-modbus-homeassistant's Introduction

An addition to the Sungrow Inverter Repository from mkaiser.

Contents

1. Overview

This integration lets you gather sensor data and control several parameters of (currently only one) Sungrow Wallbox, the AC011E-01.

Please ensure the connection to either the inverter or other connection to a network is stable, else you might get false readings.

2. Documentation

The documentation covers following topics:

2.1. Installation

2.1.1. Lookup slave id of wallbox

Open the WiNet-S web interface /LAN or WLAN) and lookup the slave id of your wallbox (here 3): image

2.1.2. secrets.yaml

Add the following lines to your secrets.yaml and set your values:

wallbox_modbus_host_ip: expressif  # TODO update with the IP of your inverters WiNet-S dongle (not ModBus LAN port). No default. Check your router.
wallbox_modbus_port: 502 # TODO update with the Modbus port of your inverter WiNet-S dongle. Default is '502'
wallbox_modbus_slave: 3 #TODO update with the slave address of your wallbox. Default is '3'

2.1.3. Home Assistant configuration

The file modbus_wallbox.yaml contains the Modbus register maps, template sensors and automations. Copy the file to the subfolder named "integrations", which is located at the same level as your "configurations.yaml". Do not forget to check your configuration (Developer Tools --> hit "check configuration" and restart: it won't work without a restart!)

After the restart, some new sensors should be available. E.g., check for "Wallbox device type"

2.2. Dashboard setup

Dashboard Setup

2.3. Usage instructions

Usage Instructions

3. Support

Please consider using a ModBus proxy if you have problems with reading the registers. ModBus needs some time especially in combination with the WiNet-S dongle. For me its working a connection_time of 0.5.

If you any kind of assistance, you have two options:

4. Visual impressions

infos last current settings

sungrow-wallbox-modbus-homeassistant's People

Contributors

louisbertelsmann avatar pdressen avatar sunnycrockett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sungrow-wallbox-modbus-homeassistant's Issues

Modbus reads timing out (SH8.0RT over rear "LAN" Port)

Hi,

thank you for creating this integration. It's exactly what I'm currently searching for. Unfortunately I cannot get it to work.
The inverter integration from @mkaiser works flawlessly for me (https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant).

That is until I add just any one modbus item from your intergration to read. Then the whole integration stops working and all sensors become unavailable in Home Assistant. I think this is because nobody responds and the Modbus reads are timing out in the background.
I tried using several device id for the wallbox sensors (eg. 248, 3), but cannot read any register. Also when using a Modbus Tester software or pyModbus, I can read the inverters registers just fine, but no other device id (other than 1) seems to work.

To be clear: I am connecting to the SH8.0RT via the rear integrated LAN port, not the WiNet-S-Dongle. All values from the inverter are working fine. I just want to integrate the wallbox into Home Assistant.
My solar technician has already updated the firmware of the inverter and wallbox, this didn't change anything.

What am I missing here?

Experimenting with Charger Card

Currently I'm experimenting with tmjo's card https://github.com/tmjo/charger-card.
There is a way to use templates https://github.com/tmjo/charger-card/blob/master/src/templates/const_template.ts to create/add custom brands. For now, I use an existing template which I temporary have adapted to @Louisbertelsmann project. Maybe we can finish the whole thing and get a template ready for Sungrow to use.

grafik
grafik
grafik

type: custom:charger-card
entity: sensor.charging_power
brand: sungrow
show_leds: true
details:
  name:
    entity_id: sensor.wallbox_device_type
    attribute: name
  status:
    entity_id: sensor.charging_status
  currentlimits:
    - 6
    - 7
    - 8
    - 9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 20
    - 32
    - 63
  statetext:
    Available: Available
    Preparing: Plugged in
    SuspendedEV: Stopped (Car)
    Charging: Charging
    Finishing: Finishing
  collapsiblebuttons:
    group1:
      text: Details
      icon: mdi:speedometer
    group2:
      text: Information
      icon: mdi:information
    group3:
      text: Config
      icon: mdi:cog
  info_left:
    - entity_id: sensor.charging_status
      text: Availability
      icon: mdi:gas-station-in-use-outline
  info_right:
    - entity_id: sensor.charging_energy
      text: voltage
      icon: mdi:car-turbocharger
      unit_show: true
    - entity_id: sensor.charging_power
      text: power
      icon: mdi:power-socket-fr
      unit_show: true
  group1:
    - entity_id: sensor.charging_duration
      text: Charging duration
      icon: mdi:timelapse
      unit_show: false
    - entity_id: sensor.charged_range
      text: Charged range
      icon: mdi:highway
      unit_show: false
    - entity_id: sensor.charging_start_time
      text: Last Config Update
      icon: mdi:timer-play
    - entity_id: sensor.charging_end_time
      text: Last Data transfer
      icon: mdi:timer-stop
  group2:
    - entity_id: binary_sensor.charging_status_id
      text: S/N
    - entity_id: sensor.charging_status_id_tag
      text: TagID
    - entity_id: sensor.charging_status_reconnects
      text: Reconnects
    - entity_id: sensor.charging_status_transaction_id
      text: TransactionID
    - entity_id: sensor.charging_status_model
      text: Model
    - entity_id: sensor.charging_status_features
      text: OCPP features
    - entity_id: sensor.charging_status_temperature
      text: Temperature
      unit_show: true
  group3:
    - entity_id: sensor.charging_status_version_firmware
      text: Firmware
    - entity_id: sensor.charging_status_status_firmware
      text: Firmware-status
    - entity_id: sensor.output_current_setting
      text: Current Limit
      icon: mdi:current-ac
      type: dropdown
      service: number.set_value
      service_data:
        entity_id: input_number.set_wb1_output_current
        value: '#SERVICEVAL#'
  stats:
    default:
      - entity_id: sensor.charging_status_stop_reason
        text: Stop reason
      - entity_id: sensor.charging_status_error_code_connector
        text: Error (connector)
      - entity_id: sensor.charging_status_error_code
        text: Error (ocpp)
    Available:
      - entity_id: sensor.charging_status_stop_reason
        text: Stop reason
      - entity_id: sensor.charging_status_error_code_connector
        text: Error (connector)
      - entity_id: sensor.charging_status_error_code
        text: Error (ocpp)
    SuspendedEV:
      - entity_id: sensor.charging_status_energy_session
        text: Energy charged
        unit_show: true
      - entity_id: sensor.charging_status_stop_reason
        text: Stop reason
      - entity_id: sensor.charging_status_error_code_connector
        text: Error (connector)
      - entity_id: sensor.charging_status_error_code
        text: Error (ocpp)
    Preparing:
      - entity_id: sensor.charging_status_stop_reason
        text: Stop reason
    Charging:
      - entity_id: sensor.charging_status_energy_session
        text: session_energy
        unit_show: true
      - entity_id: sensor.charging_status_stop_reason
        text: Stop reason
      - entity_id: sensor.charging_status_error_code_connector
        text: Error (connector)
      - entity_id: sensor.charging_status_error_code
        text: Error (ocpp)
      - entity_id: sensor.charging_status_current_offered
        text: Max Current
      - entity_id: sensor.charging_status_time_session
        text: Charging time elapsed
  toolbar_left:
    default:
      - service: switch.toggle
        service_data:
          entity_id: input_select.set_wb_charger_enable
        text: Toggle on charging
        icon: mdi:play-speed
      - service: button.press
        service_data:
          entity_id: input_select.set_wb_remote_control
        text: Toggle off charger
        icon: hass:stop
      - service: number.set_value
        service_data:
          entity_id: input_number.set_wb1_output_current
          value: '#SERVICEVAL#'
        type: dropdown
        text: Set max current
        icon: hass:current-ac
    Available:
      - service: switch.toggle
        service_data:
          entity_id: undefined
        text: Toggle charging
        icon: hass:flash
      - service: button.press
        service_data:
          entity_id: undefined
        text: Restart charger
        icon: hass:restart
      - service: number.set_value
        service_data:
          entity_id: undefined
          value: '#SERVICEVAL#'
        type: dropdown
        text: Set max current
        icon: hass:current-ac
    SuspendedEV:
      - service: switch.turn_off
        service_data:
          entity_id: undefined
        text: Stop charging
        icon: hass:flash-alert
      - service: button.press
        service_data:
          entity_id: undefined
        text: Restart charger
        icon: hass:restart
      - service: number.set_value
        service_data:
          entity_id: undefined
          value: '#SERVICEVAL#'
        type: dropdown
        text: Set max current
        icon: hass:current-ac
    SuspendedEVSE:
      - service: switch.turn_on
        service_data:
          entity_id: undefined
        text: Stop charing
        icon: hass:flash-alert
      - service: button.press
        service_data:
          entity_id: undefined
        text: Restart charger
        icon: hass:restart
      - service: number.set_value
        service_data:
          entity_id: undefined
          value: '#SERVICEVAL#'
        type: dropdown
        text: Set max current
        icon: hass:current-ac
    Charging:
      - service: switch.turn_off
        service_data:
          entity_id: undefined
        text: Stop charging
        icon: hass:stop
      - service: button.press
        service_data:
          entity_id: undefined
        text: Restart charger
        icon: hass:restart
      - service: number.set_value
        service_data:
          entity_id: undefined
          value: '#SERVICEVAL#'
        type: dropdown
        text: Set max current
        icon: hass:current-ac
    Finishing:
      - service: button.press
        service_data:
          entity_id: undefined
        text: Restart charger
        icon: hass:restart
      - service: switch.toggle
        service_data:
          entity_id: undefined
        text: Toggle charging
        icon: hass:flash
    Preparing:
      - service: switch.turn_on
        service_data:
          entity_id: undefined
        text: Stop charing
        icon: hass:flash-alert
      - service: button.press
        service_data:
          entity_id: undefined
        text: Restart charger
        icon: hass:restart
      - service: number.set_value
        service_data:
          entity_id: undefined
          value: '#SERVICEVAL#'
        type: dropdown
        text: Set max current
        icon: hass:current-ac
chargerImage: White
customImage: \local\sungrow_wb_bl.png
customCardTheme: theme_transp_blue
compact_view: false
show_toolbar: true
show_name: true
show_status: true
show_stats: true
show_collapsibles: true
``

Please upload the dashboard files

Hi, without the Dashboard data i can not use your excellent project. Please upload an installation guide how to build the dashboard. Thx a lot!

Charging start/end time is not correct

The values I get for "Charging start time" and "Charging end time" are not correct:
image
image
I tried to get the correct values with modbus-cli and was successful with the following:
modbus dongle:502 -s 3 i@21319/I --byte-order=mixed
Parsed 0 registers definitions from 1 files
21319: 1707007290 0x65bedd3a
modbus dongle:502 -s 3 i@21317/I --byte-order=mixed
Parsed 0 registers definitions from 1 files
21317: 1706937153 0x65bdcb41

Those values are UNIX timestamps and could be converted to date/time. Unfortunately, I dont know how to configure the "--byte-order=mixed" option in HA yaml. Do you know how to do that?

Thanks & regards
Sunny

Control command issues

Currently I am only able to stop and restart a running session. I cannot initially start a session via home assistant. The wallbox is in "EMS" mode and connected to an SH8.0RT inverter. Also when I set the output current or the working mode, these settings are reverted after a few seconds. I can confirm, that the commands actually reach the wallbox, because I can see the charging power change briefly and I also double checked using a modbus tcp debug client (EasyModbus). It seems like either the inverter or the iSolarCloud (ocpp?) is overwriting the modbus registers every few seconds.

Did somebody manage to fully control the wallbox over modbus tcp using the Winet-S modbus tcp server?

Testing AC007E-01

Hi there, just wanted to share that AC007E-01 wallbox (single-phase model, with EMS mode paired with SH6.0RS) seems to be working fine with this integration. I will dive deeper later on all the various functions
Screenshot 2024-05-09 at 09 23 50

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.