Jump to content

Sunsynk connection to home assistant


MV SOLAR
 Share

Recommended Posts

I have installed the software according to the link from kellerza

https://github.com/kellerza/sunsynk

But i get no communication to home assistant via the rs485-usb converter.

I have installed Modbus TCP to Modbus RTU Gateway Add-on but get the following message:

15:48:14] INFO: Starting mbusd -d -L - -v 2 -p /dev/ttyS0 -s 9600 -m 8N1 -P 502
13 Mar 2022 15:48:14 mbusd-0.5.1 started...
13 Mar 2022 15:48:14 tty: trying to open /dev/ttyS0 (speed 9600 mode 8N1)
13 Mar 2022 15:48:14 conn_init(): can't open tty device /dev/ttyS0 (I/O error)
13 Mar 2022 15:48:14 conn_init() failed, exiting...

have configured  /dev/ttyS0 to be the device have tried all of them but still no connection:- please if anybody can help me

Link to comment
Share on other sites

Your usb converter is almost certainly not mounted at /dev/ttyS0; it should be /dev/ttyUSB0 (or more).

It might be that the usb converter is not picked up, or the config is incorrect. If you look at:

https://github.com/kellerza/sunsynk/blob/main/hass-addon-mbusd/config.yaml

You will see it pointing to /dev/ttyUSB0.

If you don't have /dev/ttyUSB0 then your USB converter is not being picked up correctly.

Edited by P1000
Link to comment
Share on other sites

I get the following when trying to connect:

[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-03-13 18:19:56,507 INFO    Loading HASS OS configuration
2022-03-13 18:19:56,514 DEBUG   could not patch umodbus: numpy not found
2022-03-13 18:19:56,517 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-03-13 18:19:56,518 INFO    Connecting to serial:///dev/ttyUSB0
2022-03-13 18:19:56,525 ERROR   Read Error: (1,3,5) [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
2022-03-13 18:19:56,526 INFO    ############################################################
2022-03-13 18:19:56,526 INFO    No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc
2022-03-13 18:19:56,527 INFO    ############################################################
2022-03-13 18:19:56,528 CRITICAL This Add-On will terminate in 30 seconds, use the Supervisor Watchdog to restart 

if i do ls -l /dev/ttyUSB* ubuntu does display ttyUSB0

Sunsynk Inverter Add-on Current version: 2022.03.04-0.1.4

 
Link to comment
Share on other sites

  • 3 weeks later...
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-03-13 18:19:56,507 INFO    Loading HASS OS configuration
2022-03-13 18:19:56,514 DEBUG   could not patch umodbus: numpy not found
2022-03-13 18:19:56,517 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-03-13 18:19:56,518 INFO    Connecting to serial:///dev/ttyUSB0
2022-03-13 18:19:56,525 ERROR   Read Error: (1,3,5) [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'

 

How are you running Home Assistant?

If you're running it in a container (i.e. docker). if so, you'll need to map /dev/ttyUSB0 -> the container, or be running in privileged mode.

I think the default install will map devices, but I need to check.

Home Assistant also likes devices to be plugged in after its running.  So boot up first make sure HA is running, *then* plugin the USB ,and see if it can see ttyUSB0 inside the container.

 

 

If still no luck, then manually check inside the container to see if its seeing the device.

I'd also check outside to see if it see's it.

eg - inside the os

dmesg  grep usb

ls /dev/ttyUSB*

 

within the container that runs HA - 

dmesg  grep usb

ls /dev/ttyUSB*

 

You'll need some cli experience - i.e. with ssh and docker. you'll need to check that the OS see's the device.

Worst case can assist further 

 

 

Edited by shanghailoz
Link to comment
Share on other sites

Home Assistant is running in a Virtual Box on Linux Ubuntu

I get the following messages in home assistant terminal:

image.png.e9e2d1e30e342497a064e75d3144d23e.png

and on the log file i get

2022-04-09 10:40:03,525 INFO    Loading HASS OS configuration
2022-04-09 10:40:03,532 DEBUG   could not patch umodbus: numpy not found
2022-04-09 10:40:03,535 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-04-09 10:40:03,536 INFO    Connecting to serial:///dev/ttyUSB2
2022-04-09 10:40:03,543 ERROR   Read Error: (1,3,5) [Errno 2] could not open port /dev/ttyUSB2: [Errno 2] No such file or directory: '/dev/ttyUSB2'
2022-04-09 10:40:03,544 INFO    ############################################################
2022-04-09 10:40:03,544 INFO    No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc
2022-04-09 10:40:03,545 INFO    ############################################################
2022-04-09 10:40:03,545 CRITICAL This Add-On will terminate in 30 seconds, use the Supervisor Watchdog to restart automatically.

have also tried USB0 and USB1

The config file is as follows

PORT: serial:///dev/ttyUSB0
DRIVER: umodbus
SUNSYNK_ID: '2***********'
SENSOR_PREFIX: ''
SENSORS:
  - total_pv_power
  - total_battery_charge
  - total_battery_discharge
  - total_grid_export
  - total_grid_import
  - battery_soc
PROFILES: []
MODBUS_SERVER_ID: 1
MQTT_HOST: core-mosquitto
MQTT_PORT: 1883
MQTT_USERNAME: hass
MQTT_PASSWORD: ''
DEBUG: 0
On Ubuntu terminal I do get /dev/ttyUSB0

 

 

image.png

Link to comment
Share on other sites

Posted (edited)

Found the problem - I am running home assistant on an ubuntu server under virtualbox.

You need to enable usb under virtualbox otherwise no usb device will be seen in Home Assistant

 

Thanks

Edited by MV SOLAR
Link to comment
Share on other sites

But still not reading the data get the following logging data:

[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-10 11:06:33,585 INFO    Loading HASS OS configuration
2022-04-10 11:06:33,614 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-04-10 11:06:33,624 INFO    Protocol made connection.
2022-04-10 11:06:33,625 INFO    Connected to /dev/ttyUSB0
2022-04-10 11:06:43,631 ERROR   Timeout reading:
2022-04-10 11:06:43,632 INFO    ############################################################
2022-04-10 11:06:43,633 INFO    No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc
2022-04-10 11:06:43,634 INFO    ############################################################
2022-04-10 11:06:43,634 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.
2022-04-10 11:07:40,854 INFO    Protocol made connection.
2022-04-10 11:07:40,856 INFO    Connected to /dev/ttyUSB0
2022-04-10 11:07:40,917 INFO    ############################################################
2022-04-10 11:07:40,918 INFO                Inverter serial number '2111255555'
2022-04-10 11:07:40,918 INFO    ############################################################
2022-04-10 11:07:40,918 INFO    MQTT: Connecting to [email protected]:1883
2022-04-10 11:07:40,954 INFO    MQTT: Connection successful
2022-04-10 11:07:51,980 ERROR   Timeout reading:
2022-04-10 11:07:51,982 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-10 11:08:02,017 ERROR   Timeout reading: Total PV Power
2022-04-10 11:08:12,055 ERROR   Timeout reading: Total Battery Charge
2022-04-10 11:08:22,090 ERROR   Timeout reading: Total Battery Discharge
2022-04-10 11:08:32,125 ERROR   Timeout reading: Total Grid Export
2022-04-10 11:08:42,159 ERROR   Timeout reading: Total Grid Import
2022-04-10 11:08:52,195 ERROR   Timeout reading: Battery SOC
2022-04-10 11:09:02,220 ERROR   Timeout reading:

Link to comment
Share on other sites

  • 2 weeks later...

 

On 2022/04/10 at 11:12 AM, MV SOLAR said:

But still not reading the data get the following logging data:

[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-10 11:06:33,585 INFO    Loading HASS OS configuration
2022-04-10 11:06:33,614 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-04-10 11:06:33,624 INFO    Protocol made connection.
2022-04-10 11:06:33,625 INFO    Connected to /dev/ttyUSB0
2022-04-10 11:06:43,631 ERROR   Timeout reading:
2022-04-10 11:06:43,632 INFO    ############################################################
2022-04-10 11:06:43,633 INFO    No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc
2022-04-10 11:06:43,634 INFO    ############################################################
2022-04-10 11:06:43,634 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.
2022-04-10 11:07:40,854 INFO    Protocol made connection.
2022-04-10 11:07:40,856 INFO    Connected to /dev/ttyUSB0
2022-04-10 11:07:40,917 INFO    ############################################################
2022-04-10 11:07:40,918 INFO                Inverter serial number '2111255555'
2022-04-10 11:07:40,918 INFO    ############################################################
2022-04-10 11:07:40,918 INFO    MQTT: Connecting to [email protected]:1883
2022-04-10 11:07:40,954 INFO    MQTT: Connection successful
2022-04-10 11:07:51,980 ERROR   Timeout reading:
2022-04-10 11:07:51,982 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-10 11:08:02,017 ERROR   Timeout reading: Total PV Power
2022-04-10 11:08:12,055 ERROR   Timeout reading: Total Battery Charge
2022-04-10 11:08:22,090 ERROR   Timeout reading: Total Battery Discharge
2022-04-10 11:08:32,125 ERROR   Timeout reading: Total Grid Export
2022-04-10 11:08:42,159 ERROR   Timeout reading: Total Grid Import
2022-04-10 11:08:52,195 ERROR   Timeout reading: Battery SOC
2022-04-10 11:09:02,220 ERROR   Timeout reading:

 

I'm having the same issues with my DEYE 8kw inverter. I eventually just gave up. Pretty much getting the same as what you are getting above. 

I get this 1st as per below. 

############################################################

"No response on the Modbus interface, try checking the wiring to the Inverter, the USB-to-RS485 converter, etc"

############################################################

and then i sometimes get the below with my inverter serial number

############################################################

Inverter serial number '2315xxxxxx'

############################################################

I wonder if this info below would make any difference? I don't know anything about the coding or if it is even relevant to the code, but they are saying there are differences between the 5KW and the 8KW. maybe the code has to read each one differently????? Who knows. I have an 8KW inverter. 

"Another confusion is that the 5.5kw and the 8.8kw does not use the same markings for connecting up the GEN/GRID/LOAD."

8.8kw is GRID/GEN/LOAD

5.5kw is GEN/LOAD/GRID

8.8kw is X/N/L

5.5kw is L/N/E

 

Link to comment
Share on other sites

  • 1 month later...

Same issue here. Been bashing my head against it for 3 days and not getting anywhere!

2 x 8KW Inverters in parallel, a PI3 and this RS485 converter: https://www.robotics.org.za/RS485-3P

Managed to get a serial number out of the inverter but nothing else - just timeouts. Chopped the RS and USB cable to 30cm just in case - still no joy.

----------------------------------------------------------------------------
[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-06-10 18:28:10,130 INFO    Loading HASS OS configuration
2022-06-10 18:28:10,164 DEBUG   could not patch umodbus: numpy not found
2022-06-10 18:28:10,174 INFO    Filter *last used for battery_soc, total_battery_charge, total_battery_discharge, total_grid_export, total_grid_import, total_pv_power
2022-06-10 18:28:10,177 INFO    Connecting to serial:///dev/ttyUSB0
2022-06-10 18:28:10,301 INFO    ############################################################
2022-06-10 18:28:10,302 INFO                Inverter serial number 'XXXXXXXXXX'
2022-06-10 18:28:10,302 INFO    ############################################################
2022-06-10 18:28:10,304 INFO    MQTT: Connecting to [email protected]:1883
2022-06-10 18:28:14,910 INFO    MQTT: Connection successful
2022-06-10 18:28:25,906 ERROR   Timeout reading: 
2022-06-10 18:28:25,908 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-06-10 18:28:35,957 ERROR   Timeout reading: Total PV Power
2022-06-10 18:28:46,001 ERROR   Timeout reading: Total Battery Charge
----------------------------------------------------------------------------

Anyone have any ideas? I'm out!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...