Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Home Assistant ESPHome and ESP32 & RS485 no data

Featured Replies

HI Guys

I watched Solar Integrations ( Youtube video ) and not getting the Data from my Sunsynk 8K inverter. I am able to connect to the ESP32, I have checked the cables, tried the alternative pins however the Data is not coming through ?

Anyone else had the same problem etc  Any suggestions are welcome,

Thanks 

  • 2 months later...

Hi guys

I also watched Solar Integrations Youtube videos, thank you very much, very helpful and informative.

I'm also having issues trying to get my ESP32 and ESPHome to read data from my 5kW Deye inverter.  I've gone through everything 2 or 3 times and can't figure out what the issue is.

My device is set to Master and Modbus is 01

20230829_081146.jpg.dd5b4d748a49bb8f264bfba08785fcf9.jpg

 

Connected my cables to D4, D16 and D17 which is GPIO4, GPIO15 and GPIO16 according to the diagram

20230829_081406.thumb.jpg.319b97959a335887a26ede61a7512353.jpg

Pinouts.png.d8dc1ff94c82fbd06a8e7bc8e95fa048.png

 

 

That then connects to the RS485 board as follows, also removed resistor R7.  DI -> D17,  RO -> D16 and RE -> D4

20230829_081601.thumb.jpg.eaeba10dbf590a06b31481fdb4aa97a7.jpg

 

My ethernet cable : 

20230829_081720.thumb.jpg.966f387d85ab75c886794c825be8700c.jpg

20230829_081804.thumb.jpg.00c517289d60d5376d799014bc1138e7.jpg

 

I get the following from my logs : 

logs.txt

 

And my config yaml file is : 

Deye.yaml

 

20230829_081327.jpg

Edited by WesleyR

Your YAML code says 

uart:
    id: mod_bus
    tx_pin: GPIO15
    rx_pin: GPIO16
    baud_rate: 9600
    stop_bits: 1
   
  modbus:
    id: sunsynk_modbus
    flow_control_pin: GPIO4

 

But from your photos is looks like you are connected to GPIO16 & 17, try changing your code to the connections you are using and see if that helps

 

Thank you @Sc00bs, I clearly missed that, was going on the diagram in your Youtube video  🤦‍♂️

 

BUT, I'm still not getting any readings at all.

 

Just to confirm, are my connections correct :  DI -> D17 (TX),  RO -> D16 (RX) and RE -> D4

 

I've attached my latest yaml and log files.

Deye.yamllogs.txt

 

That's not a log, looks like one of your cards.

Check in the log file, it should look like the attached log.

Check your power for the ESP32 board is connected correctly. 

Check the cable from the RS485 to the inverter is connected correctly, try swop it around if still not working. 

Check your TX and RX cables are correct, try swopping them around.

 

logs_inverter_logs.txt

Apologies @Sc00bs, I just copied and pasted but it didn't copy from the logs.  See correct logs attached.

Power is connected 100%

Checked the cable to inverter is correct, orange/white on the left and orange on the right.  Tried swopping around aswell, no difference.

Also checked the TX and RX are correct, had them connected as follows : DI -> D17 (TX),  RO -> D16 (RX) and RE -> D4  then swapped the TX and RX around, still nothing.

 

I'm starting to wonder if the RS485 board is faulty....

logs.txt

4 hours ago, WesleyR said:

@Sc00bs, I'm in Honeydew but working in Woodmead, so just down the road from you.  Thank you so much, would really appreciate that.

 

Will PM you my details.

 

I see you will be sorted. No more worries here😃

Because with the ESP device it is basically realtime information, not 1min delayed.  

 

But the most important benefit is that you can change settings on your inverter via the ESP device.  So for example you could set the inverter to charge the batteries before load shedding depending on the schedule which can change at any time. This would be all automatic.

 

12 minutes ago, WesleyR said:

Because with the ESP device it is basically realtime information, not 1min delayed.  

 

But the most important benefit is that you can change settings on your inverter via the ESP device.  So for example you could set the inverter to charge the batteries before load shedding depending on the schedule which can change at any time. This would be all automatic.

 

It's a good point and I just watch a Solar Integrations comparing 3 ways.

I use mobile app and local mode to configure inverter thru wifi without cloud.

I automate charge and discharge in the BMS of each battery

We have many options in my case I use the KISS method and avoid put extra hardware when I can fill my needs with what I have. 

1 hour ago, WesleyR said:

So you saying you can automate the charging of your battery based on solar forecast or loadshedding automatically, without you having to do anything?

I don't need that automation but if need it I can do it, I have JK BMS and with Batmon I can turn off charge and discharge of each battery to automate it. 

I have been equalizing my bateries and have using this a lot.

image.png.49e7c56badaaad9f480721ce53342a96.png

Edited by Delphinus

I get this with rs485. I do know the comms connection works as it’s fine with another Linux server.

 

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
20:06:05 INFO    Loading HASS OS configuration
20:06:06 INFO    Schedules:
+-----------+-----+------+--------+-----------+----------+------------+
|    Key    | src | Read | Report | Change by | Change % | Change any |
+-----------+-----+------+--------+-----------+----------+------------+
| date_time |     |  60  |   60   |           |          |    True    |
|     rw    |     |  5   |  300   |           |          |    True    |
|     w     |  *  |  5   |   60   |     40    |          |            |
|    kwh    |     | 300  |  300   |           |          |            |
|  any_unit |     |  15  |  300   |           |          |            |
|  no_unit  |     |  15  |  300   |           |          |    True    |
+-----------+-----+------+--------+-----------+----------+------------+
20:06:06 INFO    Using Single phase sensor definitions.
20:06:06 INFO    Added hidden sensors as other sensors depend on it: Rated power, Serial
20:06:06 INFO    Connecting to tcp://homeassistant.local:502
20:06:06 INFO    PyModbus 3.4.1 tcp: homeassistant.local:502
20:06:06 INFO    Reading startup sensors Prog5 Time, Rated power, Serial, Prog3 Time, Prog6 Time, Prog1 Time, Prog4 Time, Battery Low Capacity, Prog2 Time
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/__main__.py", line 72, in <module>
    main()
  File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/__main__.py", line 67, in main
    loop.run_until_complete(main_loop(loop))
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/__main__.py", line 37, in main_loop
    await ist.connect()
  File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/a_inverter.py", line 103, in connect
    if not await self.read_sensors(sensors=SOPT.startup):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/a_inverter.py", line 59, in read_sensors
    await self.inv.read_sensors(sensors)
  File "/usr/local/lib/python3.11/site-packages/sunsynk/sunsynk.py", line 134, in read_sensors
    raise IOError("; ".join(errs))
OSError: OSError reading 5 registers from 3: failed to read register 3 - function code: 131; OSError reading 2 registers from 16: failed to read register 16 - function code: 131; OSError reading 1 registers from 219: failed to read register 219 - function code: 131; OSError reading 6 registers from 250: failed to read register 250 - function code: 131
[20:06:15] WARNING: Halt add-on with exit code 1
s6-rc: info: service legacy-services: stopping
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

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.