Support for more SMA Devices (e.g. Tripower X)

I am one of these people :slight_smile: So yes, any help is greatly appreciated, because Iā€™m stuck searching for a way to control the battery charging of my SBSE4.0. I get no reaction to the typical Modbus commands 40149/40151 and canā€™t find a paramater in the webUi that would affect the battrry charging except for turning battery off completely. Thanks.

Hi Swante, and thank you for the awesome work!

I managed to setup my SHM2.0, but having trouble adding my inverter: Sunny Tripower 5.0 Smart Energy (hybrid inverter)

I tried all the interface options; others didnā€™t seem promising (not able to add device), but with the SpeedWire one I got it to recognize my inverter, and claim adding device is successful, but it shows up like this:

Diagnostic information is not available.

Normal logs: https://pastebin.com/TR6V1bmM

I see that a kind of similar device Tripower 10 Smart Energy was in the tested devices with Webconnect. This is baffling, as I was not able to add the device with webconnect regardless of SSL options or user/installer choices.

Any ideas what to try next?

The enneox-OS interface should worked.
Have to tried to just use the IP of the inverter?
have you verified that the username and password work directly on the inverter?

Speedwire has had some problems since version 0.3.5, which I have not yet been able to isolate as they do not occur in my case.

For host I have always used the direct ip address of the inverter.

The same IP in browser opens up the Inverterā€™s admin page, and Iā€™m using the same ā€œinstallerā€ / <pw> on my inverter successfully to open the admin page.

Some notes:

  • When opening up the Inverter using a browser; it opens with http (not secured).

I was looking at your source code; I wasnā€™t able to test it yet, but Iā€™m wondering if line 84 in init.py should be removed await sma.new_session().

I think before 0.35.0, that line was only executed inside the try/except block. Now, with the getPysmaInstance() function it gets always executed?

The other function that calls getPysmaInstance() will later anyway call await sma.new_session() inside the try/except like before.

When trying with

SMA Devices with EnnexOS (e.g. Tripower X Serie)

I get error:
2024-08-31 21:06:09.351 ERROR (MainThread) [pysmaplus.device_ennexos] Request to https://192.168.88.71/api/v1/token did not return a valid json. Code 400

Iā€™m a SMA noob, but Iā€™m not sure if Tripower Smart Energy devices are ennexOS devices like the Tripower X series. The data sheet doesnā€™t mention anything about ennex?

Forked the repo, removed line 84 // new_session.

Now it failed with a new error:


Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/pysmaplus/config_flow.py", line 47, in validate_input
    device_list = await sma.device_list()
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmaplus/device_speedwire.py", line 440, in device_list
    await self._protocol.start_query(["TypeLabel", "Firmware"], fut, self._group)
          ^^^^^^^^^^^^^^
AttributeError: 'SMAspeedwireINV' object has no attribute '_protocol'

I havenā€™t yet understood what is the version link between the ha-pysmaplus and pysma repositories. Is there a corresponding version change on pysma repo side to 0.34 ā†’ 0.35?

I was able to run the discovery:

discovery:
  - addr: 192.168.88.72
    port: 9522
    identify:
      - access: speedwireem
        status: found
        tested_endpoints: 192.168.88.72:38153
        exception: None
        remark: ""
        device: Sunny Home Manager 2 (3014942681)
      - access: ennexos
        status: failed
        tested_endpoints: https://192.168.88.72/api/v1/system/info
        exception: >-
          Could not connect to SMA at https://192.168.88.72: Cannot connect to
          host 192.168.88.72:443 ssl:default [Connect call failed
          ('192.168.88.72', 443)]
        remark: https
        device: ""
      - access: ennexos
        status: failed
        tested_endpoints: http://192.168.88.72/api/v1/system/info
        exception: None
        remark: http
        device: ""
      - access: speedwireinv
        status: failed
        tested_endpoints: 192.168.88.72:9522
        exception: "No connection to device: 192.168.88.72:9522  (3/3)"
        remark: ""
        device: ""
      - access: webconnect
        status: failed
        tested_endpoints: https://192.168.88.72
        exception: >-
          Could not connect to SMA at https://192.168.88.72: Cannot connect to
          host 192.168.88.72:443 ssl:default [Connect call failed
          ('192.168.88.72', 443)]
        remark: https://192.168.88.72
        device: ""
      - access: webconnect
        status: failed
        tested_endpoints: http://192.168.88.72
        exception: Server at http://192.168.88.72 disconnected 3 times.
        remark: http://192.168.88.72
        device: ""
      - access: shm2
        status: failed
        tested_endpoints: 192.168.88.72
        exception: Could not connect to 192.168.88.72:502
        remark: needs Installer Grid Guard Code. Usage not recommended.
        device: ""
  - addr: 192.168.88.71
    port: 9522
    identify:
      - access: speedwireinv
        status: maybe
        tested_endpoints: 192.168.88.71:9522
        exception: Login failed! Credentials wrong (user/install or password)
        remark: only unencrypted Speedwire is supported
        device: ""
      - access: ennexos
        status: failed
        tested_endpoints: https://192.168.88.71/api/v1/system/info
        exception: None
        remark: https
        device: ""
      - access: ennexos
        status: failed
        tested_endpoints: http://192.168.88.71/api/v1/system/info
        exception: None
        remark: http
        device: ""
      - access: webconnect
        status: failed
        tested_endpoints: https://192.168.88.71
        exception: ""
        remark: https://192.168.88.71
        device: ""
      - access: webconnect
        status: failed
        tested_endpoints: http://192.168.88.71
        exception: ""
        remark: http://192.168.88.71
        device: ""
      - access: speedwireem
        status: failed
        tested_endpoints: 192.168.88.71
        exception: None
        remark: no multicast packet received.
        device: ""
      - access: shm2
        status: failed
        tested_endpoints: 192.168.88.71
        exception: Could not connect to 192.168.88.71:502
        remark: needs Installer Grid Guard Code. Usage not recommended.
        device: ""
status: {}

2024-08-31 21:40:17.740 ERROR (MainThread) [pysmaplus.device_speedwire] Login failed!
2024-08-31 21:40:19.751 WARNING (MainThread) [asyncio] socket.send() raised exception.
2024-08-31 21:40:20.252 WARNING (MainThread) [asyncio] socket.send() raised exception.
2024-08-31 21:40:20.956 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/pysmaplus/device_speedwire.py", line 106, in controller
await self._send_next_command()
File "/usr/local/lib/python3.12/site-packages/pysmaplus/device_speedwire.py", line 158, in _send_next_command
f.set_result(True)
asyncio.exceptions.InvalidStateError: invalid state

please ignore my enneox comment. I made a mistake with the device type.

According to the discovery-action, speedwire should work:

     - access: speedwireinv
        status: maybe
        tested_endpoints: 192.168.88.71:9522
        exception: Login failed! Credentials wrong (user/install or password)
        remark: only unencrypted Speedwire is supported
        device: ""

Unfortunately, as already mentioned, speedwire is currently problematic.
You could try installing HACS 0.3.4 and test whether Speedwire works with this version.

The differences between the two versions of the integration should be the following:

And for the used library:

1 Like

@Choppahh

Can you please test the latest version (0.4.2) from today.
I changed the logic for new_session. Not sure if this helps with the speedwire problem.