Author Topic: Deye Hybrid Inverter RTC Problem  (Read 13940 times)

0 Members and 3 Guests are viewing this topic.

Offline ZambianRob

  • Newbie
  • Posts: 6
  • Country: zm
Re: Deye Hybrid Inverter RTC Problem
« Reply #75 on: July 08, 2025, 06:28:16 pm »
Okay so I am updating the time using a home assistant automation which takes the time from home assistant which in turn gets its time from my router/firewall ntp (opnsense in my case) the automation simply updates the time on the inverter via the solarman home assistant integration, I can post the link to the github project for the Solarman integration as it is a treasure trove of information like the modbus info for a number of inverters based on the same platform which is how it configures the inverter and reads the data.
Hoping it isnt against forum rules here is the link as I am pretty sure it contains the specifics you are looking for:
https://github.com/davidrapan/ha-solarman

I have been playing around with this whole setup for about a week straight as had to pull out my victron system and for the price was able to double the size of my inverter with the Deye and give myself time to repair my victron unit.
 
The following users thanked this post: rteodor

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11043
  • Country: fi
Re: Deye Hybrid Inverter RTC Problem
« Reply #76 on: July 08, 2025, 06:46:23 pm »
Hey there, so I recently bought myself a deye sg05lp1 8kw hybrid so basically the same as yours pretty much. Anyway I have been following your plight with the RTC / time drift issue and a few other issues you have had with the unit.

So I have a fully working setup that maintains the deye WiFi dongle for network connection but is blocked from the DEYE cloud platform by my DNS server so no random phoning home to random Chinese or other servers. I am using Home Assistant to monitor and control my inverter using the SolarMan home assistant integration which has worked perfectly on my inverter for full monitoring and stats via home assistant as well as configuration via home assistant as well. On that last point I have an automation setup in home assistant to update my inverter time 1 time per day at dawn (my drift issues are not nearly as severe as yours) but the automation can be triggered to happen multiple times per day or even when the inverter time differs from the home assistant time by x.

Let me know if you would like to take a look at my setup, I don't know how attached you are to that pi based solar manager software but you could repurpose your pi to run both home assistant and pihole (DNS server) which will let you block the inverter from phoning home, and you won't need rs485 or the like as the coms is over your WiFi.

So let me check if I understood this: the time is updated via WiFi from a local NTP server (configured via DNS to a local one) but you trigger the update how exactly ? Can you sniff the WiFi to see how SolarMan is doing that trigger ?

I guess, it would be a simple modbus write in a really convoluted way a la Home Assistant.
https://github.com/davidrapan/ha-solarman/blob/main/custom_components/solarman/inverter_definitions/deye_hybrid.yaml#L167
This says register addresses 22-24, so does not match the document I have and posted above, but that's no surprise - Chinese companies are excellent at producing huge range of similar inverters with incompatible modbus interfaces, and not naming/versioning the interfaces in any way, so the process is to Google random documents (and Home Assistant integrations are a great resource as well) and try what works.
 

Offline ZambianRob

  • Newbie
  • Posts: 6
  • Country: zm
Re: Deye Hybrid Inverter RTC Problem
« Reply #77 on: July 08, 2025, 06:57:52 pm »
Yeah I went through the Deye.Modbus.protocol.V118.pdf document provided in the documentation section and confirmed the modbus registers 22-24 for date time and so far every morning at dawn or if Home assistant is restarted for what ever reason it triggers the clock update and i was able to witness the update take place this morning.

I have been very impressed with the Solarman integration in HA all the configuration options seem to work though there is some slight naming differences between what you see on the inverter display in the settings menus compared to what the integration in home assistant gives you so that is something to pay attention to.
as for the time sync automation it is also provided by the same contributor in the automations section on his github for the integration so its a known workaround it seems.
 

Offline rteodor

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: ro
Re: Deye Hybrid Inverter RTC Problem
« Reply #78 on: July 08, 2025, 07:02:43 pm »
Hey there, so I recently bought myself a deye sg05lp1 8kw hybrid so basically the same as yours pretty much. Anyway I have been following your plight with the RTC / time drift issue and a few other issues you have had with the unit.

So I have a fully working setup that maintains the deye WiFi dongle for network connection but is blocked from the DEYE cloud platform by my DNS server so no random phoning home to random Chinese or other servers. I am using Home Assistant to monitor and control my inverter using the SolarMan home assistant integration which has worked perfectly on my inverter for full monitoring and stats via home assistant as well as configuration via home assistant as well. On that last point I have an automation setup in home assistant to update my inverter time 1 time per day at dawn (my drift issues are not nearly as severe as yours) but the automation can be triggered to happen multiple times per day or even when the inverter time differs from the home assistant time by x.

Let me know if you would like to take a look at my setup, I don't know how attached you are to that pi based solar manager software but you could repurpose your pi to run both home assistant and pihole (DNS server) which will let you block the inverter from phoning home, and you won't need rs485 or the like as the coms is over your WiFi.

So let me check if I understood this: the time is updated via WiFi from a local NTP server (configured via DNS to a local one) but you trigger the update how exactly ? Can you sniff the WiFi to see how SolarMan is doing that trigger ?

I guess, it would be a simple modbus write in a really convoluted way a la Home Assistant.
https://github.com/davidrapan/ha-solarman/blob/main/custom_components/solarman/inverter_definitions/deye_hybrid.yaml#L167
This says register addresses 22-24, so does not match the document I have and posted above, but that's no surprise - Chinese companies are excellent at producing huge range of similar inverters with incompatible modbus interfaces, and not naming/versioning the interfaces in any way, so the process is to Google random documents (and Home Assistant integrations are a great resource as well) and try what works.

So I guess this is Modbus over WiFi ?
It should then be relatively easy to produce a python script and put it in /etc/cron.hourly and its problem solved.
 

Offline ZambianRob

  • Newbie
  • Posts: 6
  • Country: zm
Re: Deye Hybrid Inverter RTC Problem
« Reply #79 on: July 08, 2025, 07:11:19 pm »
Im not much of a coder more of a dabbler in many many things however would this assist in anyway?
https://github.com/davidrapan/ha-solarman/blob/main/custom_components/solarman/time.py
Forgive me if not like I said the coding is a little bit beyond me I know enough to be dangerous.
 

Offline Tooms

  • Supporter
  • ****
  • Posts: 105
  • Country: dk
Re: Deye Hybrid Inverter RTC Problem
« Reply #80 on: July 08, 2025, 07:24:02 pm »
Hi

Dont have the deye so can not verify if this works, but i asked chatgpt to read the Deye pdf and provide the modbus commands...

1. Login to linux via ssh

2. install modpool
>sudo apt install mbpoll


Read and set time over serial


Read and set time over TCP

 

Offline ZambianRob

  • Newbie
  • Posts: 6
  • Country: zm
Re: Deye Hybrid Inverter RTC Problem
« Reply #81 on: July 08, 2025, 07:37:44 pm »
Not that I would win an argument with ChatGPT on my best day I would just double check on that as reading the document myself the registers for time are 22-24 and not 130 to 136 which incidentally doesnt feature in the Deye.Modbus.protocol.V118.pdf document... I am sure there are many versions of the document though and I honestly dont know enough right now to be able to confirm what is in the document on my own system, I just know that via home assistant and the solarman integration everything "just works" at a surface level.
 

Offline rteodor

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: ro
Re: Deye Hybrid Inverter RTC Problem
« Reply #82 on: July 08, 2025, 07:45:25 pm »
ChatGPT, you always have to watch it carefully what is does ...
Not only the registers are wrong but I do not know how it packs the values into registers. Who knows what else its wrong there ...

 

Offline Tooms

  • Supporter
  • ****
  • Posts: 105
  • Country: dk
Re: Deye Hybrid Inverter RTC Problem
« Reply #83 on: July 08, 2025, 07:45:59 pm »
if you can try the READ command


via tcp
modpoll -m tcp -t 4 -r 130 -c 7 <DeyeIP>


or via serial
modpoll -m rtu -a 1 -r 130 -c 7 -t 4 -o 3 /dev/ttyUSB0 9600n8


then you can see if it return the date time values
 
The following users thanked this post: Silicium81

Offline Tooms

  • Supporter
  • ****
  • Posts: 105
  • Country: dk
Re: Deye Hybrid Inverter RTC Problem
« Reply #84 on: July 08, 2025, 08:00:25 pm »

based on the post on page 2 in this thread from Siwastaja

there is an pdf and image saying it is 62-64.


So if that is correct READ commands are:

Serial: modpoll -m rtu -a 1 -r 62 -c 3 -t 3 /dev/ttyUSB0 9600n8
tcp: modpoll -m tcp -r 62 -c 3 -t 3 192.168.1.100


if anyone has the deye and can test this and reply the output
 

Offline rteodor

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: ro
Re: Deye Hybrid Inverter RTC Problem
« Reply #85 on: July 09, 2025, 07:11:21 am »

based on the post on page 2 in this thread from Siwastaja

Based on Siwastaja's reply #46 then reply #76 and ZambianRob's reply #75 and your reply #80:

Code: [Select]
# repeat the command a few times and check the changes!
modpool -m tcp -t 4 -r 22 -c 3 $INVERTER_IP
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11043
  • Country: fi
Re: Deye Hybrid Inverter RTC Problem
« Reply #86 on: July 09, 2025, 07:37:13 am »
And in case you can't be sure you are using the correct register listing, just read all registers sequentially in a script until you encounter value 2025 (remember endianness, if not handled by the modbus library (likely is)). Verify it's indeed part of date/time by reading the next register and see if it says 7, and so on. Very simple case of reverse-engineering here.
« Last Edit: July 09, 2025, 08:02:18 am by Siwastaja »
 

Offline ZambianRob

  • Newbie
  • Posts: 6
  • Country: zm
Re: Deye Hybrid Inverter RTC Problem
« Reply #87 on: July 09, 2025, 07:58:59 am »

based on the post on page 2 in this thread from Siwastaja

there is an pdf and image saying it is 62-64.


So if that is correct READ commands are:

Serial: modpoll -m rtu -a 1 -r 62 -c 3 -t 3 /dev/ttyUSB0 9600n8
tcp: modpoll -m tcp -r 62 -c 3 -t 3 192.168.1.100


if anyone has the deye and can test this and reply the output


based on the post on page 2 in this thread from Siwastaja

Based on Siwastaja's reply #46 then reply #76 and ZambianRob's reply #75 and your reply #80:

Code: [Select]
# repeat the command a few times and check the changes!
modpool -m tcp -t 4 -r 22 -c 3 $INVERTER_IP

And in case you can't be sure you are using the correct register listing, just read all registers sequentially in a script until you encounter value 2025. Verify it's indeed part of date/time by reading the next register and see if it says 7, and so on. Very simple case of reverse-engineering here.


Hi All sorry only responding now, when I have a chance Ill try set something up with modpoll and do the scan.

One thing I am wondering is whether there is a situation where the inverter is being talked to by the wifi dongle via modbus, but and I cant confirm this yet but as far as I know the Wifi dongle is just a microcontroller which has its own modbus comms so I am wondering if we need to be looking here?
https://pysolarmanv5.readthedocs.io/en/stable/solarmanv5_protocol.html
I only say this as when I port scan the wifi/inverter ip it comes up with port 8899 and not 502 as expected for normal modbus tcp.

Please forgive me I am by no means an expert in any field electrical or software I am just a dabbler with a keen interest so please be patient if I dont answer questions porperly.

 
The following users thanked this post: rteodor

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11043
  • Country: fi
Re: Deye Hybrid Inverter RTC Problem
« Reply #88 on: July 09, 2025, 08:06:20 am »
https://pysolarmanv5.readthedocs.io/en/stable/solarmanv5_protocol.html
I only say this as when I port scan the wifi/inverter ip it comes up with port 8899 and not 502 as expected for normal modbus tcp.

The protocol specified there clearly isn't modbus TCP, but their custom one - but then again, it looks simple enough.

As a side note, there isn't one widely used or standardized port for modbus TCP. Some use 502, others something else. Some also expect that you use some specific slave_id within the modbus TCP frame.
 
The following users thanked this post: rteodor

Offline rteodor

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: ro
Re: Deye Hybrid Inverter RTC Problem
« Reply #89 on: July 09, 2025, 08:34:41 am »

Hi All sorry only responding now, when I have a chance Ill try set something up with modpoll and do the scan.

One thing I am wondering is whether there is a situation where the inverter is being talked to by the wifi dongle via modbus, but and I cant confirm this yet but as far as I know the Wifi dongle is just a microcontroller which has its own modbus comms so I am wondering if we need to be looking here?
https://pysolarmanv5.readthedocs.io/en/stable/solarmanv5_protocol.html
I only say this as when I port scan the wifi/inverter ip it comes up with port 8899 and not 502 as expected for normal modbus tcp.

Please forgive me I am by no means an expert in any field electrical or software I am just a dabbler with a keen interest so please be patient if I dont answer questions porperly.

Ups, It seems I was wrong: I was under the impression that the WiFi comes from Deye (being a direct interface) but it seems your's comes from SolarMan ?

On a side note: this is just ... uh, one more Deye bug mentioned in your link:

Quote
Some inverter/data logger combinations (DEYE + possibly others) exhibit a bug whereby the Modbus frame is suffixed with two addtional bytes. It is assumed that these devices are erroneously calculating and appending the Modbus CRC twice.

Later edit: Not sure if this is comes from Deye or from SolarMan.
« Last Edit: July 09, 2025, 08:41:38 am by rteodor »
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #90 on: July 16, 2025, 08:37:34 am »
Deye have updated my Wifi dongle remotely to update every minute

Quote
The R&D team suggested I change the WiFi dongle’s data upload interval from 5 minutes to 1 minute. This way, the time will automatically sync whenever there’s a drift of ±1 minute.
I’ve already updated the setting for your dongle. Just keep in mind that if the firmware is upgraded in the future, this setting will revert back to the default 5 minutes, so it’ll need to be changed again. We’re currently switching over to a dongle model with a default 1-minute interval.
Feel free to keep an eye on it for now.

The products with the updated LCD board, which I mentioned in previous email, have an improved feature that keeps the time drift within 30 seconds over a month, even if the inverter isn’t connected to the internet. The R&D team is also looking into an external GPS module for more accurate timing requirements, especially for older products.
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2893
  • Country: fr
    • kripton2035 schematics repository
Re: Deye Hybrid Inverter RTC Problem
« Reply #91 on: July 16, 2025, 10:06:39 am »
solar panel inverter soon to be synchronized at ±1µs ????
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf