kellerza / sunsynk

Deye/Sunsynk Inverter Python library and Home Assistant OS Addon
https://kellerza.github.io/sunsynk/
MIT License
204 stars 87 forks source link

Writing any value to prog1_voltage etc results in a setting of ~0V #154

Closed cods4 closed 1 year ago

cods4 commented 1 year ago

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Describe the issue/bug

When I set any of the time of use voltages to anything (47.5 - 54.5V), the inverter always sets the voltage in the inverter to ~0V. The value sent to the inverter should be multiplied by 100, i.e 54V should be converted to 5400, however the inverter is sent the raw voltage value (i.e 54) which it converts to 0.54V.

Note: This worked properly in the past (I think the issues started when I moved to the Multi version).

I also have a number of additional sensors defined in mysensors.py

And I learned the hard way that this voltage setting overides the other voltage limits set in the inverter. I.e One morning I discovered that the battery voltage was right down near 40V, even though my low battery shutdown was set to 47V. So I hope this doesn't catch anyone else out. (Fortunately I had a new set of LFP cells on their way from China to replace my lead acids, so it wasn't a huge loss).

Your environment

Connected to three inverters through MBUSD via the RS232 ports. The same behavior was observed when connected through the RS485 ports

Logs

2023-07-02 21:20:14,627 CRITICAL Writing sensor prog1_voltage=47.5 [(262,)=(54,)] 
2023-07-02 21:21:00,953 CRITICAL Writing sensor prog1_voltage=54.5 [(262,)=(54,)] 
2023-07-02 21:21:37,311 CRITICAL Writing sensor prog1_voltage=50.5 [(262,)=(54,)] 
2023-07-02 21:27:39,241 CRITICAL Writing sensor prog1_voltage=50.4 [(262,)=(54,)] 
2023-07-02 21:29:29,721 CRITICAL Writing sensor prog1_voltage=50.1 [(262,)=(54,)] 
2023-07-02 21:29:58,059 CRITICAL Writing sensor prog1_voltage=47.8 [(262,)=(54,)] 
2023-07-02 21:35:04,826 CRITICAL Writing sensor prog1_voltage=54.5 [(262,)=(54,)] 

Querying inverter directly

cods4@raspberrypi:~ $ modbus -s 1 192.168.21.244:50001 262
Parsed 0 registers definitions from 1 files
262: 54 0x36
cods4@raspberrypi:~ $ modbus -s 1 192.168.21.244:50001 263
Parsed 0 registers definitions from 1 files
263: 5400 0x1518

Querying MQTT server

SUNSYNK/status/INV1_SN/prog1_voltage = 0.54

SUNSYNK/status/INV1_SN/prog2_voltage = 54
kellerza commented 1 year ago

Should be fixed in the latest release. Please let me know if this still persists