Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Sofar G3 also HYD 5-20KTL-3PH #82

Merged
merged 1 commit into from Aug 22, 2022

Conversation

igieon
Copy link

@igieon igieon commented Aug 7, 2022

  • tested on firmware LSW3_15_270A_1.32

- tested on firmware LSW3_15_270A_1.32
Copy link

@sjoerdos92 sjoerdos92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this file. I tested it on my Sofar 12KTLX-G3 with LSW3_15_270A_1.50 logger. I needed to change some request codes though, otherwise I got various exceptions in the parser. My requests look like this:

requests:
  - start: 0x0400
    end: 0x042E
    mb_functioncode: 0x03
  - start: 0x0480
    end: 0x04AF
    mb_functioncode: 0x03
#  - start: 0x0500
#    end: 0x041F
#    mb_functioncode: 0x03
  - start: 0x0580
    end: 0x0589
    mb_functioncode: 0x03
#  - start: 0x0600
#    end: 0x060A
#    mb_functioncode: 0x03
  - start: 0x0680
    end: 0x069B
    mb_functioncode: 0x03

I needed to change all requests from ending with 4 to ending with 0. Also, the 0x500 start requests looks wrong and was giving me issues. The battery request (0x0600) works fine, but since I don't have a battery I just commented it.

@kszere
Copy link

kszere commented Aug 14, 2022

Thank you very much for this file. I tested it on my Sofar 12KTLX-G3 with LSW3_15_270A_1.50 logger. I needed to change some request codes though, otherwise I got various exceptions in the parser. My requests look like this:

requests:
  - start: 0x0400
    end: 0x042E
    mb_functioncode: 0x03
  - start: 0x0480
    end: 0x04AF
    mb_functioncode: 0x03
#  - start: 0x0500
#    end: 0x041F
#    mb_functioncode: 0x03
  - start: 0x0580
    end: 0x0589
    mb_functioncode: 0x03
#  - start: 0x0600
#    end: 0x060A
#    mb_functioncode: 0x03
  - start: 0x0680
    end: 0x069B
    mb_functioncode: 0x03

I needed to change all requests from ending with 4 to ending with 0. Also, the 0x500 start requests looks wrong and was giving me issues. The battery request (0x0600) works fine, but since I don't have a battery I just commented it.

I have HYD 5-20KTL-3PH and Logger is LSW3_15_270A_1.53.
screenshot-192 168 10 212_8123-2022 08 14-22_56_38

@kerberjg
Copy link

I tested the above config with Sofar HYD 6000-ES and LSW3_15_FFFF_1.0.57

This is the error I get:

2022-08-16 13:22:46.854 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.solarman_radiator_temperature_1 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_device_update
    await task
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/solarman/sensor.py", line 137, in update
    self.inverter.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 192, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/solarman/solarman.py", line 125, in update
    self.get_statistics()
  File "/config/custom_components/solarman/solarman.py", line 136, in get_statistics
    if 0 == self.send_request(params, start, end, mb_fc):
  File "/config/custom_components/solarman/solarman.py", line 103, in send_request
    request = self.generate_request(start, length, mb_fc)
  File "/config/custom_components/solarman/solarman.py", line 67, in generate_request
    buisiness_field = self.get_read_business_field(start, length, mb_fc)
  File "/config/custom_components/solarman/solarman.py", line 57, in get_read_business_field
    request_data.extend(length.to_bytes(2, 'big'))
OverflowError: can't convert negative int to unsigned

@StephanJoubert StephanJoubert merged commit 2381275 into StephanJoubert:main Aug 22, 2022
@pskuza pskuza mentioned this pull request Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants