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

Error when tyring to update Grid_Peak_Shaving #301

Open
cods4 opened this issue Jun 23, 2024 · 2 comments
Open

Error when tyring to update Grid_Peak_Shaving #301

cods4 opened this issue Jun 23, 2024 · 2 comments

Comments

@cods4
Copy link

cods4 commented Jun 23, 2024

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Describe the issue/bug

I think this has started occuring since the most recent commits on the 19th of June.

Trying to change 'Grid_Peak_Shaving' no longer works. I get an error in the log:
TypeError in read_inv1: sunsynk.rwsensors.RWSensor.reg() argument after * must be an iterable, not int

Along with some other errors which I think are new.
See attached screenshot.
SUNSYNK_Screenshot_20240622-232127

Your environment

  • Home Assistant version: 2024.6.3
  • Addon:
    • Name: sunsynk-edge/dev
    • Version: dae73f8
  • Inverter:
    • Make: Deye
    • Model: __
    • Firmware: __
  • Adaptor details:
    • mbusd

You configuration

DRIVER: umodbus
INVERTERS:
  - SERIAL_NR: "1234"
    HA_PREFIX: INV1
    MODBUS_ID: 1
    PORT: tcp://192.168.23.17:50001
  - SERIAL_NR: "1234"
    HA_PREFIX: INV2
    MODBUS_ID: 1
    PORT: tcp://192.168.23.17:50002
  - SERIAL_NR: "1234"
    HA_PREFIX: INV3
    MODBUS_ID: 1
    PORT: tcp://192.168.23.17:50003
SENSOR_DEFINITIONS: single-phase
SENSORS:
  - battery_power
  - battery_current
  - inverter_power
  - inverter_voltage
  - inverter_current
  - inverter_frequency
  - grid_frequency
  - grid_power
  - grid_ld_power
  - grid_voltage
  - grid_current
  - grid_ct_power
  - load_power
  - load_frequency
  - pv1_power
  - pv1_voltage
  - pv1_current
  - pv2_power
  - pv2_voltage
  - pv2_current
  - essential_power
  - essential_1_power
  - essential_2_power
  - non_essential_power
  - total_active_energy
  - total_battery_charge
  - total_battery_discharge
  - total_grid_export
  - total_grid_import
  - total_load_energy
  - total_pv_energy
  - fault
  - overall_status
  - dc_transformer_temperature
  - radiator_temperature
  - grid_connected
  - date_time
  - control_mode
SENSORS_FIRST_INVERTER:
  - battery_temperature
  - battery_voltage
  - battery_soc
  - battery_charge_limit_current
  - battery_discharge_limit_current
  - grid_charge_enabled
  - battery_low_capacity
  - battery_shutdown_capacity
  - battery_restart_capacity
  - priority_load
  - load_limit
  - solar_export
  - use_timer
  - prog1_time
  - prog2_time
  - prog3_time
  - prog4_time
  - prog5_time
  - prog6_time
  - prog1_power
  - prog2_power
  - prog3_power
  - prog4_power
  - prog5_power
  - prog6_power
  - prog1_capacity
  - prog2_capacity
  - prog3_capacity
  - prog4_capacity
  - prog5_capacity
  - prog6_capacity
  - prog1_charge
  - prog2_charge
  - prog3_charge
  - prog4_charge
  - prog5_charge
  - prog6_charge
  - prog1_mode
  - prog2_mode
  - prog3_mode
  - prog4_mode
  - prog5_mode
  - prog6_mode
  - grid_charge_battery_current
  - battery_max_charge_current
  - battery_max_discharge_current
  - pv_curve_enable
  - limiter_function_enable
  - limit_grid_output_power
  - export_control
  - gen_peak_shaving
  - grid_peak_shaving
  - drm
MANUFACTURER: Deye
READ_ALLOW_GAP: 5
READ_SENSORS_BATCH_SIZE: 100
SCHEDULES:
  - KEY: W
    READ_EVERY: 5
    REPORT_EVERY: 60
    CHANGE_ANY: false
    CHANGE_BY: 100
    CHANGE_PERCENT: 0
  - KEY: kWh
    READ_EVERY: 30
    REPORT_EVERY: 60
    CHANGE_ANY: false
    CHANGE_BY: 0
    CHANGE_PERCENT: 0
  - KEY: A
    READ_EVERY: 10
    REPORT_EVERY: 60
    CHANGE_ANY: false
    CHANGE_BY: 1
    CHANGE_PERCENT: 0
  - KEY: V
    READ_EVERY: 10
    REPORT_EVERY: 60
    CHANGE_ANY: false
    CHANGE_BY: 0
    CHANGE_PERCENT: 0
NUMBER_ENTITY_MODE: auto
PROG_TIME_INTERVAL: 15
MQTT_HOST: host
MQTT_PORT: 1883
MQTT_USERNAME: un
MQTT_PASSWORD: pw
DEBUG: 0
DEBUG_DEVICE: /dev/ttyS0


Logs

See above screenshot. Unfortunately I was not in front of my computer at the time, so could only get a screenshot of the log.

@cods4
Copy link
Author

cods4 commented Aug 14, 2024

This seems to still be an issue. Accidently started up the edge build again the other days and had the same issue

19:31:03 INFO    Writing sensor export_control=Export First Registers:{244=0x0000} 
23:00:00 INFO    Queue update export_control=Zero Export to CT
23:00:03 INFO    Writing sensor export_control=Zero Export to CT Registers:{244=0x0002} 
23:00:05 INFO    Queue update grid_peak_shaving=ON
23:00:07 ERROR   TypeError in callback read_inv1: sunsynk.rwsensors.RWSensor.reg() argument after * must be an iterable, not int

Traceback (most recent call last):

  File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/timer_callback.py", line 80, in wrap_callback
    await cb_call

  File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/sensor_callback.py", line 96, in callback_sensor
    await ist.inv.write_sensor(sensor, value)

  File "/usr/local/lib/python3.11/site-packages/sunsynk/sunsynk.py", line 48, in write_sensor
    regs = sensor.reg(*regs, msg=f"while setting value = {value}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: sunsynk.rwsensors.RWSensor.reg() argument after * must be an iterable, not int

05:00:00 INFO    Queue update grid_peak_shaving=OFF
05:00:03 INFO    Writing sensor grid_peak_shaving=OFF Registers:{280=0x0000} [Register 0-->0]
05:00:05 INFO    Queue update export_control=Export First
05:00:05 INFO    Queue update grid_peak_shaving=OFF
05:00:07 INFO    Writing sensor grid_peak_shaving=OFF Registers:{280=0x0000} [Register 0-->0]
05:00:07 INFO    Writing sensor export_control=Export First Registers:{244=0x0000} 
05:00:10 INFO    Queue update export_control=Export First
05:00:12 INFO    Writing sensor export_control=Export First Registers:{244=0x0000} 
06:23:01 INFO    Queue update export_control=Zero Export to CT
06:23:03 INFO    Writing sensor export_control=Zero Export to CT Registers:{244=0x0002} 
06:23:06 INFO    Queue update grid_peak_shaving=ON
06:25:00 ERROR   (1 in 5 min) TypeError in callback read_inv1: sunsynk.rwsensors.RWSensor.reg() argument after * must be an iterable, not int

10:30:03 INFO    Queue update date_time=2024-08-12 22:30:00
10:30:03 INFO    Queue update date_time=2024-08-12 22:30:00
10:30:03 INFO    Queue update date_time=2024-08-12 22:30:00
10:30:04 INFO    Writing sensor date_time=2024-08-12 22:30:00 Registers:{22=0x1808 23=0x0c16 24=0x1e00} 
10:30:04 INFO    Writing sensor date_time=2024-08-12 22:30:00 Registers:{22=0x1808 23=0x0c16 24=0x1e00} 
10:30:04 INFO    Writing sensor date_time=2024-08-12 22:30:00 Registers:{22=0x1808 23=0x0c16 24=0x1e00} 
11:00:00 INFO    Queue update export_control=Zero Export to CT
11:00:03 INFO    Writing sensor export_control=Zero Export to CT Registers:{244=0x0002} 
11:00:05 INFO    Queue update grid_peak_shaving=ON
11:00:34 INFO    Queue update grid_charge_enabled=OFF
11:00:35 INFO    Writing sensor grid_charge_enabled=OFF Registers:{232=0x0000} 
11:05:00 ERROR   (1 in 5 min) TypeError in callback read_inv1: sunsynk.rwsensors.RWSensor.reg() argument after * must be an iterable, not int

11:15:36 INFO    Queue update grid_charge_enabled=ON
11:15:37 INFO    Writing sensor grid_charge_enabled=ON Registers:{232=0x00ff} 
19:00:00 INFO    Queue update grid_peak_shaving=OFF
19:00:03 INFO    Writing sensor grid_peak_shaving=OFF Registers:{280=0x0000} [Register 0-->0]
19:00:05 INFO    Queue update export_control=Export First
19:00:05 INFO    Queue update grid_peak_shaving=OFF
19:00:07 INFO    Writing sensor grid_peak_shaving=OFF Registers:{280=0x0000} [Register 0-->0]
19:00:07 INFO    Writing sensor export_control=Export First Registers:{244=0x0000} 
19:00:10 INFO    Queue update export_control=Export First
19:00:12 INFO    Writing sensor export_control=Export First Registers:{244=0x0000} 
23:00:00 INFO    Queue update export_control=Zero Export to CT
23:00:03 INFO    Writing sensor export_control=Zero Export to CT Registers:{244=0x0002} 
23:00:05 INFO    Queue update grid_peak_shaving=ON
23:05:00 ERROR   (1 in 5 min) TypeError in callback read_inv1: sunsynk.rwsensors.RWSensor.reg() argument after * must be an iterable, not int

05:00:00 INFO    Queue update grid_peak_shaving=OFF
05:00:03 INFO    Writing sensor grid_peak_shaving=OFF Registers:{280=0x0000} [Register 0-->0]
05:00:05 INFO    Queue update export_control=Export First
05:00:05 INFO    Queue update grid_peak_shaving=OFF
05:00:07 INFO    Writing sensor grid_peak_shaving=OFF Registers:{280=0x0000} [Register 0-->0]
05:00:07 INFO    Writing sensor export_control=Export First Registers:{244=0x0000} 
05:00:10 INFO    Queue update export_control=Export First
05:00:12 INFO    Writing sensor export_control=Export First Registers:{244=0x0000} 
09:00:00 INFO    Queue update export_control=Zero Export to CT
09:00:03 INFO    Writing sensor export_control=Zero Export to CT Registers:{244=0x0002} 
09:00:05 INFO    Queue update grid_peak_shaving=ON
09:05:00 ERROR   (1 in 5 min) TypeError in callback read_inv1: sunsynk.rwsensors.RWSensor.reg() argument after * must be an iterable, not int

10:30:03 INFO    Queue update date_time=2024-08-13 22:30:00
10:30:03 INFO    Queue update date_time=2024-08-13 22:30:00
10:30:03 INFO    Queue update date_time=2024-08-13 22:30:00
10:30:04 INFO    Writing sensor date_time=2024-08-13 22:30:00 Registers:{22=0x1808 23=0x0d16 24=0x1e00} 
10:30:04 INFO    Writing sensor date_time=2024-08-13 22:30:00 Registers:{22=0x1808 23=0x0d16 24=0x1e00} 
10:30:04 INFO    Writing sensor date_time=2024-08-13 22:30:00 Registers:{22=0x1808 23=0x0d16 24=0x1e00} 
11:00:00 INFO    Queue update export_control=Zero Export to CT
11:00:03 INFO    Writing sensor export_control=Zero Export to CT Registers:{244=0x0002} 
11:00:05 INFO    Queue update grid_peak_shaving=ON
11:05:00 ERROR   (1 in 5 min) TypeError in callback read_inv1: sunsynk.rwsensors.RWSensor.reg() argument after * must be an iterable, not int

18:01:03 INFO    Queue update grid_peak_shaving=OFF
18:01:04 INFO    Writing sensor grid_peak_shaving=OFF Registers:{280=0x0000} [Register 0-->0]
18:01:08 INFO    Queue update export_control=Export First
18:01:09 INFO    Writing sensor export_control=Export First Registers:{244=0x0000} 
18:01:11 INFO    Queue update export_control=Zero Export to CT
18:01:12 INFO    Writing sensor export_control=Zero Export to CT Registers:{244=0x0002} 
18:01:16 INFO    Queue update grid_peak_shaving=ON
s6-rc: info: service legacy-services: stopping
[18:03:19] INFO: �[32mService restart after closing�[0m
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

@kellerza
Copy link
Owner

kellerza commented Sep 6, 2024

This is likely fixed in 0.7.x

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

2 participants