Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

AddOn connects but after a few minutes it does not send data because it says it is not connected #395

Open
lukeansell opened this issue Jan 16, 2025 · 0 comments

Comments

@lukeansell
Copy link

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Question

Would you like the logs from running in debug mode?

Describe the issue/bug

Connects to inverter after startup but after a few minutes it is unable to connect. I have had it set up and working correctly for a few months. It was failing to run for a few days before I noticed the problem. Sometimes it will report values for total_grid_import, total_grid_export and total_pv_energy. These will come once a day and be higher than expected by and order of magnitude. I do believe I started have problems since I updated the AddOn but I am not sure.

Expected behavior
The AddOn to keep the connection and report the data correctly.

Your environment

  • Home Assistant version: 2025.1.x
  • Addon:
    • Name: sunsynk-multi
    • Version: 2025-01-11
  • Inverter:
    • Make: Sunsynk
    • Model: 8.0 kW Single Phase LV Hybrid
  • Adaptor details:
    • RS485 TCP/IP gateway

You configuration

DRIVER: pymodbus
INVERTERS:
  - SERIAL_NR: "*******327"
    HA_PREFIX: SS
    MODBUS_ID: 1
    PORT: tcp://192.168.1.52:502
SENSOR_DEFINITIONS: single-phase
SENSORS:
  - energy_management
  - power_flow_card
  - pv2_power
  - battery_temperature
  - pv2_voltage
  - pv2_current
  - fault
  - solar_export
  - settings
  - load_limit
SENSORS_FIRST_INVERTER: []
MANUFACTURER: Sunsynk
READ_ALLOW_GAP: 2
READ_SENSORS_BATCH_SIZE: 6
SCHEDULES:
  - KEY: W
    READ_EVERY: 5
    REPORT_EVERY: 60
    CHANGE_ANY: false
    CHANGE_BY: 80
    CHANGE_PERCENT: 0
NUMBER_ENTITY_MODE: auto
PROG_TIME_INTERVAL: 15
MQTT_HOST: 192.168.1.99
MQTT_PORT: 1883
MQTT_USERNAME: ha
MQTT_PASSWORD: *password*
DEBUG: 0
DEBUG_DEVICE: /dev/ttyS0

Logs


s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun sunsynk (no readiness notification)
s6-rc: info: service legacy-services successfully started
17:24:17 INFO    Loading config: /data/options.json
17:24:17 INFO    sunsynk library version: 0.8.2
17:24:17 INFO    Schedules:
+-----------+-----+------+--------+-----------+----------+------------+
|    Key    | src | Read | Report | Change by | Change % | Change any |
+-----------+-----+------+--------+-----------+----------+------------+
| date_time |     |  60  |   60   |           |          |    True    |
|     rw    |     |  5   |  300   |           |          |    True    |
|    enum   |     |  5   |  300   |           |          |    True    |
|     w     |  *  |  5   |   60   |    80.0   |          |            |
|    kwh    |     | 300  |  300   |           |          |            |
|  any_unit |     |  15  |  300   |           |          |            |
|  no_unit  |     |  15  |  300   |           |          |    True    |
+-----------+-----+------+--------+-----------+----------+------------+
17:24:17 INFO    Using Single phase sensor definitions.
17:24:17 INFO    Added hidden sensors as other sensors depend on it: Device type, Protocol, Serial, Rated power
17:24:17 INFO    Connecting to tcp://192.168.1.52:502
17:24:17 INFO    PyModbus 3.8.3 tcp: 192.168.1.52:502
17:24:17 INFO    Reading startup sensors Device type, Protocol, Serial
17:24:18 INFO    ############################################################
17:24:18 INFO                 Inverter serial number '****7327'
17:24:18 INFO    ############################################################
17:24:18 INFO    Device type: Single phase hybrid, using the single-phase sensor definitions
17:24:18 INFO    Protocol version: 2.1
17:24:18 INFO    Reading all sensors Device type, Protocol, Serial, PV2 power, Battery temperature, PV2 voltage, PV2 current, Fault, Solar Export, Load Limit, Prog1 Capacity, Prog1 charge, Prog1 power, Prog1 Time, Prog2 Capacity, Prog2 charge, Prog2 power, Prog2 Time, Prog3 Capacity, Prog3 charge, Prog3 power, Prog3 Time, Prog4 Capacity, Prog4 charge, Prog4 power, Prog4 Time, Prog5 Capacity, Prog5 charge, Prog5 power, Prog5 Time, Prog6 Capacity, Prog6 charge, Prog6 power, Prog6 Time, Date Time, Grid Charge Battery current, Grid Charge enabled, Use Timer, Battery Max Charge current, Battery Max Discharge current, Battery Shutdown Capacity, Battery Restart Capacity, Battery Low Capacity, Total Battery Charge, Total Battery Discharge, Total Grid Export, Total Grid Import, Total PV Energy, AUX power, Battery current, Battery power, Battery SOC, Battery voltage, Day Battery Charge, Day Battery Discharge, Day Grid Export, Day Grid Import, Day Load Energy, Day PV Energy, Essential power, Grid Connected, Grid CT power, Grid frequency, Grid L2 power, Grid power, Grid voltage, Inverter current, Inverter power, Load frequency, Load power, Load L1 power, Load L2 power, Non-Essential power, Overall state, Priority Load, PV1 current, PV1 power, PV1 voltage, Rated power
17:24:36 INFO    MQTT: Connecting to [email protected]:1883
17:24:36 INFO    MQTT: Connection successful
17:24:37 INFO    Read every (inverter 1)
+-----+---------------------------------------------------------------------------------+
|  s  |                                     Sensors                                     |
+-----+---------------------------------------------------------------------------------+
|  5  |   grid_charge_battery_current, grid_l2_power, non_essential_power, prog1_time,  |
|     |         prog3_power, load_limit, prog5_time, prog2_capacity, grid_power,        |
|     |  battery_max_charge_current, device_type, prog6_power, prog4_power, prog4_time, |
|     |      prog2_power, pv1_power, prog4_charge, essential_power, grid_ct_power,      |
|     |   prog5_charge, prog1_power, use_timer, pv2_power, battery_shutdown_capacity,   |
|     |             prog6_capacity, prog2_time, prog5_capacity, prog6_time,             |
|     | battery_restart_capacity, prog3_charge, prog2_charge, aux_power, load_l2_power, |
|     |  inverter_power, prog3_time, grid_charge_enabled, solar_export, priority_load,  |
|     |  rated_power, battery_low_capacity, prog1_capacity, battery_power, prog5_power, |
|     |              load_power, load_l1_power, prog1_charge, prog6_charge,             |
|     |          battery_max_discharge_current, prog4_capacity, prog3_capacity          |
|  15 |     grid_voltage, serial, pv2_voltage, battery_soc, overall_state, protocol,    |
|     |       grid_frequency, load_frequency, pv2_current, battery_voltage, fault,      |
|     |   battery_current, pv1_voltage, pv1_current, grid_connected, inverter_current,  |
|     |                               battery_temperature                               |
|  60 |                                    date_time                                    |
| 300 |  total_battery_discharge, day_grid_export, day_battery_charge, day_grid_import, |
|     |    day_load_energy, day_pv_energy, total_grid_import, day_battery_discharge,    |
|     |             total_pv_energy, total_grid_export, total_battery_charge            |
+-----+---------------------------------------------------------------------------------+
17:24:37 INFO    Report every (inverter 1)
+-----+----------------------------------------------------------------------------------+
|  s  |                                     Sensors                                      |
+-----+----------------------------------------------------------------------------------+
|  60 |     pv2_power, grid_l2_power, non_essential_power, battery_power, pv1_power,     |
|     | essential_power, load_power, load_l1_power, date_time, grid_ct_power, aux_power, |
|     |                    load_l2_power, grid_power, inverter_power                     |
| 300 |    grid_charge_battery_current, day_battery_charge, prog1_time, prog3_power,     |
|     |    load_limit, prog5_time, prog2_capacity, total_grid_import, load_frequency,    |
|     |   total_pv_energy, pv1_voltage, total_grid_export, battery_max_charge_current,   |
|     |     prog6_power, grid_connected, prog4_power, day_grid_export, grid_voltage,     |
|     |    pv2_voltage, prog4_time, prog2_power, prog4_charge, day_battery_discharge,    |
|     |  battery_current, prog5_charge, pv1_current, prog1_power, battery_temperature,   |
|     |  use_timer, battery_shutdown_capacity, battery_soc, prog6_capacity, prog2_time,  |
|     |       prog5_capacity, prog6_time, battery_restart_capacity, day_pv_energy,       |
|     |   grid_frequency, prog3_charge, prog2_charge, prog3_time, grid_charge_enabled,   |
|     |     inverter_current, solar_export, total_battery_discharge, priority_load,      |
|     |       battery_low_capacity, prog1_capacity, day_grid_import, prog5_power,        |
|     | overall_state, day_load_energy, pv2_current, prog1_charge, prog6_charge, fault,  |
|     | battery_voltage, battery_max_discharge_current, prog4_capacity, prog3_capacity,  |
|     |                               total_battery_charge                               |
+-----+----------------------------------------------------------------------------------+
17:39:10 ERROR   Cancel send, because not connected!
17:39:40 ERROR   Cancel send, because not connected!
17:43:39 ERROR   Cancel send, because not connected!
17:43:43 ERROR   Cancel send, because not connected!
17:44:07 ERROR   OSError in callback read_ss: timeout reading 2 registers from 6 poll_need_to_read
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/ha_addon_sunsynk_multi/timer_callback.py", line 81, in wrap_callback
    await cb_call
  File "/usr/local/lib/python3.12/site-packages/ha_addon_sunsynk_multi/sensor_callback.py", line 110, in callback_sensor
    await ist.read_sensors(
  File "/usr/local/lib/python3.12/site-packages/ha_addon_sunsynk_multi/a_inverter.py", line 55, in read_sensors
    await self.inv.read_sensors(sensors)
  File "/usr/local/lib/python3.12/site-packages/sunsynk/sunsynk.py", line 134, in read_sensors
    raise IOError("; ".join(errs))
OSError: timeout reading 2 registers from 6 poll_need_to_read
17:46:56 ERROR   Cancel send, because not connected!
17:47:01 ERROR   Cancel send, because not connected!
17:47:08 ERROR   OSError in callback read_ss: timeout reading 3 registers from 230 poll_need_to_read
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/ha_addon_sunsynk_multi/timer_callback.py", line 81, in wrap_callback
    await cb_call
  File "/usr/local/lib/python3.12/site-packages/ha_addon_sunsynk_multi/sensor_callback.py", line 110, in callback_sensor
    await ist.read_sensors(
  File "/usr/local/lib/python3.12/site-packages/ha_addon_sunsynk_multi/a_inverter.py", line 55, in read_sensors
    await self.inv.read_sensors(sensors)
  File "/usr/local/lib/python3.12/site-packages/sunsynk/sunsynk.py", line 134, in read_sensors
    raise IOError("; ".join(errs))
OSError: timeout reading 3 registers from 230 poll_need_to_read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant