I have just managed to get modbus connection working on SunSynk inverter after a struggle. I apologize, iam still very new to espHome, this is my first node and attempt with espHome. I noted that most of the values iam getting seem wrong. However i decided to start troubleshooting the most obvious first. In this it is the following lines
[E][modbus_controller:068]: Modbus error function code: 0x3 exception: 2 [E][modbus_controller:077]: Modbus error - last command: function code=0x3 register address = 0xC2 registers count=1 payload size=0
I noted that these errors appear, even when there is no sensors defined on Modbus. What do they mean.
seeing no response, I have a little bit more and enabled the debug on my device and the following is i what i noted
[00:37:58][V][modbus_controller:036]: Sending next modbus command to device 1 register 0x4F count 1
[00:37:58][V][modbus:199]: Modbus write: 01.03.00.4F.00.01.B5.DD (8)
[00:37:58][V][modbus_controller:486]: Command sent 3 0x4F 1
[00:37:58][D][uart_debug:158]: >>> "\x01\x03\x00O\x00\x01\xB5\xDD"
[00:37:58][V][modbus:042]: Modbus received Byte 1 (0X1)
[00:37:58][V][modbus:042]: Modbus received Byte 3 (0X3)
[00:37:58][V][modbus:042]: Modbus received Byte 2 (0X2)
[00:37:58][V][modbus:042]: Modbus received Byte 0 (0X0)
[00:37:58][V][modbus:042]: Modbus received Byte 107 (0X6b)
[00:37:58][V][modbus:042]: Modbus received Byte 249 (0Xf9)
[00:37:58][V][modbus:042]: Modbus received Byte 171 (0Xab)
[00:37:58][V][modbus_controller:055]: Modbus response queued
[00:37:58][V][modbus:042]: Modbus received Byte 1 (0X1)
[00:37:58][V][modbus:042]: Modbus received Byte 3 (0X3)
[00:37:58][V][modbus:042]: Modbus received Byte 2 (0X2)
[00:37:58][V][modbus:042]: Modbus received Byte 19 (0X13)
[00:37:58][V][modbus:042]: Modbus received Byte 129 (0X81)
[00:37:58][V][modbus:042]: Modbus received Byte 117 (0X75)
[00:37:58][V][modbus:042]: Modbus received Byte 20 (0X14)
[00:37:58][V][modbus_controller:055]: Modbus response queued
[00:37:58][W][component:204]: Component modbus took a long time for an operation (0.11 s).
[00:37:58][W][component:205]: Components should block for at most 20-30ms.
[00:37:58][V][modbus_controller:063]: Process modbus response for address 0x4F size: 2
[00:37:58][V][modbus_controller:098]: data for register address : 0x4F :
[00:37:58][D][modbus_controller.sensor:025]: Sensor new state: 107.00
[00:37:58][V][sensor:043]: 'SunSynk Grid Frequency (079)': Received new state 107.000000
[00:37:58][D][sensor:094]: 'SunSynk Grid Frequency (079)': Sending state 1.07000 Hz with 2 decimals of accuracy
[00:37:58][V][json:036]: Attempting to allocate 512 bytes for JSON serialization
[00:37:58][V][json:056]: Size after shrink 92 bytes
[00:37:58][V][mqtt:486]: Publish(topic='sunsynk/sensor/sunsynk_grid_frequency_079/state' payload='1.07' retain=1)
[00:37:58][W][component:204]: Component modbus_controller took a long time for an operation (0.07 s).
[00:37:58][W][component:205]: Components should block for at most 20-30ms.
[00:37:58][D][uart_debug:158]: <<< "\x01\x03\x02\x00k\xF9\xAB\x01\x03\x02\x13\x81u\x14"
[00:37:58][V][modbus_controller:063]: Process modbus response for address 0x5A size: 2
[00:37:58][V][modbus_controller:098]: data for register address : 0x5A :
[00:37:58][D][modbus_controller.sensor:025]: Sensor new state: 4993.00
[00:37:58][V][sensor:043]: 'SunSynk DC Transformer Temperature (090)': Received new state 4993.000000
[00:37:58][D][sensor:094]: 'SunSynk DC Transformer Temperature (090)': Sending state 399.30002 °C with 1 decimals
The values received seem incorrect, I am not sure if something is wrong on my device or not.
Have you thought about using Solarassitant to interface sunsynk and home assistant?
Ask yourself if all your time is worth the £40 for the license??
Im using it and i think its great. Its written by the home assistant team it seems and is really good i its own right.
It gives far better graphing than HA currently is able to do
Did you ever figure this out? I’ve got exactly the same problem after about 6 months of flawless ESPHOME usage on HASS with a sunsynk inverter. Suddenly my battery SOC, Day PV and another variable would intermittently report absurdly high values.