Integrate GreenHeiss Inverter

Hello,

I have a Greenheiss inverter, this is the manual pdf (I only could find it in spanish sorry).
I would like to integrate it into Home Assistant although there is no addon to directly integrate it.

I’ve been investigating and here they say I could use the GoodWe inverter integration, although I’m getting an error "Unknown error occurred"

with this showing in the logs:

2025-04-02 17:54:49.750 ERROR (MainThread) [aiohttp.server] Error handling request from 172.30.33.1
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 232, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 121, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 340, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 387, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        flow, cur_step["step_id"], user_input
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 490, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/goodwe/config_flow.py", line 39, in async_step_user
    inverter = await connect(host=host, retries=10)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/goodwe/__init__.py", line 51, in connect
    return await discover(host, timeout, retries)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/goodwe/__init__.py", line 71, in discover
    response = await DISCOVERY_COMMAND.execute(host, timeout, retries)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/goodwe/protocol.py", line 154, in execute
    await response_future
  File "/usr/local/lib/python3.13/asyncio/selector_events.py", line 1233, in _read_ready
    data, addr = self._sock.recvfrom(self.max_size)
                 ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
ConnectionRefusedError: [Errno 111] Connection refused

Somewhere else I also found that those inverters could be possible to integrate it with SAJ solar inverter integration.

this is what I’ve added into my configuation.yaml

sensor:
  - platform: saj
    host: 192.168.18.45
    type: wifi

but it is not connecting to the inverter, and this is what the log is showing for this integration

2025-04-02 17:57:41.397 WARNING (MainThread) [pysaj] Connection to SAJ inverter is not possible. The inverter may be offline due to darkness. Otherwise check host/ip address.

Any help would be really appreciated.

Thanks.

I have succeeded integrating with this HACS repository: GitHub - djansen1987/SAJeSolar: SAJ eSolar Portal Sensors

Hi @darteaga & @Galindo, may I ask how you managed to get the info from the inversor to connect to the SAJ integration?

I’ve installed it, but I have no clue in how to get the data from my GreenHeiss inversor, I just got it installed this week…

Actually, I reached out to the technical service and they sent me the whole list of addresses to use from Modbus!

I just had to connect to the “espressif” device added to my local network on the regular 502 port and use the addresses provided and it just worked!

Here is a screenshot of the addresses for my GH-IH Style:

Using that directly in my configuration.yaml as follows:

modbus:
  - name: "greenheiss"
    type: tcp
    host: 192.168.1.XXX # Put your own local address here
    port: 502
    delay: 1
    timeout: 5

    sensors:
      # --- PV (solar) ---
      - name: "PV1 Voltage"
        address: 0x4071
        data_type: uint16
        scale: 0.1
        precision: 2
        unit_of_measurement: "V"

      - name: "PV1 Current"
        address: 0x4072
        data_type: uint16
        scale: 0.01
        precision: 2
        unit_of_measurement: "A"

      - name: "PV1 Power"
        address: 0x4073
        data_type: uint16
        unit_of_measurement: "W"

      - name: "Total PV Power"
        address: 0x40A5
        data_type: int16
        unit_of_measurement: "W"

      - name: "Today PV Energy"
        address: 0x40BF
        data_type: uint32
        scale: 0.01
        precision: 2
        unit_of_measurement: "kWh"

      - name: "Total PV Energy"
        address: 0x40C5
        data_type: uint32
        scale: 0.01
        precision: 2
        unit_of_measurement: "kWh"

      # --- Battery ---
      - name: "Battery Voltage"
        address: 0x4069
        data_type: uint16
        scale: 0.1
        precision: 2
        unit_of_measurement: "V"

      - name: "Battery Current"
        address: 0x406A
        data_type: int16
        scale: 0.01
        precision: 2
        unit_of_measurement: "A"

      - name: "Battery Power"
        address: 0x406D
        data_type: int16
        unit_of_measurement: "W"

      - name: "Battery Percent"
        address: 0x406F
        data_type: uint16
        scale: 0.01
        precision: 2
        unit_of_measurement: "%"

      - name: "Battery Temperature"
        address: 0x406E
        data_type: int16
        scale: 0.1
        precision: 2
        unit_of_measurement: "°C"

      - name: "Today Battery Charge Energy"
        address: 0x40C7
        data_type: uint32
        scale: 0.01
        precision: 2
        unit_of_measurement: "kWh"

      - name: "Today Battery Discharge Energy"
        address: 0x40CF
        data_type: uint32
        scale: 0.01
        precision: 2
        unit_of_measurement: "kWh"

      # --- Grid ---
      - name: "Grid Voltage"
        address: 0x4031
        data_type: uint16
        scale: 0.1
        precision: 2
        unit_of_measurement: "V"

      - name: "Grid Power"
        address: 0x40A7
        data_type: int16
        unit_of_measurement: "W"

      - name: "Today Grid Export Energy"
        address: 0x40EF
        data_type: uint32
        scale: 0.01
        precision: 2
        unit_of_measurement: "kWh"

      - name: "Today Grid Import Energy"
        address: 0x40F7
        data_type: uint32
        scale: 0.01
        precision: 2
        unit_of_measurement: "kWh"

      # --- Load (consumo de casa) ---
      - name: "Total Load Power"
        address: 0x40A0
        data_type: int16
        unit_of_measurement: "W"

      - name: "Today Load Energy"
        address: 0x40DF
        data_type: uint32
        scale: 0.01
        precision: 2
        unit_of_measurement: "kWh"

Hope that’s any useful to anyone :slight_smile:

Hello everyone,

I am working with a GreenHeiss inverter.
I am familiar with Modbus frames according to the protocol document.
We want to implement Wi-Fi communication since we are unable to use wired RS485.

Please, my question is whether Modbus over Wi-Fi uses the same frames as wired as presented in the protocol document of greenheiss.

Thanks

Hello Daniel, thank you for sharing the repository.
I developed my own MATLAB Modbus library for reading the adjacent power meter DSU666 for external control, but when I try to read inverter by Modbus-RS485, it seems the inverter refuses the frames. Wiring, all checked, even the inverter successfully reads periodically the power meter. I have just tried to wifi-connect to GH inverter server with ports 502 and 1883 and the inverter refuses the connection too. Someone who had experienced such behaviour? I have not access to the inverter registers.

Thanks

Hello, do you have the table with all the modbus registers? It would be very useful to me.