Git Product home page Git Product logo

kellerza / sunsynk Goto Github PK

View Code? Open in Web Editor NEW
183.0 14.0 80.0 26.79 MB

Deye/Sunsynk Inverter Python library and Home Assistant OS Addon

Home Page: https://kellerza.github.io/sunsynk/

License: MIT License

Python 93.75% Dockerfile 0.65% Batchfile 0.73% Shell 1.69% JavaScript 0.77% Vue 0.13% TypeScript 2.05% CSS 0.20% HTML 0.03%
home-automation mqtt home-assistant homeassistant modbus sunsynk energy deye

sunsynk's Introduction

Deye/Sunsynk Inverters

This repo enables access to Deye Hybrid Inverters & Deye branded inverters like Sunsynk through a Python 3 library. It also provides an Add-On that can be installed in the Home Assistant OS.

This code was developed on a Sunsynk 5.5 kWh inverter.

DISCLAIMER: Use at your own risk! Especially when writing any settings.

Documentation

Refer to https://kellerza.github.io/sunsynk/

Home Assistant Sunsynk Add-On

For the Add-On you require Home Assistant OS and a RS-485 adaptor to connect to your Sunsynk inverter. Sensors are read using the Modbus protocol and sent to a MQTT server. See deployment options for examples of tested hardware.

Installation

  1. Add this repository to your HA Supervisor

    Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

    https://github.com/kellerza/sunsynk

  2. Install the Sunsynk Add-On from the Add-On Store and configure through the UI

    Install Sunsynk Addon

Below an example of the HomeAssistant Energy management dashboard using sensors from the Sunsynk.

HASS Energy management

Sunsynk Python Library

PyPI version codecov

The Python library is available through pip: pip install sunsynk

sunsynk's People

Contributors

agtconf avatar bmerry avatar cc120689 avatar dirkackerman avatar f1wade avatar fr3d avatar gurmukhp avatar ibeech avatar ivan-l avatar jacekowski avatar johanviljoen avatar jpmeijers avatar kababoom avatar kellerza avatar kharnt0x avatar lispwarez avatar mikee47 avatar n1c084 avatar reedy avatar rhysmcw avatar rixxxx avatar stevelup avatar warrenfoxley avatar xhanti avatar

Stargazers

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

sunsynk's Issues

Connection Issues

Hi Kellerza

I'm Having issues with the sensors not being available.

I installed the plugin and configured it on a Pi3b and home assistant core image from them.

The log shows that I'm connected successfully and I did get some output to the dashboard after setting up a card in lovalace.

Now the app just runs for a second or two once you start it ( You can see the cpu load ) and than just stops.

Please advise on what to do from here.

TIA

AB

Any idea what the unlisted inverter faults mean

My inverters are always showing some sort of fault on the fault sensor, but none of them are listed on the manual or anywhere else I can find.

Surely they have some meaning, does anyone know what they are?
The ones I have are F65 through to F73

Enhancement: Writable sensors

Enhancement related to

Sunsynk Home Assistant Add-On

Description

Hi @kellerza, I see you recently introduced the concept of a RWSensor so I can see that you are planning to support this in the future. Have you got a branch or any in-progress work for this? If not, I'd like to take a stab at it to introduce a missing sensor and make it writable based on a Select Entity. The sensor is number 243 which allows you to toggle between Battery or Load priority for PV production.

Happy to hear your thoughts!

New version of Deye/Sunsynk Modbus Protocol Document

I have come across a new version (V118) of the Deye Modbus RTU Protocol Document.
The previous version of this document that I had access to was V115. The changes in relation to V115 are the following

#248 - More options added to time of use selling, can now enable and disable time of use selling for each day of the week. I'm not 100% sure how this translates to the inverter settings, as you can only enable or disable grid charging or generator depending on the day of the week in the inverter HMI. (Plus there is some special option for Spain).

#274-279 - More access to time of use settings has been added, including enabling/disabling grid charge, enabling/disabling generator charge, and something about BM mode, BU mode and CH mode.

#181 - Looks like it should be Gen port voltage, not certain.

#62 - Changed from Day grid work time, to Day gen energy Wh

#92 & 93 - Changed to low and high values of total energy generation of the generator.
Modbus储能-组串-微逆宁波德业V118.pdf

Sunsynk library docs/example code

Issue related to the Python sunsynk library

I've just found this, and it looks perfect for my Sunsynk 8kw inverter.

However I'm really struggling to find any documentation on the library other than pip install sunsynk. Is there anything available?

Ideally, I'd really like just a simple 'hello world' app - a command-line tool that displayed one or two of the inverter's registers.

Once I had that I could dig into the code enough to figure out whatever else I needed, but it would also be a hugely helpful debugging aid. I've just made up the cable and I'd like to see if it was working before I have to worry about whether Home Assistant is set up correctly.

Thanks - and sorry if this isn't the best way to get in touch.

Reading more sensor values in Home Assitant

Hi,

Could someone please be so kind to explain to me step by step how to get all the values from the Sunsynk Inverter in Home Assistant.

I am getting the following:
image

I would like aditional Values like this:
image

Any help would be greatly appreciated.

Thank you

Sunsynk data not reading

I have HA installed on a Ubuntu server inside virtualbox as per the installation instructions ha installation on Linux (https://www.home-assistant.io/installation/linux/#install-home-assistant-operating-system)

Have battled to get the usb to RS485 converter to be seen by HA but found that the usb device must first be enabled in Virtualbox and were then quite exited that HA will work with my 8kW Sunsynk Inverter but it was not meant to be - communication is still not happening. Cable connection I think is correct Oninverter Pin 1&2 to B&A on Usb converter

on the Modbus TCP to Modbus RTU Gateway Add-on my Log info is as follows:
DEVICE: /dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0

[19:21:07] INFO: Starting mbusd -d -L - -v 3 -p /dev/ttyUSB0 -s 9600 -m 8N1 -P 502
11 Apr 2022 19:21:07 mbusd-0.5.1 started...
11 Apr 2022 19:21:07 tty: trying to open /dev/ttyUSB0 (speed 9600 mode 8N1)
11 Apr 2022 19:21:59 tty: error in read() (port closed)
11 Apr 2022 19:21:59 trying to re-open tty...
11 Apr 2022 19:21:59 tty re-opening...
11 Apr 2022 19:21:59 tty: trying to open /dev/ttyUSB0 (speed 9600 mode 8N1)
11 Apr 2022 19:21:59 tty re-opened.

The above looks like this part is working

on the Sunsynk Inverter Add-on the log file looks like this and I get Timeout Readings

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-04-11 19:26:04,237 INFO Loading HASS OS configuration
2022-04-11 19:26:04,294 INFO Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-04-11 19:26:04,305 INFO Protocol made connection.
2022-04-11 19:26:04,306 INFO Connected to /dev/ttyUSB0
2022-04-11 19:26:04,364 INFO ############################################################
2022-04-11 19:26:04,365 INFO Inverter serial number '2111255555'
2022-04-11 19:26:04,365 INFO ############################################################
2022-04-11 19:26:04,366 INFO MQTT: Connecting to mqtt_user@core-mosquitto:1883
2022-04-11 19:26:04,383 INFO MQTT: Connection successful
2022-04-11 19:26:15,412 ERROR Timeout reading:
2022-04-11 19:26:15,413 INFO Retrying individual sensors: ['Total PV Power:last', 'Total Battery Charge:last', 'Total Battery Discharge:last', 'Total Grid Export:last', 'Total Grid Import:last', 'Battery SOC:last']
2022-04-11 19:26:25,450 ERROR Timeout reading: Total PV Power
2022-04-11 19:26:35,489 ERROR Timeout reading: Total Battery Charge
2022-04-11 19:26:45,520 ERROR Timeout reading: Total Battery Discharge
2022-04-11 19:26:55,558 ERROR Timeout reading: Total Grid Export
2022-04-11 19:27:05,598 ERROR Timeout reading: Total Grid Import
2022-04-11 19:27:15,700 ERROR Timeout reading:

KeyError: 0 when using system_mode profile

Firstly, thanks again for a great add-on! The profiles feature is extremely useful!

Describe the issue/bug

On startup, the add-on (I'm currently using the dev version) refreshes the system_mode profile that I have opted into. The below error occurs, causing the add-on to crash and restart. This happens several times, perhaps 7 or 8 times, until one time the system_mode update will succeed and then all is well until the next restart. This causes startup to essentially be delayed by several minutes, but eventually the add-on does start up.

I am using a USR-W630 via TCP using the umodbus driver so that may contribute to the issue.

I will perform more experiments and post additional info as I receive it.

Expected behavior

The add-on should start up the first time without the exception being thrown.

Logs

2022-04-20 05:49:43,042 INFO    Profile System Mode action UPDATE
2022-04-20 05:49:43,042 DEBUG   PUBLISH 0 SUNSYNK/status/xxxxxxxx/system_mode, UPDATE
2022-04-20 05:49:43,129 DEBUG   Request registers: [250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261] glen=12. Response [100, 630, 830, 1530, 1800, 2048, 0, 0, 2952, 5000, 5000, 5000] len=12. regs={250: 100, 251: 630, 252: 830, 253: 1530, 254: 1800, 255: 2048, 256: 0, 257: 0, 258: 2952, 259: 5000, 260: 5000, 261: 5000}
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/sunsynk/sunsynk.py", line 52, in read_sensors
    r_r = await self.read_holding_registers(grp[0], glen)
  File "/usr/local/lib/python3.9/site-packages/sunsynk/usunsynk.py", line 43, in read_holding_registers
    return await self.client.read_holding_registers(self.server_id, start, length)
  File "/usr/local/lib/python3.9/site-packages/async_modbus/core.py", line 181, in read_holding_registers
    return await self._send_message(request)
  File "/usr/local/lib/python3.9/site-packages/async_modbus/core.py", line 142, in _send_message
    return await self.protocol._async_send_message(
  File "/usr/local/lib/python3.9/site-packages/async_modbus/core.py", line 43, in send_message_tcp
    tcp.raise_for_exception_adu(response_error_adu)
  File "/usr/local/lib/python3.9/site-packages/umodbus/client/tcp.py", line 247, in raise_for_exception_adu
    pdu_to_function_code_or_raise_error(resp_pdu)
  File "/usr/local/lib/python3.9/site-packages/umodbus/functions.py", line 118, in pdu_to_function_code_or_raise_error
    raise error_code_to_exception_map[error_code]
KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/app/./run.py", line 274, in <module>
    LOOP.run_until_complete(main(LOOP))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/src/app/./run.py", line 268, in main
    await profile_poll(SUNSYNK)
  File "/usr/src/app/profiles.py", line 179, in profile_poll
    await ss.read_sensors(profile.sensors)
  File "/usr/local/lib/python3.9/site-packages/sunsynk/sunsynk.py", line 54, in read_sensors
    raise Exception(  # pylint: disable=raise-missing-from
Exception: (1,268,12) 0
[cmd] ./run.py exited 1

System mode definitions

Hello Kellerza, first of all thank you very much for your fantastic addon.
I have a Turbo Energy sg03 5kw inverter.
My inverter in the ProgX_charge option accepts values "4", "8" and "16" that correspond to the System Work Mode options: "General Mode GM", "Backup Utility BU" and "Charge Mode CH".
With the last update of your addon, when selecting the different options of the ProgX_Charge (Allow Grid and Gen, No Grid No Gen etc.) it injects the inverter with values that do not work on my inverter: 6, 7...
Could you modify the addon so that it could select in ProgX_charge: "GM" (value 4) "BU" (value 8) and "CH" value 16?
Thank you very much.

Initial reading issues

This is more a Home Assistant issue (or rather my understanding of how this is supposed to work).

I have successfully connected to the inverter and can get the required sensors, but the energy dashboard shows the initial reading as the total reading stored by the inverter. Is this intended? Will I just need to live with this data point being at a very high scale. I'm aware that over the next few hours it will just show the increasing value, but it would be great to not have this large 'spike'.

Screenshot 2022-10-26 171136

HA add-on do not install

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Describe the issue/bug

Install of add-on does not complete successfully.

Expected behavior
Add-on expected to install via GUI, configure add-on and start add-on.

Your environment

  • Home Assistant version: core-2022.3.8
  • Supervisor version: supervisor-2022.03.5
  • Addon version: armv7-addon-hass-addon-sunsynk:2022.03.04b-0.1.4
  • Host OS: Raspbian GNU/Linux 10 (buster)
  • Docker version: 20.10.8

Logs

Supervisor log:

22-04-02 12:20:35 INFO (SyncWorker_7) [supervisor.docker.addon] Starting build for 4bb530c7/armv7-addon-hass-addon-sunsynk:2022.03.04b-0.1.4
22-04-02 12:20:40 ERROR (SyncWorker_7) [supervisor.docker.addon] Can't build 4bb530c7/armv7-addon-hass-addon-sunsynk:2022.03.04b-0.1.4: The command '/bin/ash -o pipefail -c pip3 install --no-cache-dir --disable-pip-version-check paho-mqtt~=1.5.0 pyyaml~=5.4.1 sunsynk[pymodbus,umodbus]==0.1.4' returned a non-zero code: 1
22-04-02 12:20:40 ERROR (SyncWorker_7) [supervisor.docker.addon] Build log: 
Step 1/13 : ARG BUILD_FROM
Step 2/13 : FROM ${BUILD_FROM}
 ---> 1c9cf6b54197
Step 3/13 : RUN pip3 install --no-cache-dir --disable-pip-version-check paho-mqtt~=1.5.0 pyyaml~=5.4.1 sunsynk[pymodbus,umodbus]==0.1.4
 ---> Running in 6e61df029649
Fatal Python error: init_interp_main: can't initialize time
Python runtime state: core initialized
PermissionError: [Errno 1] Operation not permitted
Current thread 0xb6f82390 (most recent call first):
<no Python frame>

Removing intermediate container 6e61df029649

Core log:

2022-04-02 12:08:37 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /addons/4bb530c7_hass-addon-sunsynk/install - The command '/bin/ash -o pipefail -c pip3 install --no-cache-dir --disable-pip-version-check paho-mqtt~=1.5.0 pyyaml~=5.4.1 sunsynk[pymodbus,umodbus]==0.1.4' returned a non-zero code: 1

Grid Connected Status / grid_connected_status - Unknown sensor

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Describe the issue/bug

Grid Connected Status - grid_connected_status value appears not to be supported or working as expected.

Expected behavior

Like other sensors expect adding grid_connected_status to the configuration to populate this sensor value but it claims to be unknown.

Your environment

  • Home Assistant version: 2022.6.7
  • Addon version: 2022.03.04b-0.1.4
  • Inverter make: Sunsynk
  • Inverter Model: 8kW
  • Inverter Firmware: M 6.0.1.4 \ S 1.7.2.4 \ C E.4.2.4

Logs

2022-07-04 11:20:06,234 INFO    ############################################################
2022-07-04 11:20:06,234 INFO          Unknown sensor in config: grid_connected_status
2022-07-04 11:20:06,234 INFO    ############################################################

Connect to Port by ID instead of Device Path

Right now it seems like the Port settings has to be in the Device Path format "/dev/ttyUSB0".

Is it possible to support the device ID instead "/dev/serial/by-id/usb-FTDI_USB-RS485_Cable_FTZ29WM6-if00-port0"?

The device path seems to change frequently when you have multiple devices in Home Assistant OS.

Unable to get data from inverter with modbus gateway

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Describe the issue/bug

I followed the wiring instructions with the correct ethernet cable type plugged into RS485 port on the 485-to-usb adpter (see image below), coupled with using pymodbus and mbusd for handling sending and recieving of data.

image

Expected behavior
Seeing how commands are recieved on the modbus gateway, I'm not entirely sure what I could be missing. I've double checked the wiring, tried different connection RS485 adapters and all behave the same

Your environment

  • Home Assistant version: 2022.8.7
  • Addon version: 2022.03.04b-0.1.4
  • Inverter make: Sunsynk
  • Inverter Model: 8kW
  • Inverter Firmware: \COMM:e41c \MCU: 6011

Logs

From the addon

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-08-28 12:38:55,112 INFO    Loading HASS OS configuration
2022-08-28 12:38:55,288 DEBUG   last unit:kWh, id:total_pv_power
2022-08-28 12:38:55,289 DEBUG   last unit:kWh, id:total_battery_charge
2022-08-28 12:38:55,290 DEBUG   last unit:kWh, id:total_battery_discharge
2022-08-28 12:38:55,290 DEBUG   last unit:kWh, id:total_grid_export
2022-08-28 12:38:55,291 DEBUG   last unit:kWh, id:total_grid_import
2022-08-28 12:38:55,292 DEBUG   last unit:%, id:battery_soc
2022-08-28 12:38:55,293 DEBUG   step unit:W, id:grid_power
2022-08-28 12:38:55,294 DEBUG   avg unit:V, id:grid_voltage
2022-08-28 12:38:55,294 DEBUG   step unit:W, id:load_power
2022-08-28 12:38:55,295 DEBUG   step unit:W, id:essential_power
2022-08-28 12:38:55,296 DEBUG   step unit:W, id:non_essential_power
2022-08-28 12:38:55,296 DEBUG   step unit:W, id:pv1_power
2022-08-28 12:38:55,297 DEBUG   step unit:W, id:pv2_power
2022-08-28 12:38:55,298 DEBUG   step unit:W, id:battery_power
2022-08-28 12:38:55,298 DEBUG   step unit:A, id:battery_current
2022-08-28 12:38:55,299 DEBUG   avg unit:V, id:battery_voltage
2022-08-28 12:38:55,300 DEBUG   last unit:kWh, id:day_grid_import
2022-08-28 12:38:55,301 DEBUG   last unit:kWh, id:day_grid_export
2022-08-28 12:38:55,302 DEBUG   last unit:kWh, id:day_pv_energy
2022-08-28 12:38:55,303 DEBUG   last unit:kWh, id:day_battery_charge
2022-08-28 12:38:55,303 DEBUG   last unit:kWh, id:day_battery_discharge
2022-08-28 12:38:55,304 INFO    Filter *last used for battery_soc, day_battery_charge, day_battery_discharge, day_grid_export, day_grid_import, day_pv_energy, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-08-28 12:38:55,304 INFO    Filter *step used for battery_current, battery_power, essential_power, grid_power, load_power, non_essential_power, pv1_power, pv2_power
2022-08-28 12:38:55,305 INFO    Filter *avg used for battery_voltage, grid_voltage
2022-08-28 12:38:55,306 DEBUG   Using selector: EpollSelector
2022-08-28 12:38:55,309 DEBUG   Connecting.
2022-08-28 12:38:55,321 DEBUG   Get address info pop-os.lan:502, type=<SocketKind.SOCK_STREAM: 1>
2022-08-28 12:38:55,371 DEBUG   Getting address info pop-os.lan:502, type=<SocketKind.SOCK_STREAM: 1> took 48.700ms: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, 'pop-os.lan', ('192.168.8.184', 502))]
2022-08-28 12:38:55,404 DEBUG   Client connected to modbus server
2022-08-28 12:38:55,405 INFO    Protocol made connection.
2022-08-28 12:38:55,407 DEBUG   <asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.30.33.3', 39100), raddr=('192.168.8.184', 502)> connected to pop-os.lan:502: (<_SelectorSocketTransport fd=8 read=polling write=<idle, bufsize=0>>, <pymodbus.client.asynchronous.async_io.ModbusClientProtocol object at 0x7f931efb50>)
2022-08-28 12:38:55,409 INFO    Connected to pop-os.lan:502.
2022-08-28 12:38:55,421 DEBUG   send: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0x3 0x0 0x5
2022-08-28 12:38:55,429 DEBUG   Adding transaction 1
2022-08-28 12:38:57,543 DEBUG   recv: 0x0 0x1 0x0 0x0 0x0 0x3 0x1 0x83 0xb
2022-08-28 12:38:57,544 DEBUG   Processing: 0x0 0x1 0x0 0x0 0x0 0x3 0x1 0x83 0xb
2022-08-28 12:38:57,546 DEBUG   Factory Response[131]
2022-08-28 12:38:57,547 DEBUG   Getting transaction 1
2022-08-28 12:38:57,555 ERROR   Read Error: (1,3,5) failed to read
2022-08-28 12:38:57,555 INFO    ############################################################
2022-08-28 12:38:57,556 INFO    No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc
2022-08-28 12:38:57,557 INFO    ############################################################
2022-08-28 12:38:57,557 CRITICAL This Add-On will terminate in 30 seconds, use the Supervisor Watchdog to restart automatically.

From Modbus TCP to RTU/serial gateway

28 Aug 2022 12:37:44 mbusd-0.5.1 started...
28 Aug 2022 12:37:44 tty: trying to open /dev/ttyUSB0 (speed 9600 mode 8N1)
28 Aug 2022 12:37:44 tty: state now is TTY_PAUSE
28 Aug 2022 12:37:44 conn_loop(): select(): max_sd = 4, t_out = 000000:100000 
28 Aug 2022 12:37:45 conn_loop(): select() returns 0 
28 Aug 2022 12:37:45 tty: state now is TTY_READY
28 Aug 2022 12:37:45 conn_loop(): select(): max_sd = 4, t_out = 000060:000000 
28 Aug 2022 12:38:45 conn_loop(): select() returns 0 
28 Aug 2022 12:38:45 conn_loop(): select(): max_sd = 4, t_out = 000060:000000 
28 Aug 2022 12:38:55 conn_loop(): select() returns 1 
28 Aug 2022 12:38:55 conn_open(): accepting connection from 192.168.8.148
28 Aug 2022 12:38:55 queue_new_elem(): length now is 1
28 Aug 2022 12:38:55 conn[192.168.8.148]: state now is CONN_HEADER
28 Aug 2022 12:38:55 conn_loop(): select(): max_sd = 5, t_out = 000060:000000 
28 Aug 2022 12:38:55 conn_loop(): select() returns 1 
28 Aug 2022 12:38:55 conn[192.168.8.148]: state now is CONN_RQST_FUNC
28 Aug 2022 12:38:55 conn_loop(): select(): max_sd = 5, t_out = 000060:000000 
28 Aug 2022 12:38:55 conn_loop(): select() returns 1 
28 Aug 2022 12:38:55 conn[192.168.8.148]: read request fc 3
28 Aug 2022 12:38:55 conn[192.168.8.148]: state now is CONN_RQST_TAIL
28 Aug 2022 12:38:55 conn[192.168.8.148]: request: [01][03][00][03][00][05]
28 Aug 2022 12:38:55 conn[192.168.8.148]: state now is CONN_TTY
28 Aug 2022 12:38:55 tty: state now is TTY_RQST
28 Aug 2022 12:38:55 conn_loop(): select(): max_sd = 4, t_out = 000060:000000 
28 Aug 2022 12:38:55 conn_loop(): select() returns 1 
28 Aug 2022 12:38:55 tty: written 8 bytes
28 Aug 2022 12:38:55 tty: request written (total 8 bytes)
28 Aug 2022 12:38:55 tty: state now is TTY_RESP
28 Aug 2022 12:38:55 tty: estimated 15 bytes, waiting 523958 usec
28 Aug 2022 12:38:55 conn_loop(): select(): max_sd = 4, t_out = 000000:523958 
28 Aug 2022 12:38:55 conn_loop(): select() returns 0 
28 Aug 2022 12:38:55 tty: response timeout

Connect to Deye SUN-3.6/5K-SG03LP1-EU

Hi, it's possible to connect to Deye Inverter?

image
This is the inverter

image
Network to RS 485

image
image
rj45
Blue (line 4) to B and Blue/White (line 5) to A according to the document

Untitled

USB found in home assistant

Sunsynk Inverter Add-on Config

PORT: /dev/ttyUSB0
PORT_ADDRESS: ''
SUNSYNK_ID: '21031292XX'
SENSORS:
  - total_pv_power
  - total_battery_charge
  - total_battery_discharge
  - total_grid_export
  - total_grid_import
  - battery_soc
SENSOR_PREFIX: rs485
TIMEOUT: 10
MQTT_HOST: core-mosquitto
MQTT_PORT: 1883
MQTT_USERNAME: xxxxxx
MQTT_PASSWORD: '111111'
DEBUG: 0

I'm not sure what wrong the log only show this

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-02-04 20:22:41,381 INFO    Loading HASS OS configuration
2022-02-04 20:22:41,383 INFO    Filter *last used for ['total_pv_power', 'total_battery_charge', 'total_battery_discharge', 'total_grid_export', 'total_grid_import']
2022-02-04 20:22:41,383 INFO    Filter *step used for ['battery_soc']
2022-02-04 20:22:41,460 INFO    Protocol made connection.
2022-02-04 20:22:41,462 INFO    Connected to /dev/ttyUSB0
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 489, in wait_for
    fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/app/./run.py", line 185, in <module>
    LOOP.run_until_complete(main(LOOP))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/src/app/./run.py", line 146, in main
    await SUNSYNK.read([ssdefs.serial])
  File "/usr/local/lib/python3.9/site-packages/sunsynk/sunsynk.py", line 100, in read
    r_r = await self.client.read_holding_registers(grp[0], glen, unit=self.unit)
  File "/usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py", line 35, in execute
    resp = await asyncio.wait_for(req, timeout=self._timeout)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 491, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
[cmd] ./run.py exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Thank you in advance

Lots of time-outs

Issue related to

Sunsynk (Dev) Home Assistant Add-On

Describe the issue/bug

There are many Timeout reading: messages in the log, and the values get updated very intermittently.

Expected behavior
There shouldn't be any timeouts, and the sensor values should be updated every second.

Your environment

  • Home Assistant version: 2022.11.3
  • Addon version: 2022.09.16-0.2.5
  • Inverter make: Sunsynk
  • Inverter Model: 8.8kW
  • Inverter Firmware: M 6.0.1.4 / S 1.7.2.4 / C E.4.2.4
  • Using the RS485 cable from Solar-Assistant

Logs

2022-11-18 16:19:09,691 DEBUG   Battery power=2366W (2366,)
2022-11-18 16:19:09,691 DEBUG   Grid power=0W (0,)
2022-11-18 16:19:09,691 DEBUG   Inverter power=3827W (3827,)
2022-11-18 16:19:09,691 DEBUG   Load power=3827W (3827,)
2022-11-18 16:19:09,692 DEBUG   PV1 power=1213W (1213,)
2022-11-18 16:19:09,692 DEBUG   PV2 power=460W (460,)
2022-11-18 16:19:10,430 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64824] len=2. regs={166: 0, 167: 64824}
2022-11-18 16:19:10,479 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:19:10,541 DEBUG   Request registers: [175] glen=1. Response [3835] len=1. regs={175: 3835}
2022-11-18 16:19:10,591 DEBUG   Request registers: [178] glen=1. Response [3835] len=1. regs={178: 3835}
2022-11-18 16:19:10,653 DEBUG   Request registers: [186, 187] glen=2. Response [1217, 464] len=2. regs={186: 1217, 187: 464}
2022-11-18 16:19:10,703 DEBUG   Request registers: [190] glen=1. Response [2366] len=1. regs={190: 2366}
2022-11-18 16:19:10,704 DEBUG   Battery power=2366W (2366,)
2022-11-18 16:19:10,704 DEBUG   Inverter power=3835W (3835,)
2022-11-18 16:19:10,704 DEBUG   Load power=3835W (3835,)
2022-11-18 16:19:10,705 DEBUG   Grid power=0W (0,)
2022-11-18 16:19:10,705 DEBUG   PV1 power=1217W (1217,)
2022-11-18 16:19:10,705 DEBUG   PV2 power=464W (464,)
2022-11-18 16:19:21,393 ERROR   Timeout reading: 
2022-11-18 16:19:21,443 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64822] len=2. regs={166: 0, 167: 64822}
2022-11-18 16:19:21,490 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:19:21,537 DEBUG   Request registers: [175] glen=1. Response [3831] len=1. regs={175: 3831}
2022-11-18 16:19:21,585 DEBUG   Request registers: [178] glen=1. Response [3831] len=1. regs={178: 3831}
2022-11-18 16:19:21,647 DEBUG   Request registers: [186, 187] glen=2. Response [1204, 466] len=2. regs={186: 1204, 187: 466}
2022-11-18 16:19:21,697 DEBUG   Battery power=2375W (2375,)
2022-11-18 16:19:21,697 DEBUG   Inverter power=3831W (3831,)
2022-11-18 16:19:21,697 DEBUG   Request registers: [190] glen=1. Response [2375] len=1. regs={190: 2375}
2022-11-18 16:19:21,698 DEBUG   Grid power=0W (0,)
2022-11-18 16:19:21,698 DEBUG   Load power=3831W (3831,)
2022-11-18 16:19:21,698 DEBUG   PV1 power=1204W (1204,)
2022-11-18 16:19:21,698 DEBUG   PV2 power=466W (466,)
2022-11-18 16:19:32,408 ERROR   Timeout reading: 
2022-11-18 16:19:42,422 ERROR   Timeout reading: 
2022-11-18 16:19:42,482 DEBUG   Request registers: [150] glen=1. Response [2305] len=1. regs={150: 2305}
2022-11-18 16:19:42,530 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64822] len=2. regs={166: 0, 167: 64822}
2022-11-18 16:19:42,578 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:19:42,626 DEBUG   Request registers: [175] glen=1. Response [3851] len=1. regs={175: 3851}
2022-11-18 16:19:42,689 DEBUG   Request registers: [178] glen=1. Response [3851] len=1. regs={178: 3851}
2022-11-18 16:19:42,739 DEBUG   Request registers: [186, 187] glen=2. Response [1224, 470] len=2. regs={186: 1224, 187: 470}
2022-11-18 16:19:42,787 DEBUG   Request registers: [190] glen=1. Response [2373] len=1. regs={190: 2373}
2022-11-18 16:19:42,788 DEBUG   Battery power=2373W (2373,)
2022-11-18 16:19:42,788 DEBUG   Grid power=0W (0,)
2022-11-18 16:19:42,788 DEBUG   Inverter power=3851W (3851,)
2022-11-18 16:19:42,788 DEBUG   Load power=3851W (3851,)
2022-11-18 16:19:42,789 DEBUG   Grid voltage=230.5V (2305,)
2022-11-18 16:19:42,789 DEBUG   PV1 power=1224W (1224,)
2022-11-18 16:19:42,790 DEBUG   PV2 power=470W (470,)
2022-11-18 16:19:43,478 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64824] len=2. regs={166: 0, 167: 64824}
2022-11-18 16:19:43,527 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:19:43,591 DEBUG   Request registers: [175] glen=1. Response [3850] len=1. regs={175: 3850}
2022-11-18 16:19:43,639 DEBUG   Request registers: [178] glen=1. Response [3850] len=1. regs={178: 3850}
2022-11-18 16:19:43,704 DEBUG   Request registers: [186, 187] glen=2. Response [1233, 470] len=2. regs={186: 1233, 187: 470}
2022-11-18 16:19:43,752 DEBUG   Request registers: [190] glen=1. Response [2362] len=1. regs={190: 2362}
2022-11-18 16:19:43,753 DEBUG   Battery power=2362W (2362,)
2022-11-18 16:19:43,754 DEBUG   Inverter power=3850W (3850,)
2022-11-18 16:19:43,754 DEBUG   Load power=3850W (3850,)
2022-11-18 16:19:43,755 DEBUG   Grid power=0W (0,)
2022-11-18 16:19:43,755 DEBUG   PV1 power=1233W (1233,)
2022-11-18 16:19:43,755 DEBUG   PV2 power=470W (470,)
2022-11-18 16:19:54,449 ERROR   Timeout reading: 
2022-11-18 16:20:04,468 ERROR   Timeout reading: 
2022-11-18 16:20:04,526 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64824] len=2. regs={166: 0, 167: 64824}
2022-11-18 16:20:04,576 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:20:04,622 DEBUG   Request registers: [175] glen=1. Response [3843] len=1. regs={175: 3843}
2022-11-18 16:20:04,671 DEBUG   Request registers: [178] glen=1. Response [3843] len=1. regs={178: 3843}
2022-11-18 16:20:04,734 DEBUG   Request registers: [186, 187] glen=2. Response [1242, 478] len=2. regs={186: 1242, 187: 478}
2022-11-18 16:20:04,783 DEBUG   Battery power=2335W (2335,)
2022-11-18 16:20:04,783 DEBUG   Inverter power=3843W (3843,)
2022-11-18 16:20:04,783 DEBUG   Load power=3843W (3843,)
2022-11-18 16:20:04,783 DEBUG   Request registers: [190] glen=1. Response [2335] len=1. regs={190: 2335}
2022-11-18 16:20:04,784 DEBUG   Grid power=0W (0,)
2022-11-18 16:20:04,784 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/pv2_power, 478
2022-11-18 16:20:04,784 DEBUG   PV1 power=1242W (1242,)
2022-11-18 16:20:04,784 DEBUG   PV2 power=478W (478,)
2022-11-18 16:20:04,784 INFO    PV2 power:step:mean: 392->478, 28 samples
2022-11-18 16:20:05,538 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64824] len=2. regs={166: 0, 167: 64824}
2022-11-18 16:20:05,587 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:20:05,633 DEBUG   Request registers: [175] glen=1. Response [3843] len=1. regs={175: 3843}
2022-11-18 16:20:05,683 DEBUG   Request registers: [178] glen=1. Response [3843] len=1. regs={178: 3843}
2022-11-18 16:20:05,746 DEBUG   Request registers: [186, 187] glen=2. Response [1242, 478] len=2. regs={186: 1242, 187: 478}
2022-11-18 16:20:05,796 DEBUG   Request registers: [190] glen=1. Response [2335] len=1. regs={190: 2335}
2022-11-18 16:20:05,797 DEBUG   Battery power=2335W (2335,)
2022-11-18 16:20:05,797 DEBUG   Inverter power=3843W (3843,)
2022-11-18 16:20:05,797 DEBUG   Load power=3843W (3843,)
2022-11-18 16:20:05,798 DEBUG   Grid power=0W (0,)
2022-11-18 16:20:05,798 DEBUG   PV1 power=1242W (1242,)
2022-11-18 16:20:05,798 DEBUG   PV2 power=478W (478,)
2022-11-18 16:20:16,492 ERROR   Timeout reading: 
2022-11-18 16:20:16,547 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64826] len=2. regs={166: 0, 167: 64826}
2022-11-18 16:20:16,595 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:20:16,643 DEBUG   Request registers: [175] glen=1. Response [3825] len=1. regs={175: 3825}
2022-11-18 16:20:16,709 DEBUG   Request registers: [178] glen=1. Response [3825] len=1. regs={178: 3825}
2022-11-18 16:20:16,756 DEBUG   Request registers: [186, 187] glen=2. Response [1252, 483] len=2. regs={186: 1252, 187: 483}
2022-11-18 16:20:16,804 DEBUG   Request registers: [190] glen=1. Response [2302] len=1. regs={190: 2302}
2022-11-18 16:20:16,805 DEBUG   Battery power=2302W (2302,)
2022-11-18 16:20:16,805 DEBUG   Grid power=0W (0,)
2022-11-18 16:20:16,805 DEBUG   Inverter power=3825W (3825,)
2022-11-18 16:20:16,805 DEBUG   Load power=3825W (3825,)
2022-11-18 16:20:16,806 DEBUG   PV1 power=1252W (1252,)
2022-11-18 16:20:16,806 DEBUG   PV2 power=483W (483,)
2022-11-18 16:20:17,558 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64826] len=2. regs={166: 0, 167: 64826}
2022-11-18 16:20:17,608 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:20:17,657 DEBUG   Request registers: [175] glen=1. Response [3825] len=1. regs={175: 3825}
2022-11-18 16:20:17,705 DEBUG   Request registers: [178] glen=1. Response [3825] len=1. regs={178: 3825}
2022-11-18 16:20:17,769 DEBUG   Request registers: [186, 187] glen=2. Response [1252, 483] len=2. regs={186: 1252, 187: 483}
2022-11-18 16:20:17,816 DEBUG   Battery power=2302W (2302,)
2022-11-18 16:20:17,816 DEBUG   Request registers: [190] glen=1. Response [2302] len=1. regs={190: 2302}
2022-11-18 16:20:17,817 DEBUG   Grid power=0W (0,)
2022-11-18 16:20:17,817 DEBUG   Inverter power=3825W (3825,)
2022-11-18 16:20:17,817 DEBUG   Load power=3825W (3825,)
2022-11-18 16:20:17,817 DEBUG   PV1 power=1252W (1252,)
2022-11-18 16:20:17,817 DEBUG   PV2 power=483W (483,)
2022-11-18 16:20:28,516 ERROR   Timeout reading: 
2022-11-18 16:20:28,564 DEBUG   Request registers: [150] glen=1. Response [2294] len=1. regs={150: 2294}
2022-11-18 16:20:28,613 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64828] len=2. regs={166: 0, 167: 64828}
2022-11-18 16:20:28,660 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:20:28,723 DEBUG   Request registers: [175] glen=1. Response [1897] len=1. regs={175: 1897}
2022-11-18 16:20:28,772 DEBUG   Request registers: [178] glen=1. Response [1897] len=1. regs={178: 1897}
2022-11-18 16:20:28,834 DEBUG   Request registers: [186, 187] glen=2. Response [1263, 488] len=2. regs={186: 1263, 187: 488}
2022-11-18 16:20:28,883 DEBUG   Request registers: [190] glen=1. Response [275] len=1. regs={190: 275}
2022-11-18 16:20:28,884 DEBUG   Battery power=275W (275,)
2022-11-18 16:20:28,884 DEBUG   Grid power=0W (0,)
2022-11-18 16:20:28,884 DEBUG   Grid voltage=229.4V (2294,)
2022-11-18 16:20:28,884 DEBUG   Inverter power=1897W (1897,)
2022-11-18 16:20:28,884 DEBUG   Load power=1897W (1897,)
2022-11-18 16:20:28,885 DEBUG   PV1 power=1263W (1263,)
2022-11-18 16:20:28,885 DEBUG   PV2 power=488W (488,)
2022-11-18 16:20:28,886 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/battery_power, 275
2022-11-18 16:20:28,886 INFO    Battery power:step:mean: 2351->275, 18 samples
2022-11-18 16:20:28,891 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/inverter_power, 1897
2022-11-18 16:20:28,891 INFO    Inverter power:step:mean: 3851->1897, 28 samples
2022-11-18 16:20:28,895 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/load_power, 1897
2022-11-18 16:20:28,895 INFO    Load power:step:mean: 3851->1897, 28 samples
2022-11-18 16:20:28,899 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/essential_power, 1190
2022-11-18 16:20:28,899 INFO    Essential power:step:mean: 3134->1190, 28 samples
2022-11-18 16:20:39,542 ERROR   Timeout reading: 
2022-11-18 16:20:39,597 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64706] len=2. regs={166: 0, 167: 64706}
2022-11-18 16:20:49,559 ERROR   Timeout reading: 
2022-11-18 16:20:49,614 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64832] len=2. regs={166: 0, 167: 64832}
2022-11-18 16:20:49,662 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:20:49,725 DEBUG   Request registers: [175] glen=1. Response [2023] len=1. regs={175: 2023}
2022-11-18 16:20:49,774 DEBUG   Request registers: [178] glen=1. Response [2023] len=1. regs={178: 2023}
2022-11-18 16:20:49,836 DEBUG   Request registers: [186, 187] glen=2. Response [1288, 503] len=2. regs={186: 1288, 187: 503}
2022-11-18 16:20:49,885 DEBUG   Battery power=365W (365,)
2022-11-18 16:20:49,885 DEBUG   Grid power=0W (0,)
2022-11-18 16:20:49,885 DEBUG   Inverter power=2023W (2023,)
2022-11-18 16:20:49,885 DEBUG   Load power=2023W (2023,)
2022-11-18 16:20:49,885 DEBUG   PV1 power=1288W (1288,)
2022-11-18 16:20:49,885 DEBUG   Request registers: [190] glen=1. Response [365] len=1. regs={190: 365}
2022-11-18 16:20:49,886 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/battery_power, 365
2022-11-18 16:20:49,886 DEBUG   PV2 power=503W (503,)
2022-11-18 16:20:49,886 INFO    Battery power:step:mean: 275->365, 1 samples
2022-11-18 16:20:49,887 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/inverter_power, 2023
2022-11-18 16:20:49,887 INFO    Inverter power:step:mean: 1897->2023, 1 samples
2022-11-18 16:20:49,888 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/load_power, 2023
2022-11-18 16:20:49,888 INFO    Load power:step:mean: 1897->2023, 1 samples
2022-11-18 16:20:49,889 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/essential_power, 1320
2022-11-18 16:20:49,889 INFO    Essential power:step:mean: 1190->1320, 1 samples
2022-11-18 16:20:50,624 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64832] len=2. regs={166: 0, 167: 64832}
2022-11-18 16:20:50,675 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:20:50,723 DEBUG   Request registers: [175] glen=1. Response [2023] len=1. regs={175: 2023}
2022-11-18 16:20:50,786 DEBUG   Request registers: [178] glen=1. Response [2023] len=1. regs={178: 2023}
2022-11-18 16:20:50,835 DEBUG   Request registers: [186, 187] glen=2. Response [1288, 503] len=2. regs={186: 1288, 187: 503}
2022-11-18 16:20:50,885 DEBUG   Battery power=365W (365,)
2022-11-18 16:20:50,885 DEBUG   Request registers: [190] glen=1. Response [365] len=1. regs={190: 365}
2022-11-18 16:20:50,886 DEBUG   Inverter power=2023W (2023,)
2022-11-18 16:20:50,886 DEBUG   Load power=2023W (2023,)
2022-11-18 16:20:50,887 DEBUG   Grid power=0W (0,)
2022-11-18 16:20:50,887 DEBUG   PV1 power=1288W (1288,)
2022-11-18 16:20:50,887 DEBUG   PV2 power=503W (503,)
2022-11-18 16:21:01,583 ERROR   Timeout reading: 
2022-11-18 16:21:11,605 ERROR   Timeout reading: 
2022-11-18 16:21:21,619 ERROR   Timeout reading: 
2022-11-18 16:21:21,682 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64836] len=2. regs={166: 0, 167: 64836}
2022-11-18 16:21:21,731 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:21:21,778 DEBUG   Request registers: [175] glen=1. Response [2014] len=1. regs={175: 2014}
2022-11-18 16:21:21,828 DEBUG   Request registers: [178] glen=1. Response [2014] len=1. regs={178: 2014}
2022-11-18 16:21:21,890 DEBUG   Request registers: [186, 187] glen=2. Response [1289, 506] len=2. regs={186: 1289, 187: 506}
2022-11-18 16:21:21,940 DEBUG   Request registers: [190] glen=1. Response [237] len=1. regs={190: 237}
2022-11-18 16:21:21,941 DEBUG   Battery power=237W (237,)
2022-11-18 16:21:21,941 DEBUG   Grid power=0W (0,)
2022-11-18 16:21:21,941 DEBUG   Inverter power=2014W (2014,)
2022-11-18 16:21:21,941 DEBUG   Load power=2014W (2014,)
2022-11-18 16:21:21,942 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/battery_power, 237
2022-11-18 16:21:21,942 DEBUG   PV1 power=1289W (1289,)
2022-11-18 16:21:21,942 DEBUG   PV2 power=506W (506,)
2022-11-18 16:21:21,942 INFO    Battery power:step:mean: 365->237, 2 samples
2022-11-18 16:21:32,641 ERROR   Timeout reading: 
2022-11-18 16:21:42,656 ERROR   Timeout reading: 
2022-11-18 16:21:42,722 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64834] len=2. regs={166: 0, 167: 64834}
2022-11-18 16:21:42,772 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:21:42,820 DEBUG   Request registers: [175] glen=1. Response [1998] len=1. regs={175: 1998}
2022-11-18 16:21:42,866 DEBUG   Request registers: [178] glen=1. Response [1998] len=1. regs={178: 1998}
2022-11-18 16:21:42,916 DEBUG   Request registers: [186, 187] glen=2. Response [1293, 519] len=2. regs={186: 1293, 187: 519}
2022-11-18 16:21:52,672 ERROR   Timeout reading: 
2022-11-18 16:21:52,736 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64834] len=2. regs={166: 0, 167: 64834}
2022-11-18 16:21:52,785 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:21:52,833 DEBUG   Request registers: [175] glen=1. Response [2015] len=1. regs={175: 2015}
2022-11-18 16:21:52,882 DEBUG   Request registers: [178] glen=1. Response [2015] len=1. regs={178: 2015}
2022-11-18 16:21:52,945 DEBUG   Request registers: [186, 187] glen=2. Response [1287, 515] len=2. regs={186: 1287, 187: 515}
2022-11-18 16:21:52,994 DEBUG   Request registers: [190] glen=1. Response [229] len=1. regs={190: 229}
2022-11-18 16:21:52,995 DEBUG   Battery power=229W (229,)
2022-11-18 16:21:52,995 DEBUG   Inverter power=2015W (2015,)
2022-11-18 16:21:52,996 DEBUG   Grid power=0W (0,)
2022-11-18 16:21:52,996 DEBUG   Load power=2015W (2015,)
2022-11-18 16:21:52,997 DEBUG   PV1 power=1287W (1287,)
2022-11-18 16:21:52,997 DEBUG   PV2 power=515W (515,)
2022-11-18 16:21:53,734 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64834] len=2. regs={166: 0, 167: 64834}
2022-11-18 16:21:53,782 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:21:53,846 DEBUG   Request registers: [175] glen=1. Response [2015] len=1. regs={175: 2015}
2022-11-18 16:21:53,896 DEBUG   Request registers: [178] glen=1. Response [2015] len=1. regs={178: 2015}
2022-11-18 16:21:53,958 DEBUG   Request registers: [186, 187] glen=2. Response [1287, 515] len=2. regs={186: 1287, 187: 515}
2022-11-18 16:21:54,007 DEBUG   Battery power=229W (229,)
2022-11-18 16:21:54,007 DEBUG   Request registers: [190] glen=1. Response [229] len=1. regs={190: 229}
2022-11-18 16:21:54,008 DEBUG   Grid power=0W (0,)
2022-11-18 16:21:54,008 DEBUG   Inverter power=2015W (2015,)
2022-11-18 16:21:54,008 DEBUG   Load power=2015W (2015,)
2022-11-18 16:21:54,008 DEBUG   PV1 power=1287W (1287,)
2022-11-18 16:21:54,009 DEBUG   PV2 power=515W (515,)
2022-11-18 16:22:04,707 ERROR   Timeout reading: 
2022-11-18 16:22:04,762 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64836] len=2. regs={166: 0, 167: 64836}
2022-11-18 16:22:04,810 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:22:04,858 DEBUG   Request registers: [175] glen=1. Response [2012] len=1. regs={175: 2012}
2022-11-18 16:22:04,906 DEBUG   Request registers: [178] glen=1. Response [2012] len=1. regs={178: 2012}
2022-11-18 16:22:04,968 DEBUG   Request registers: [186, 187] glen=2. Response [1290, 514] len=2. regs={186: 1290, 187: 514}
2022-11-18 16:22:05,017 DEBUG   Request registers: [190] glen=1. Response [226] len=1. regs={190: 226}
2022-11-18 16:22:05,018 DEBUG   Battery power=226W (226,)
2022-11-18 16:22:05,018 DEBUG   Inverter power=2012W (2012,)
2022-11-18 16:22:05,018 DEBUG   Load power=2012W (2012,)
2022-11-18 16:22:05,019 DEBUG   Grid power=0W (0,)
2022-11-18 16:22:05,019 DEBUG   PV1 power=1290W (1290,)
2022-11-18 16:22:05,020 DEBUG   PV2 power=514W (514,)
2022-11-18 16:22:05,767 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64836] len=2. regs={166: 0, 167: 64836}
2022-11-18 16:22:51,131 DEBUG   PV1 power=1241W (1241,)
2022-11-18 16:22:51,131 DEBUG   PV2 power=508W (508,)
2022-11-18 16:22:51,867 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64834] len=2. regs={166: 0, 167: 64834}
2022-11-18 16:22:51,916 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:22:51,979 DEBUG   Request registers: [175] glen=1. Response [2016] len=1. regs={175: 2016}
2022-11-18 16:22:52,030 DEBUG   Request registers: [178] glen=1. Response [2012] len=1. regs={178: 2012}
2022-11-18 16:22:52,092 DEBUG   Request registers: [186, 187] glen=2. Response [1251, 506] len=2. regs={186: 1251, 187: 506}
2022-11-18 16:22:52,141 DEBUG   Request registers: [190] glen=1. Response [271] len=1. regs={190: 271}
2022-11-18 16:22:52,142 DEBUG   Battery power=271W (271,)
2022-11-18 16:22:52,142 DEBUG   Inverter power=2016W (2016,)
2022-11-18 16:22:52,142 DEBUG   Load power=2012W (2012,)
2022-11-18 16:22:52,143 DEBUG   Grid power=0W (0,)
2022-11-18 16:22:52,144 DEBUG   PV1 power=1251W (1251,)
2022-11-18 16:22:52,144 DEBUG   PV2 power=506W (506,)
2022-11-18 16:22:52,881 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64838] len=2. regs={166: 0, 167: 64838}
2022-11-18 16:22:52,927 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:22:52,992 DEBUG   Request registers: [175] glen=1. Response [2012] len=1. regs={175: 2012}
2022-11-18 16:22:53,042 DEBUG   Request registers: [178] glen=1. Response [2012] len=1. regs={178: 2012}
2022-11-18 16:22:53,090 DEBUG   Request registers: [186, 187] glen=2. Response [1251, 506] len=2. regs={186: 1251, 187: 506}
2022-11-18 16:22:53,138 DEBUG   Request registers: [190] glen=1. Response [271] len=1. regs={190: 271}
2022-11-18 16:22:53,139 DEBUG   Battery power=271W (271,)
2022-11-18 16:22:53,139 DEBUG   Inverter power=2012W (2012,)
2022-11-18 16:22:53,139 DEBUG   Load power=2012W (2012,)
2022-11-18 16:22:53,140 DEBUG   Grid power=0W (0,)
2022-11-18 16:22:53,140 DEBUG   PV1 power=1251W (1251,)
2022-11-18 16:22:53,140 DEBUG   PV2 power=506W (506,)
2022-11-18 16:22:53,892 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64838] len=2. regs={166: 0, 167: 64838}
2022-11-18 16:22:53,942 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:22:53,990 DEBUG   Request registers: [175] glen=1. Response [2012] len=1. regs={175: 2012}
2022-11-18 16:22:54,053 DEBUG   Request registers: [178] glen=1. Response [2012] len=1. regs={178: 2012}
2022-11-18 16:22:54,102 DEBUG   Request registers: [186, 187] glen=2. Response [1251, 506] len=2. regs={186: 1251, 187: 506}
2022-11-18 16:22:54,150 DEBUG   Request registers: [190] glen=1. Response [271] len=1. regs={190: 271}
2022-11-18 16:22:54,151 DEBUG   Battery power=271W (271,)
2022-11-18 16:22:54,151 DEBUG   Inverter power=2012W (2012,)
2022-11-18 16:22:54,151 DEBUG   Load power=2012W (2012,)
2022-11-18 16:22:54,152 DEBUG   Grid power=0W (0,)
2022-11-18 16:22:54,152 DEBUG   PV1 power=1251W (1251,)
2022-11-18 16:22:54,152 DEBUG   PV2 power=506W (506,)
2022-11-18 16:22:54,905 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64834] len=2. regs={166: 0, 167: 64834}
2022-11-18 16:22:54,954 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:22:55,001 DEBUG   Request registers: [175] glen=1. Response [2010] len=1. regs={175: 2010}
2022-11-18 16:22:55,051 DEBUG   Request registers: [178] glen=1. Response [2010] len=1. regs={178: 2010}
2022-11-18 16:23:04,854 ERROR   Timeout reading: 
2022-11-18 16:23:04,910 DEBUG   Request registers: [150] glen=1. Response [2282] len=1. regs={150: 2282}
2022-11-18 16:23:14,873 ERROR   Timeout reading: 
2022-11-18 16:23:14,932 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64836] len=2. regs={166: 0, 167: 64836}
2022-11-18 16:23:14,979 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:23:15,026 DEBUG   Request registers: [175] glen=1. Response [2004] len=1. regs={175: 2004}
2022-11-18 16:23:15,075 DEBUG   Request registers: [178] glen=1. Response [2004] len=1. regs={178: 2004}
2022-11-18 16:23:15,139 DEBUG   Request registers: [186, 187] glen=2. Response [1230, 497] len=2. regs={186: 1230, 187: 497}
2022-11-18 16:23:15,188 DEBUG   Battery power=294W (294,)
2022-11-18 16:23:15,188 DEBUG   Inverter power=2004W (2004,)
2022-11-18 16:23:15,188 DEBUG   Request registers: [190] glen=1. Response [294] len=1. regs={190: 294}
2022-11-18 16:23:15,189 DEBUG   Grid power=0W (0,)
2022-11-18 16:23:15,189 DEBUG   Load power=2004W (2004,)
2022-11-18 16:23:15,189 DEBUG   PV1 power=1230W (1230,)
2022-11-18 16:23:15,190 DEBUG   PV2 power=497W (497,)
2022-11-18 16:23:15,941 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64832] len=2. regs={166: 0, 167: 64832}
2022-11-18 16:23:25,895 ERROR   Timeout reading: 
2022-11-18 16:23:25,959 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64836] len=2. regs={166: 0, 167: 64836}
2022-11-18 16:23:26,008 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:23:26,057 DEBUG   Request registers: [175] glen=1. Response [2010] len=1. regs={175: 2010}
2022-11-18 16:23:26,105 DEBUG   Request registers: [178] glen=1. Response [2010] len=1. regs={178: 2010}
2022-11-18 16:23:26,168 DEBUG   Request registers: [186, 187] glen=2. Response [1226, 500] len=2. regs={186: 1226, 187: 500}
2022-11-18 16:23:26,217 DEBUG   Request registers: [190] glen=1. Response [303] len=1. regs={190: 303}
2022-11-18 16:23:26,218 DEBUG   Battery power=303W (303,)
2022-11-18 16:23:26,218 DEBUG   Inverter power=2010W (2010,)
2022-11-18 16:23:26,218 DEBUG   Load power=2010W (2010,)
2022-11-18 16:23:26,219 DEBUG   Grid power=0W (0,)
2022-11-18 16:23:26,219 DEBUG   PV1 power=1226W (1226,)
2022-11-18 16:23:26,219 DEBUG   PV2 power=500W (500,)
2022-11-18 16:23:26,972 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64836] len=2. regs={166: 0, 167: 64836}
2022-11-18 16:23:27,021 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:23:27,069 DEBUG   Request registers: [175] glen=1. Response [2014] len=1. regs={175: 2014}
2022-11-18 16:23:27,118 DEBUG   Request registers: [178] glen=1. Response [2014] len=1. regs={178: 2014}
2022-11-18 16:23:27,180 DEBUG   Request registers: [186, 187] glen=2. Response [1222, 500] len=2. regs={186: 1222, 187: 500}
2022-11-18 16:23:27,228 DEBUG   Battery power=313W (313,)
2022-11-18 16:23:27,228 DEBUG   Request registers: [190] glen=1. Response [313] len=1. regs={190: 313}
2022-11-18 16:23:27,229 DEBUG   Grid power=0W (0,)
2022-11-18 16:23:27,229 DEBUG   Inverter power=2014W (2014,)
2022-11-18 16:23:27,229 DEBUG   Load power=2014W (2014,)
2022-11-18 16:23:27,229 DEBUG   PV1 power=1222W (1222,)
2022-11-18 16:23:27,229 DEBUG   PV2 power=500W (500,)
2022-11-18 16:23:37,928 ERROR   Timeout reading: 
2022-11-18 16:23:37,986 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64836] len=2. regs={166: 0, 167: 64836}
2022-11-18 16:23:38,035 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}
2022-11-18 16:23:38,082 DEBUG   Request registers: [175] glen=1. Response [1950] len=1. regs={175: 1950}
2022-11-18 16:23:38,130 DEBUG   Request registers: [178] glen=1. Response [1950] len=1. regs={178: 1950}
2022-11-18 16:23:38,192 DEBUG   Request registers: [186, 187] glen=2. Response [1214, 501] len=2. regs={186: 1214, 187: 501}
2022-11-18 16:23:38,241 DEBUG   Battery power=253W (253,)
2022-11-18 16:23:38,241 DEBUG   Inverter power=1950W (1950,)
2022-11-18 16:23:38,241 DEBUG   Request registers: [190] glen=1. Response [253] len=1. regs={190: 253}
2022-11-18 16:23:38,242 DEBUG   Grid power=0W (0,)
2022-11-18 16:23:38,242 DEBUG   Load power=1950W (1950,)
2022-11-18 16:23:38,242 DEBUG   PV1 power=1214W (1214,)
2022-11-18 16:23:38,242 DEBUG   PV2 power=501W (501,)
2022-11-18 16:23:38,243 INFO    PV1 power:step:mean: 1296->1214, 12 samples
2022-11-18 16:23:38,244 DEBUG   PUBLISH 0 SUNSYNK/status/2205094239/pv1_power, 1214
2022-11-18 16:23:38,986 DEBUG   Request registers: [166, 167] glen=2. Response [0, 64840] len=2. regs={166: 0, 167: 64840}
2022-11-18 16:23:39,034 DEBUG   Request registers: [169] glen=1. Response [0] len=1. regs={169: 0}

could not patch umodbus: numpy not found

I see this message when attempting to use this add-on in HA

could not patch umodbus: numpy not found

Should I be concerned? I'm able to connect to the following UK based inverter, SUNSYNK-3.6K-SG01LP1 and get some readings but I'm getting "Timeout" conditions - I'm going to re-do my cabling and see if that fixes it.

Thanks

ModuleNotFoundError: No module named 'pymodbus'

Issue related to

Sunsynk Home Assistant Add-On

Describe the issue/bug

Attempting to start the add on fails with ModuleNotFoundError.

Your environment

  • Home Assistant version: 2022.2.9
  • Addon version: 2022.02.18-0.1.3

Logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Traceback (most recent call last):
  File "/usr/src/app/./run.py", line 17, in <module>
    from pymodbus.exceptions import ModbusIOException  # type: ignore
ModuleNotFoundError: No module named 'pymodbus'
[cmd] ./run.py exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

modbus tcp serial bridge?

I would like to know if it's possible to use a serial bridge with this addon.
Something like using and ESP and a ttl to rs485 converter and a ESPeasy firmware or similar.

I've found this project https://github.com/pawelka/sofarsolar_esp_rs485_logger with similar approach but using firmware for sofar inverter. would like to use a simple bridge to be used.
Some ideas?
Thanks

RS232 instead of RS485?

I'm struggling to get my RS485 dongle to communicate with the inverter, and am contemplating using the RS232 port, by disconnecting the Sunsynk dongle.

#18 (comment) mentions doing something similar, and I just wanted to confirm whether the protocol in use between the dongle and the inverter is indeed modbus, and in particular, which variant of it?

I'm actually contemplating replacing the firmware on the dongle with something custom, possibly ESPHome based, since the dongle is simply an ESP32 with a RS232 interface to the inverter. So if it is as simple as constructing the appropriate ESPHome yaml for the modbus integration, that would be pretty sweet! Then it wouldn't be as big a deal to poll the inverter continuously over Wifi, it would be the dongle driving the polling, and simply reporting changes to HA as necessary, when the values actually change more than whatever threshold you choose.

StandAlone Usage

Hi!

I'm not using HA, I'm interested to run a Modbus -> mqttt bridge, runing on my RPI, besides my inversor.
But I'm not running HA. There is some easy way, to modify the project or some scripts to work like that?

I have no experience with HA add-ons, so when I opened the code it was a mess for me.

Thanks.

Full PV Power Generation

It's possible to get the full PV Power Generation sensor value?

If solar sell disabled, the PV only generate enough power for load + batt charge.

This sensor is useful for people who can't sell power but would like to know if there is an extra power to turn on no crucial devices like pool pump, water heater...

Thank you.

Specified environment_temperature but only getting -100 reading

Issue related to the Python sunsynk library

Describe the issue/bug

Specified environment_temperature but only getting -100 reading

I added the probe that came with my inverter to port 1 and 2 as this diagram:
image

Expected behavior

Get an actual reading

Logs (if applicable)

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-11-15 15:21:17,672 INFO    Loading HASS OS configuration
2022-11-15 15:21:17,685 DEBUG   could not patch umodbus: numpy not found
2022-11-15 15:21:17,689 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import
2022-11-15 15:21:17,689 INFO    Filter *avg used for battery_temperature, battery_voltage, dc_transformer_temperature, environment_temperature, grid_voltage, inverter_voltage, radiator_temperature
2022-11-15 15:21:17,689 INFO    Filter *step used for battery_current, battery_power, essential_power, grid_ct_power, grid_current, grid_frequency, grid_power, inverter_frequency, inverter_power, non_essential_power, overall_state
2022-11-15 15:21:17,689 INFO    Filter *round_robin used for fault
2022-11-15 15:21:17,702 INFO    Reading startup sensors serial, rated_power
2022-11-15 15:21:17,813 INFO    ############################################################
2022-11-15 15:21:17,813 INFO                Inverter serial number 'xxxxxxxxxx'
2022-11-15 15:21:17,813 INFO    ############################################################
2022-11-15 15:21:17,814 INFO    MQTT: Connecting to [email protected]:1883
2022-11-15 15:21:17,821 INFO    MQTT: Connection successful

Inverter Model

Would the code need to be adopted for 8kw unit ? I see you based the code on 5kw unit.

AC on/off status

Hi @kellerza,

Do you maybe know if any of the sensors in definitions.py will map to an AC on/off state, simular to the LED on the front pannel?

Also, is the implementation in definitions.py complete and if not, do you have documentation you can share on the API or are you reverse engineering the protocol?

Thanks,

Dirk

rw sensor not change state in real

Hi
in last revision
I changed the low batt value , we can see the write state chaging but the read state stay the same, so inverter do not take the value.

image

Is it possible to Read/write value from nodeRed to RW sensors?

thanks

Quotation marks not required around inverter S/N

Issue related to

Sunsynk / mbusd Home Assistant Add-On

As per the HA Documentation, I entered the Inverter S/N with quotation marks 'xxxx' as my inverter serial number contains numbers only, however the inverter would not respond until I removed the quotation marks.

Expected behavior
I expected the inverter comms to work if I had quotation marks around the S/N.

Your environment

I am using a Waveshare RS232/485 TO ETH as a modbus rtu - modbus tcp media converter.

  • Home Assistant version: 2022.8.6
  • Addon version: 2022.03.04b-0.1.4
  • Inverter make: Deye
  • Inverter Model: SUN-5K-SG04-LP1-AU
  • Inverter Firmware: Main: 3373-1515 HMI: 0000-C3FC

Logs

Log with SUNSYNK_ID entered with quotation marks

[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-08-22 20:54:57,988 INFO    Loading HASS OS configuration
2022-08-22 20:54:57,995 DEBUG   could not patch umodbus: numpy not found
2022-08-22 20:54:57,997 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-08-22 20:54:57,998 INFO    Filter *avg used for battery_voltage
2022-08-22 20:54:57,998 INFO    Connecting to tcp://192.168.23.61:50002
2022-08-22 20:54:58,061 INFO    ############################################################
2022-08-22 20:54:58,061 INFO                Inverter serial number '2203194152'
2022-08-22 20:54:58,061 INFO    ############################################################
2022-08-22 20:54:58,061 INFO    ############################################################
2022-08-22 20:54:58,062 INFO    SUNSYNK_ID should be set to the serial number of your Inverter!
2022-08-22 20:54:58,062 INFO    ############################################################
2022-08-22 20:54:58,076 INFO    could not close stream: loop closed
[cmd] ./run.py exited 0
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.'''

**Log with SUNSYNK_ID entered as numbers only without quotation marks**

```[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-08-22 20:51:49,176 INFO    Loading HASS OS configuration
2022-08-22 20:51:49,183 DEBUG   could not patch umodbus: numpy not found
2022-08-22 20:51:49,185 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-08-22 20:51:49,186 INFO    Filter *avg used for battery_voltage
2022-08-22 20:51:49,186 INFO    Connecting to tcp://192.168.23.61:50002
2022-08-22 20:51:49,245 INFO    ############################################################
2022-08-22 20:51:49,245 INFO                Inverter serial number '2203194152'
2022-08-22 20:51:49,245 INFO    ############################################################
2022-08-22 20:51:49,245 INFO    MQTT: Connecting to mosquitto@core-mosquitto:1883
2022-08-22 20:51:49,251 INFO    MQTT: Connection successful```


SunSynk Double Inverters

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Describe the issue

I have 2 x SunSynk 8 KW inverters running in parallel, using the Modbus gateway to pass the data to Home Assistant - Works a treat!

The question is how do we handle paralleled inverters? The addon only accepts a single serial number

Compatibility with Sunsynk 12kw 3-phase inverter?

Hi there

I recently had a Sunsynk 12kw 3-phase inverter installed, but I'm a little unsure if this integration works with this model.
I purchased a USB-RS485 cable from Solar-Assistant (https://solar-assistant.io/shop/products/sunsynk_rs485) and tried starting up the integration.

I've tried a few ports on the inverter with no success yet, but I was hoping to sense-check myself here as I don't recall the 3-phase inverter being included in the list of tested inverters.

IMG_1743

My understanding is that the "Meter-485" port could be used for monitoring and also the "BMS" port.

Referencing Solar Assistant, they claim there was a firmware change recently.

The inverter manufacturer released a firmware update which changed the port to read the inverter via RS485. An RJ45 splitter can be used to allow SolarAssistant to read the inverter while the inverter is also reading a battery via CAN.

Is there perhaps something else I may be missing or should try?
If not, I'll try find a splitter and confirm if that makes a difference.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-09-24 08:45:31,191 INFO    Loading HASS OS configuration
2022-09-24 08:45:31,264 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-09-24 08:45:31,273 INFO    Protocol made connection.
2022-09-24 08:45:31,274 INFO    Connected to /dev/ttyUSB0
2022-09-24 08:45:41,286 ERROR   Timeout reading: 
2022-09-24 08:45:41,287 INFO    ############################################################
2022-09-24 08:45:41,287 INFO    No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc
2022-09-24 08:45:41,287 INFO    ############################################################
2022-09-24 08:45:41,288 CRITICAL This Add-On will terminate in 30 seconds, use the Supervisor Watchdog to restart automatically.
[cmd] ./run.py exited 0
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Sensor Unavailable

Sometime, all the sensor became unvailable. What can I do to fix this issue?

Thank you.

This is my setup:

USB RS-845 to Inverter via RJ45 cable 15 meter long.

image
Modbus TCP to Modbus RTU Gateway Add-on

[12:14:07] INFO: Starting mbusd -d -L - -v 2 -p /dev/ttyUSB0 -s 9600 -m 8N1 -P 502
05 Feb 2022 12:14:07 mbusd-0.5.1 started...
05 Feb 2022 12:14:07 tty: trying to open /dev/ttyUSB0 (speed 9600 mode 8N1)
05 Feb 2022 12:14:14 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 12:24:06 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 12:24:19 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 12:27:02 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 12:27:23 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 12:33:55 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 12:34:26 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 12:36:19 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 12:36:31 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 12:41:04 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 12:41:33 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 12:45:18 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 12:45:37 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 13:16:17 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 13:16:22 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 13:32:27 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 13:32:57 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 13:40:01 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 13:40:33 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 13:50:43 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 13:50:59 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 13:56:32 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 13:56:44 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 14:05:50 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 14:06:19 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 14:16:27 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 14:16:52 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 14:17:01 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 14:17:23 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 14:29:44 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 14:29:59 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 14:40:16 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 14:40:33 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 14:42:09 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 14:42:35 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:01:26 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:01:47 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:09:25 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:09:51 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:25:12 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:25:30 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:29:19 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:29:32 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:29:59 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:30:06 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:38:57 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:39:09 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:41:46 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:42:11 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:42:26 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:42:42 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:43:46 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:44:13 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:47:40 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:47:48 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:51:36 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:51:49 conn_open(): accepting connection from 192.168.1.120
05 Feb 2022 15:52:04 conn_close(): closing connection from 192.168.1.120
05 Feb 2022 15:52:20 conn_open(): accepting connection from 192.168.1.120

image
Sunsynk Inverter Add-on

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-02-05 15:52:20,417 INFO    Loading HASS OS configuration
2022-02-05 15:52:20,418 WARNING Your config includes PORT and PORT_ADDRESS. PORT_ADDRESS will be used
2022-02-05 15:52:20,418 INFO    Filter now used for ['day_battery_charge', 'day_battery_discharge', 'grid_voltage', 'inverter_voltage', 'grid_load', 'inverter_output', 'load_power', 'pv1_power', 'pv2_power', 'battery_power', 'battery_charge']
2022-02-05 15:52:20,419 INFO    Filter *step used for ['day_grid_import', 'day_grid_export', 'day_pv_energy']
2022-02-05 15:52:20,435 INFO    Protocol made connection.
2022-02-05 15:52:20,437 INFO    Connected to 192.168.1.120:502.
2022-02-05 15:52:20,581 INFO    ############################################################
2022-02-05 15:52:20,582 INFO                   SMA serial number '2103129246'
2022-02-05 15:52:20,582 INFO    ############################################################
2022-02-05 15:52:20,599 INFO    MQTT: Connection successful

Scale size missing on month energy sensors

hi

Need to add the scalesize for these sensors

add KWH, 0.1), for each sensor

Sensor(67, "Month Grid Energy", KWH, 0.1),
Sensor(66, "Month Load Energy", KWH, 0.1),
Sensor(65, "Month PV Energy", KWH, 0.1),

Wiring Diagram RS485 RJ45

image
image
Hi, I'm trying to connect Home Assistant to Deye inverter using USB-RS485-RJ45 cable.

What the correct way to wire the cable?

Option 1: USB-RS485 A/D+ to RJ45 1 - USB-RS485 B/D1 to RJ45 8
Option 2: USB-RS485 A/D+ to RJ45 8 - USB-RS485 B/D1 to RJ45 1

Thank you.

Sensor "day load energy " and "grid status" not working

Hi

Inverter: deye / 8k eu hybrid/ hmi=c358 main=6014-0717

sensor "day_load_energy" is reported as unknow

i already have a look at closed issue about the grid status sensor but even with filter adjustment" :last" it not working.

Thanks

 Loading HASS OS configuration
2022-07-16 12:57:27,666 INFO    ############################################################
2022-07-16 12:57:27,666 INFO             Unknown sensor in config: day_load_energy
2022-07-16 12:57:27,667 INFO    ############################################################
2022-07-16 12:57:27,667 INFO    ############################################################
2022-07-16 12:57:27,667 INFO        Unknown sensor in config: grid_connected_status:last

Only Some Sensors not reading

Hi There

i have HA installed on a Raspberry Pi 4. I purchased this USB to RS485 and its connected to RS485 on my Sunsynk 8KW Inverter
https://www.robotics.org.za/index.php?route=product/product&product_id=5947

I installed the Add-on mid August and it worked fine even though i kept getting Timeout Errors in the log. A few days ago, i did maintenance on the inverter an shortened and re-crimped the CAT5 Cable running to the USB-RS485

Ever since then, i have been unable to get a reading on Total Grid import sensor. I re-install and redownloaded the addon (which will shows 0.14 by the way) and it still just timeouts with that sensor specifically.

I then added a few other sensors and the other sensors work fine except for Essential and non Essential Loads. So now 3 sensor readings keep timing out

Here is my log output:

2022-09-11 15:55:16,953 INFO Loading HASS OS configuration
2022-09-11 15:55:16,970 DEBUG could not patch umodbus: numpy not found
2022-09-11 15:55:16,975 INFO Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_load_power, total_pv_power
2022-09-11 15:55:16,975 INFO Filter *step used for essential_power, grid_ct_power, grid_ld_power, grid_power, load_power, non_essential_power, pv1_power, pv2_power
2022-09-11 15:55:16,975 INFO Filter *avg used for grid_voltage
2022-09-11 15:55:16,977 INFO Connecting to serial:///dev/ttyUSB0
2022-09-11 15:55:17,073 INFO ############################################################
2022-09-11 15:55:17,073 INFO Inverter serial number '220628xxxx'
2022-09-11 15:55:17,073 INFO ############################################################
2022-09-11 15:55:17,075 INFO MQTT: Connecting to mosquittousr@core-mosquitto:1883
2022-09-11 15:55:17,107 INFO MQTT: Connection successful
2022-09-11 15:55:28,123 ERROR Timeout reading:
2022-09-11 15:55:28,124 INFO Retrying individual sensors: ['Total PV Power:last', 'Total Battery Charge:last', 'Total Battery Discharge:last', 'Total Grid Export:last', 'Battery SOC:last', 'Grid power:step:mean', 'Load power:step:mean', 'PV1 power:step:mean', 'PV2 power:step:mean', 'Total Load Power:last', 'Grid CT power:step:mean', 'Grid LD power:step:mean', 'Grid voltage:mean', 'Essential power:step:mean', 'Non-Essential power:step:mean', 'Total Grid Import:last']
2022-09-11 15:55:39,196 ERROR Timeout reading: Essential power
2022-09-11 15:55:49,232 ERROR Timeout reading: Non-Essential power
2022-09-11 15:55:59,264 ERROR Timeout reading: Total Grid Import
2022-09-11 15:56:09,320 ERROR Timeout reading:
2022-09-11 15:56:19,335 ERROR Timeout reading:
2022-09-11 15:56:29,348 ERROR Timeout reading:
2022-09-11 15:56:39,363 ERROR Timeout reading:
2022-09-11 15:56:49,383 ERROR Timeout reading:
2022-09-11 15:56:59,401 ERROR Timeout reading:
2022-09-11 15:57:09,421 ERROR Timeout reading:

I also tried adding TIMEOUT: 20 to the config file but it still does it in 10sec intervals

Your assistance would be highly appreciated

Thank you

USB to RS485 adapter issues?

Issue related to
[ ] New Sensors / Sensors not working (existing definitions available here)
[x] Sunsynk Home Assistant Add-On
[ ] mbusd Home Assistant Add-On
[ ] Python sunsynk library

Describe the issue/bug
Not so much a bug (necessarily), but I guess a support request.

Recently had a Sunsynk 3.6 kWh inverter installed.

I bought one of https://www.ebay.co.uk/itm/393575748700 "RS485-150U" hoping it would work (being premade), but when starting the addon it seems to timeout.

I don't know if it's due to the wrong pinout on the RJ45 end, but I did try /dev/ttyACM0, /dev/ttyAMA0 and /dev/serial1; all of which failed similarly.

I have plugged it into the BMS485 (top left) port; it seems for a lot of things the 5.5 and 3.6 are similar.

Got a different adapter coming tomorrow from Amazon - https://smile.amazon.co.uk/dp/B06Y1JTGZX which will make it easier to make sure the pinout is right, so this request might be invalid at that point...

Trying to avoid having to shell out for one of https://solar-assistant.io/shop/products/sunsynk_rs485

Happy to try a few other things (and/or doing this outside Home Assistant.. On a vanilla Ubunutu/Raspberry Pi OS/Debian rpi install), such as the library as a standalone if it helps.

Thanks!

Expected behavior
Not crash on startup? :)

Home Assistant version (if applicable)
2022.2.0

Additional context
Add any other context about the problem here.

Logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-02-03 18:20:43,458 INFO    Loading HASS OS configuration
2022-02-03 18:20:43,460 INFO    Filter *last used for ['total_pv_power', 'total_battery_charge', 'total_battery_discharge', 'total_grid_export', 'total_grid_import']
2022-02-03 18:20:43,460 INFO    Filter *step used for ['battery_soc']
2022-02-03 18:20:43,469 INFO    Protocol made connection.
2022-02-03 18:20:43,470 INFO    Connected to /dev/serial1
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 489, in wait_for
    fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/app/./run.py", line 185, in <module>
    LOOP.run_until_complete(main(LOOP))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/src/app/./run.py", line 146, in main
    await SUNSYNK.read([ssdefs.serial])
  File "/usr/local/lib/python3.9/site-packages/sunsynk/sunsynk.py", line 100, in read
    r_r = await self.client.read_holding_registers(grp[0], glen, unit=self.unit)
  File "/usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py", line 35, in execute
    resp = await asyncio.wait_for(req, timeout=self._timeout)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 491, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
[cmd] ./run.py exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Using Deye Inverter

As I know is the same inverter rebranded.
But im getting some errors.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2021-12-11 17:25:11,574 INFO    Loading HASS OS configuration
2021-12-11 17:25:11,577 INFO    Filter *last used for ['total_pv_power', 'total_battery_charge', 'total_battery_discharge', 'total_grid_export', 'total_grid_import']
2021-12-11 17:25:11,578 INFO    Filter *step used for ['battery_soc']
2021-12-11 17:25:11,579 DEBUG   Using selector: EpollSelector
2021-12-11 17:25:11,583 DEBUG   Connecting.
2021-12-11 17:25:11,619 DEBUG   Client connected to modbus server
2021-12-11 17:25:11,619 INFO    Protocol made connection.
2021-12-11 17:25:11,622 INFO    Connected to /dev/ttyUSB0
2021-12-11 17:25:11,623 DEBUG   send: 0x1 0x3 0x0 0x3 0x0 0x5 0x75 0xc9
2021-12-11 17:25:11,626 DEBUG   Adding transaction 1
2021-12-11 17:25:11,709 DEBUG   recv: 0x1 0x3 0xa 0x32 0x31 0x30 0x36 0x32 0x39 0x37 0x30 0x32 0x30 0xa 0x1d 0xff
2021-12-11 17:25:11,711 DEBUG   Getting Frame - 0x3 0xa 0x32 0x31 0x30 0x36 0x32 0x39 0x37 0x30 0x32 0x30
2021-12-11 17:25:11,712 DEBUG   Factory Response[ReadHoldingRegistersResponse: 3]
2021-12-11 17:25:11,714 DEBUG   Frame advanced, resetting header!!
2021-12-11 17:25:11,715 DEBUG   Getting transaction 1
2021-12-11 17:25:11,719 DEBUG   Request registers: [3, 4, 5, 6, 7] glen=5. Response [12849, 12342, 12857, 14128, 12848] len=5. regs={3: 12849, 4: 12342, 5: 12857, 6: 14128, 7: 12848}
2021-12-11 17:25:11,720 INFO    ############################################################
2021-12-11 17:25:11,721 INFO                   SMA serial number '2106297020'
2021-12-11 17:25:11,722 INFO    ############################################################
2021-12-11 17:25:11,749 INFO    MQTT: Connection successful
2021-12-11 17:25:12,235 DEBUG   PUBLISH 1R homeassistant/sensor/2106297020/total_pv_power/config, {"name": "Total PV Power", "stat_t": "SUNSYNK/status/2106297020/total_pv_power", "unit_of_meas": "kWh", "uniq_id": "2106297020_total_pv_power", "dev": {"ids": ["sunsynk_2106297020"], "name": "Sunsynk Inverter 2106297020", "mdl": "Inverter 2106297020", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-11 17:25:12,275 DEBUG   PUBLISH 1R homeassistant/sensor/2106297020/total_battery_charge/config, {"name": "Total Battery Charge", "stat_t": "SUNSYNK/status/2106297020/total_battery_charge", "unit_of_meas": "kWh", "uniq_id": "2106297020_total_battery_charge", "dev": {"ids": ["sunsynk_2106297020"], "name": "Sunsynk Inverter 2106297020", "mdl": "Inverter 2106297020", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-11 17:25:12,283 DEBUG   PUBLISH 1R homeassistant/sensor/2106297020/total_battery_discharge/config, {"name": "Total Battery Discharge", "stat_t": "SUNSYNK/status/2106297020/total_battery_discharge", "unit_of_meas": "kWh", "uniq_id": "2106297020_total_battery_discharge", "dev": {"ids": ["sunsynk_2106297020"], "name": "Sunsynk Inverter 2106297020", "mdl": "Inverter 2106297020", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-11 17:25:12,297 DEBUG   PUBLISH 1R homeassistant/sensor/2106297020/total_grid_export/config, {"name": "Total Grid Export", "stat_t": "SUNSYNK/status/2106297020/total_grid_export", "unit_of_meas": "kWh", "uniq_id": "2106297020_total_grid_export", "dev": {"ids": ["sunsynk_2106297020"], "name": "Sunsynk Inverter 2106297020", "mdl": "Inverter 2106297020", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-11 17:25:12,310 DEBUG   PUBLISH 1R homeassistant/sensor/2106297020/total_grid_import/config, {"name": "Total Grid Import", "stat_t": "SUNSYNK/status/2106297020/total_grid_import", "unit_of_meas": "kWh", "uniq_id": "2106297020_total_grid_import", "dev": {"ids": ["sunsynk_2106297020"], "name": "Sunsynk Inverter 2106297020", "mdl": "Inverter 2106297020", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-11 17:25:12,323 DEBUG   PUBLISH 1R homeassistant/sensor/2106297020/battery_soc/config, {"name": "Battery SOC", "stat_t": "SUNSYNK/status/2106297020/battery_soc", "unit_of_meas": "%", "uniq_id": "2106297020_battery_soc", "dev": {"ids": ["sunsynk_2106297020"], "name": "Sunsynk Inverter 2106297020", "mdl": "Inverter 2106297020", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "battery"}
2021-12-11 17:25:13,343 DEBUG   send: 0x1 0x3 0x0 0x48 0x0 0xb 0x84 0x1b
2021-12-11 17:25:13,350 DEBUG   Adding transaction 1
2021-12-11 17:25:13,441 DEBUG   recv: 0x1 0x3 0x16 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xb 0x0 0x28 0x2 0x3d 0x17 0x6d 0x0 0x0 0x1 0x76 0x0 0x0 0x8a 0x19 0xff
2021-12-11 17:25:13,442 DEBUG   Frame check failed, ignoring!!
2021-12-11 17:25:13,443 DEBUG   Resetting frame - Current Frame in buffer - 0xff 0x1 0x3 0x16 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xb 0x0 0x28 0x2 0x3d 0x17 0x6d 0x0 0x0 0x1 0x76 0x0 0x0 0x8a 0x19 0xff
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 489, in wait_for
    fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/app/./run.py", line 214, in <module>
    LOOP.run_until_complete(main(LOOP))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/src/app/./run.py", line 185, in main
    await SUNSYNK.read([f.sensor for f in SENSORS])
  File "/usr/local/lib/python3.9/site-packages/sunsynk/sunsynk.py", line 100, in read
    r_r = await self.client.read_holding_registers(
  File "/usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py", line 35, in execute
    resp = await asyncio.wait_for(req, timeout=self._timeout)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 491, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
[cmd] ./run.py exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

MQTT / mbusd gateway via Tasmota?

Question related to
Sunsynk / mbusd Home Assistant Add-On

Describe the issue
Hi KellerZA

I'm thinking of trying to replace my PI with an ESP device - It would be great and have loads of benefits. I considered trying to write my own code, but thought why re-invent the wheel? Did a quick google to see if Tasmota would be able to do something out of the box and I stumbled across these:

TCP Gateway - arendst/Tasmota#9586
MQTT Gateway - arendst/Tasmota#15703

I think they might have potential but honestly, don’t know where to begin. I don't have enough understanding of modbus, your addon, etc. (yet) to know if it's feasable. Think you can give them a quick once over?

If your verdict is that they have potential I'm happy to put in the time to see if we can add another deployment option.

I can't start dev addon

Issue related to

Sunsynk / Home Assistant (dev) Add-On

When I try to start the addon it returns the following error

Device '/dev/ttyUSB0' does not exist in Sunsynk Inverter Add-on (dev) (4bb530c7_hass-addon-sunsynk-dev).

I try to delete device entry on yaml, but it always appears again.

If I try to save the yaml with device variable

Failed to save add-on configuration, Device '/dev/ttyUSB0' does not exist in Sunsynk Inverter Add-on (dev) (4bb530c7_hass-addon-sunsynk-dev). Got {'PORT': 'tcp://192.168.1.141:502', 'DEVICE': '/dev/ttyUSB0', 'DRIVER': 'umodbus', 'SUNSYNK_ID': '201210xxx', 'SENSOR_PREFIX': '', 'SENSORS': ['pv1_power', 'grid_power', 'load_power', 'dc_transformer_temperature', 'radiator_temperature', 'battery_power', 'total_active_power', 'total_pv_power', 'total_battery_charge', 'total_battery_discharge', 'total_grid_export', 'total_grid_import', 'battery_soc', 'device_type', 'pv1_current', 'pv1_voltage', 'grid_connected_status'], 'READ_SENSORS_BATCH_SI...

I don't have any ttyUSB connected to the server where HA is.

Sensor Listing for Dummy - Not an issue

Hi @kellerza

First of all... Thanks for the integration.

Been using an outdated version for a while now. I finally updated it and got it working perfectly again. Just one question...
The old version's documentation had a link to a list of sensors to enter in your config file such as - sensor.pv1_power or sensor.battery_soc and so on. I just took what I needed from there and included it in my config page.
The new link shows sensor definitions but I'm not yet clever enough to make sense of it. How can I get a simple list of sensors or a line to include all sensors?

Thanks again for the help.

example

Read Errors: USR-W630

Thanks for this great add-on!
I am using it with Deye SUN-3.6/5K-SG03LP1-EU and a USR-630.

When I restart the add-on, it does get the first set of values from the USR-630, however shortly afterwards, an error occurs and the add-on goes into a bad state and does not recover. Below is an extract from the logs. Any idea what write function it is trying to call? I am only trying to read sensor data, not write anything.

Relevant config:

PORT: ''
PORT_ADDRESS: 10.0.1.66:8899
PROFILES: 0
SUNSYNK_ID: 'XXXXXX'
SENSORS:
  - battery_soc
  - grid_load
  - grid_ct_load
  - inverter_output
  - load_power
  - pv1_power
  - pv2_power
  - battery_power
  - battery_current
  - battery_voltage

Log:

2022-02-10 21:22:05,449 DEBUG   Inverter Output low=65521 high=0 value=-16W
2022-02-10 21:22:05,450 DEBUG   Load Power low=1596 high=0 value=1597W
2022-02-10 21:22:05,450 DEBUG   send: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xb7 0x0 0x9
2022-02-10 21:22:05,451 DEBUG   Adding transaction 5
2022-02-10 21:22:06,136 DEBUG   recv: 0x0 0x5 0x0 0x0 0x0 0xe 0x1 0x3 0x12 0x13 0x85 0x0 0x51 0x6 0x34 0x0 0x0 0x0 0x2 0x0
2022-02-10 21:22:06,136 DEBUG   Processing: 0x0 0x5 0x0 0x0 0x0 0xe 0x1 0x3 0x12 0x13 0x85 0x0 0x51 0x6 0x34 0x0 0x0 0x0 0x2 0x0
2022-02-10 21:22:06,137 DEBUG   Factory Response[ReadHoldingRegistersResponse: 3]
2022-02-10 21:22:06,138 ERROR   unpack requires a buffer of 2 bytes
2022-02-10 21:22:06,138 ERROR   Fatal error: protocol.data_received() call failed.
handle_traceback: Handle created at (most recent call last):
  File "/usr/src/app/./run.py", line 236, in <module>
    LOOP.run_until_complete(main(LOOP))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 629, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 596, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1882, in _run_once
    handle._run()
  File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 754, in _add_reader
    self._loop._add_reader(fd, callback, *args)
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 259, in _add_reader
    handle = events.Handle(callback, args, self, None)
protocol: <pymodbus.client.asynchronous.async_io.ModbusClientProtocol object at 0x7f2207c44f10>
transport: <_SelectorSocketTransport fd=8 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 870, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py", line 204, in data_received
    self._dataReceived(data)
  File "/usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py", line 151, in _dataReceived
    self.framer.processIncomingPacket(data, self._handleResponse, unit=unit)
  File "/usr/local/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "/usr/local/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2022-02-10 21:22:06,142 DEBUG   Client disconnected from modbus server: Modbus Error: [Input/Output] Unable to decode request
2022-02-10 21:22:06,143 DEBUG   Getting transaction 5
2022-02-10 21:22:06,145 INFO    Protocol lost connection.
2022-02-10 21:22:06,151 ERROR   Read Error: Modbus Error: [Connection] Connection lost during request
2022-02-10 21:22:06,154 DEBUG   send: 0x0 0x6 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:06,155 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:07,166 DEBUG   send: 0x0 0x7 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:07,173 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:08,170 DEBUG   send: 0x0 0x8 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:08,178 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:09,174 DEBUG   send: 0x0 0x9 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:09,176 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:10,178 DEBUG   send: 0x0 0xa 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:10,182 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:11,182 DEBUG   send: 0x0 0xb 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:11,184 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:12,187 DEBUG   send: 0x0 0xc 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:12,187 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:13,193 DEBUG   send: 0x0 0xd 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:13,194 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:14,194 DEBUG   send: 0x0 0xe 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:14,195 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:15,198 DEBUG   send: 0x0 0xf 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:15,199 ERROR   Read Error: 'NoneType' object has no attribute 'write'
2022-02-10 21:22:16,202 DEBUG   send: 0x0 0x10 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0xa9 0x0 0xa
2022-02-10 21:22:16,206 ERROR   Read Error: 'NoneType' object has no attribute 'write'

Suggested filter for RWSensors should be round_robin

Issue related to

Sunsynk Home Assistant Dev Add-On

Describe the issue/bug

Currently if the user adds a sensor and does not explicitly choose a filter, the same set of filters get applied to read-only and writable sensors through the suggested_filter function. For example, for RW voltage sensors, an avg filter is used, which results in odd behaviour when the value is changed either on the inverter side or in the add-on itself in that when there is a change, the sensor value will gradually increase (with several decimal places) towards the new value but these intermediate average values are undesirable.

Expected behavior
It is proposed that the suggested filter for all RW sensors is now or last. I cannot think of a use case for a RW sensor where the filter should be different. Would there be any undesirable consequences of using the now or last filters for all RW sensors?

If there is agreement on the above, I will put up a PR.

Current implementation:

def suggested_filter(sensor: Sensor) -> str:
    """Default filters."""
    if sensor.id.startswith("prog"):
        return "round_robin"
    f_id = {
        "battery_soc": "last",
        "fault": "round_robin",
        "grid_connected_status": "last",
        "overall_state": "step",
        "priority_mode": "round_robin",
        "sd_status": "step",
        "serial": "round_robin",
    }
    assert all(s in ALL_SENSORS for s in f_id)

    f_unit = {
        AMPS: "step",
        VOLT: "avg",
        WATT: "step",
        KWH: "last",
        CELSIUS: "avg",
    }
    res = f_id.get(sensor.id) or f_unit.get(sensor.unit) or "step"
    _LOGGER.debug("%s unit:%s, id:%s", res, sensor.unit, sensor.id)
    return res

Proposed change:

def suggested_filter(sensor: Sensor) -> str:
    """Default filters."""
    if isinstance(sensor, RWSensor):
        return "now" # or "last"
    f_id = {
        "battery_soc": "last",
        "fault": "round_robin",
        "grid_connected_status": "last",
        "overall_state": "step",
        "sd_status": "step",
        "serial": "round_robin",
    }
    assert all(s in ALL_SENSORS for s in f_id)

    f_unit = {
        AMPS: "step",
        VOLT: "avg",
        WATT: "step",
        KWH: "last",
        CELSIUS: "avg",
    }
    res = f_id.get(sensor.id) or f_unit.get(sensor.unit) or "step"
    _LOGGER.debug("%s unit:%s, id:%s", res, sensor.unit, sensor.id)
    return res

Sunsynk Docker

I LOVE this addon. The only downside is it require Home Assistant Supervised installation. On my Synology it mean you have install a virtual machine which is resource consuming.

It's possible to run this via Docker Container?

Thank you.

Essential Power reading issue

So not really a bug but an issue depending on how you use your AUX port

I use it as a generator input and when the generator is running the Essential Power goes into the negative
If it is being used as a non-essential load then the readon would be correct

Graph from yesterdays loadshedding when the generator kicked in

Capture

ValueError: unsupported scheme '' for /dev/ttyUSB0

Issue related to the Python sunsynk library

ValueError: unsupported scheme '' for /dev/ttyUSB0

Describe the issue/bug

when i start the plugin I get this error listed below.

File "/usr/local/lib/python3.9/site-packages/connio/init.py", line 21, in connection_for_url
raise ValueError("unsupported scheme {!r} for {}".format(scheme, url))
ValueError: unsupported scheme '' for /dev/ttyUSB0
A clear and concise description of what the bug is.

Expected behavior

expect the plugin to start.
A clear and concise description of what you expected to happen.
expect the plugin to start and run

Logs (if applicable)

image

paste logs in 3x backticks...

Sunsynk Data Reading issues

I am experiencing the same issues as described in this ticket:
#33

I have tried removing the termination resistor however the issue still persists. Could the problem be due to trying to run both the Sunsynk dongle and this addon?
I cannot get a clear answer on this

Unable to read sensor data

Hi

I am able to connect to the inverter as I can read the serial number on initial connection but it fails to read any sensor data. I have enabled debug logging and the results are below. Please advise on how to fix

2021-12-21 11:09:15,707 INFO    Loading HASS OS configuration
2021-12-21 11:09:15,709 INFO    Filter *last used for ['total_pv_power', 'total_battery_charge', 'total_battery_discharge', 'total_grid_export', 'total_grid_import']
2021-12-21 11:09:15,709 INFO    Filter *step used for ['battery_soc']
2021-12-21 11:09:15,710 INFO    Filter last used for ['grid_ct_load', 'inverter_output', 'load_power']
2021-12-21 11:09:15,711 DEBUG   Using selector: EpollSelector
2021-12-21 11:09:15,714 DEBUG   Connecting.
2021-12-21 11:09:15,752 DEBUG   Client connected to modbus server
2021-12-21 11:09:15,753 INFO    Protocol made connection.
2021-12-21 11:09:15,755 INFO    Connected to /dev/ttyUSB0
2021-12-21 11:09:15,756 DEBUG   send: 0x1 0x3 0x0 0x3 0x0 0x5 0x75 0xc9
2021-12-21 11:09:15,758 DEBUG   Adding transaction 1
2021-12-21 11:09:15,821 DEBUG   recv: 0x1 0x3 0xa 0x32 0x31 0x30 0x36 0x32 0x39 0x37 0x32 0x32 0x38 0xaa 0x1b 0xff
2021-12-21 11:09:15,822 DEBUG   Getting Frame - 0x3 0xa 0x32 0x31 0x30 0x36 0x32 0x39 0x37 0x32 0x32 0x38
2021-12-21 11:09:15,822 DEBUG   Factory Response[ReadHoldingRegistersResponse: 3]
2021-12-21 11:09:15,823 DEBUG   Frame advanced, resetting header!!
2021-12-21 11:09:15,824 DEBUG   Getting transaction 1
2021-12-21 11:09:15,826 DEBUG   Request registers: [3, 4, 5, 6, 7] glen=5. Response [12849, 12342, 12857, 14130, 12856] len=5. regs={3: 12849, 4: 12342, 5: 12857, 6: 14130, 7: 12856}
2021-12-21 11:09:15,827 INFO    ############################################################
2021-12-21 11:09:15,827 INFO                   SMA serial number '2106297228'
2021-12-21 11:09:15,828 INFO    ############################################################
2021-12-21 11:09:15,864 INFO    MQTT: Connection successful
2021-12-21 11:09:16,334 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/total_pv_power/config, {"name": "Total PV Power", "stat_t": "SUNSYNK/status/2106297228/total_pv_power", "unit_of_meas": "kWh", "uniq_id": "2106297228_total_pv_power", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-21 11:09:16,357 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/total_battery_charge/config, {"name": "Total Battery Charge", "stat_t": "SUNSYNK/status/2106297228/total_battery_charge", "unit_of_meas": "kWh", "uniq_id": "2106297228_total_battery_charge", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-21 11:09:16,362 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/total_battery_discharge/config, {"name": "Total Battery Discharge", "stat_t": "SUNSYNK/status/2106297228/total_battery_discharge", "unit_of_meas": "kWh", "uniq_id": "2106297228_total_battery_discharge", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-21 11:09:16,367 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/total_grid_export/config, {"name": "Total Grid Export", "stat_t": "SUNSYNK/status/2106297228/total_grid_export", "unit_of_meas": "kWh", "uniq_id": "2106297228_total_grid_export", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-21 11:09:16,372 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/total_grid_import/config, {"name": "Total Grid Import", "stat_t": "SUNSYNK/status/2106297228/total_grid_import", "unit_of_meas": "kWh", "uniq_id": "2106297228_total_grid_import", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "energy", "stat_cla": "total_increasing"}
2021-12-21 11:09:16,378 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/battery_soc/config, {"name": "Battery SOC", "stat_t": "SUNSYNK/status/2106297228/battery_soc", "unit_of_meas": "%", "uniq_id": "2106297228_battery_soc", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "battery"}
2021-12-21 11:09:16,383 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/grid_ct_load/config, {"name": "Grid CT load", "stat_t": "SUNSYNK/status/2106297228/grid_ct_load", "unit_of_meas": "W", "uniq_id": "2106297228_grid_ct_load", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "power"}
2021-12-21 11:09:16,388 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/inverter_output/config, {"name": "Inverter Output", "stat_t": "SUNSYNK/status/2106297228/inverter_output", "unit_of_meas": "W", "uniq_id": "2106297228_inverter_output", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "power"}
2021-12-21 11:09:16,393 DEBUG   PUBLISH 1R homeassistant/sensor/2106297228/load_power/config, {"name": "Load Power", "stat_t": "SUNSYNK/status/2106297228/load_power", "unit_of_meas": "W", "uniq_id": "2106297228_load_power", "dev": {"ids": ["sunsynk_2106297228"], "name": "Sunsynk Inverter 2106297228", "mdl": "Inverter 2106297228", "mf": "Sunsynk"}, "exp_aft": 301, "dev_cla": "power"}
2021-12-21 11:09:17,402 DEBUG   send: 0x1 0x3 0x0 0x48 0x0 0xb 0x84 0x1b
2021-12-21 11:09:17,407 DEBUG   Adding transaction 1
2021-12-21 11:09:17,472 DEBUG   recv: 0x1 0x3 0x16 0x0 0x14 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x27 0x0 0x0 0x2 0xbf 0x13 0x89 0x0 0x0 0x0 0x5 0x0 0x0 0x1f 0x7c
2021-12-21 11:09:17,474 DEBUG   Frame check failed, ignoring!!
2021-12-21 11:09:17,475 DEBUG   Resetting frame - Current Frame in buffer - 0xff 0x1 0x3 0x16 0x0 0x14 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x27 0x0 0x0 0x2 0xbf 0x13 0x89 0x0 0x0 0x0 0x5 0x0 0x0 0x1f 0x7c
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 489, in wait_for
    fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/app/./run.py", line 214, in <module>
    LOOP.run_until_complete(main(LOOP))
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/src/app/./run.py", line 185, in main
    await SUNSYNK.read([f.sensor for f in SENSORS])
  File "/usr/local/lib/python3.9/site-packages/sunsynk/sunsynk.py", line 100, in read
    r_r = await self.client.read_holding_registers(
  File "/usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py", line 35, in execute
    resp = await asyncio.wait_for(req, timeout=self._timeout)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 491, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
[cmd] ./run.py exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

Connect via Node RED but not via HA Add-On

I can connect to my Sunsynk 8kW inverter via Node RED in HA, but the Add-On show no response from Modbus Interface.
I am using this USB-2-RS485 Converter

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-12-10 19:25:20,552 INFO Loading HASS OS configuration
2022-12-10 19:25:20,574 DEBUG could not patch umodbus: numpy not found
2022-12-10 19:25:20,582 INFO ############################################################
2022-12-10 19:25:20,582 INFO Sensor deprecated: total_pv_power -> total_pv_energy
2022-12-10 19:25:20,583 INFO ############################################################
2022-12-10 19:25:20,584 DEBUG last unit:kWh, id:total_pv_power
2022-12-10 19:25:20,585 DEBUG last unit:kWh, id:total_battery_charge
2022-12-10 19:25:20,586 DEBUG last unit:kWh, id:total_battery_discharge
2022-12-10 19:25:20,586 DEBUG last unit:kWh, id:total_grid_export
2022-12-10 19:25:20,587 DEBUG last unit:kWh, id:total_grid_import
2022-12-10 19:25:20,588 DEBUG last unit:%, id:battery_soc
2022-12-10 19:25:20,589 INFO Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-12-10 19:25:20,591 DEBUG Using selector: EpollSelector
2022-12-10 19:25:20,614 INFO Reading startup sensors rated_power, serial
2022-12-10 19:25:20,696 ERROR Read Error: (1,3,5) 50
2022-12-10 19:25:20,696 INFO ############################################################
2022-12-10 19:25:20,696 INFO No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc
2022-12-10 19:25:20,696 INFO ############################################################
2022-12-10 19:25:20,696 CRITICAL This Add-On will terminate in 30 seconds, use the Supervisor Watchdog to restart automatically.

Config is as follow:

image

I presume i am doing something stupid here...
Any idea what i am doing wrong?

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.