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

0 Members and 3 Guests are viewing this topic.

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9041
  • Country: ca
Re: Deye Hybrid Inverter RTC Problem
« Reply #50 on: June 23, 2025, 05:54:43 pm »
Careful writing to unknown Modbus registers. That can be a disaster.
I would read the (time) i.e. seconds reg to confirm it's rollin'. Ask Deye for the Modbus register listing. Is this secret? Why?

I don't get it - keep installing new Deye units, something an average user could never do, they've bought the farm and are surely stuck with the unit.
It's pandering to reviewers despite product issues, but not the customers. Kinda bugs me.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11043
  • Country: fi
Re: Deye Hybrid Inverter RTC Problem
« Reply #51 on: June 23, 2025, 06:33:52 pm »
I think the trick will be finding the right way to write data to registers 62-64,  you'll probably be able to read them ok.

Indeed by reading them out first (and that is another can of worms - which of the two address spaces, function code 3 or 4 - try which one works), you can easily confirm if they are the current date/time or something else, and if they are, you can verify that what you are going to write to them has the same byte order. Otherwise, it's easy - just write them with function code 0x10 in one go.

Ask Deye for the Modbus register listing. Is this secret? Why?

What I posted is an excerpt of machine translated Chinese document. It isn't a secret per se and should be easy to find with Google, and I see no reason why Deye would not give it upon request given that you find the right person. Which isn't always easy.

One surprisingly big problem with Chinese inverters is that the modbus documents tend to be prefaced with something like "communication protocol for grid-tie inverter" or similar - that's it, sometimes even lacking manufacturer name, and almost never a list of model numbers that the document applies to. Therefore, for manufacturer X, there tends to be documents A, B and C which are all different and apply to different models, but nothing about to which it applies to, and then for each, older, newer, differently translated versions out of which you can only find some. It's some detective work. And I still prefer that over a committee disaster like Sunspec.

Therefore, your advice is good - be careful before doing random writes. It is unlikely you accidentally hit some register that causes a disaster like brickage of further write attempts - never happened to me reverse-engineering and poking shit out of dozen of inverters -, but it's possible.
« Last Edit: June 23, 2025, 06:36:07 pm by Siwastaja »
 
The following users thanked this post: thm_w

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #52 on: June 23, 2025, 10:44:27 pm »
I just tested if it reads the RTC on power-up only by removing all the power, and that didn't reset the time. So it seems to overwriting the RTC with the incorrect time when it powers down. And the battery must be good.
« Last Edit: June 23, 2025, 10:58:18 pm by EEVblog »
 
The following users thanked this post: thm_w

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2743
  • Country: us
Re: Deye Hybrid Inverter RTC Problem
« Reply #53 on: June 23, 2025, 11:02:03 pm »
Were you able to identify the RTC?
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: nz
Re: Deye Hybrid Inverter RTC Problem
« Reply #54 on: June 23, 2025, 11:03:09 pm »
I just tested if it reads the RTC on power-up only by removing all the power, and that didn't reset the time. So maybe it's overwriting the RTC with the incorrect time when it powers down. And the battery must be good.

I've seen buggy flash wear leveling implementations where it doesnt always find the latest NVM entry for an item and sometimes returns an older one instead.  We had that issue with the Nordic NVM system a few years ago.

If they're storing/reading the hours and minutes in a flash NVM system with that bug, and using the RTC timer only for the seconds. Then I could see it losing minutes or hours periodically. You'd hope they're not constantly reading time out of NVM instead of a variable, but you never know
« Last Edit: June 23, 2025, 11:16:10 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30061
  • Country: nl
    • NCT Developments
Re: Deye Hybrid Inverter RTC Problem
« Reply #55 on: June 25, 2025, 11:27:30 am »
I just tested if it reads the RTC on power-up only by removing all the power, and that didn't reset the time. So it seems to overwriting the RTC with the incorrect time when it powers down. And the battery must be good.
An interesting test to do is to let the inverter run for a while, read the time and see if it is incorrect. Then power cycle the inverter and see if the time is still wrong. Chances are it only reads the time from the RTC at startup and then uses an internal timer interrupt to count time. If the MCU crystal is off, timer interrupt frequency isn't accurate and/or a programming error has been made to divide the interrupts down to seconds (counting from 0 to 100 instead of 0 to 99 for example) then the time will be wrong.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: nz
Re: Deye Hybrid Inverter RTC Problem
« Reply #56 on: June 25, 2025, 11:44:26 am »
counting from 0 to 100 instead of 0 to 99 for example

Something stupid like that would not surprise me.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline rteodor

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: ro
Re: Deye Hybrid Inverter RTC Problem
« Reply #57 on: June 25, 2025, 12:25:47 pm »
Mandatory joke as there are two RTC's on that board: the engineer with only one RTC know exactly what datetime it is.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 30061
  • Country: nl
    • NCT Developments
Re: Deye Hybrid Inverter RTC Problem
« Reply #58 on: June 25, 2025, 03:56:19 pm »
Mandatory joke as there are two RTC's on that board: the engineer with only one RTC know exactly what datetime it is.
As others have noted: internal RTCs are often far worse where it comes to power consumption versus using an external RTC as the process for the external RTC can be one optimised for low leakage.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #59 on: June 26, 2025, 10:34:54 am »
I now have the RS485 connected and working.
Forgot I was using the RS485/CAN port for the battery CAN bus.
Luckily the AERL battery doesn't connect the RS485 pins so I was able to just parallel the Deye RS485 cable (onlt the two pins connected) I got today and it works.
Deye are sending me a Wifi dongle.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #60 on: June 27, 2025, 10:29:37 pm »
I actually found my WiFi dongle  :palm:
Installed, and OMG the Deye software is soooooo confusing.
But anyway, it's connected to my WiFi and at first it didn't sync the time and I was worried that something was wrong. Tried a heap of stuff.
Went to sleep and woke up to correct time! Well, maybe 30sec off.
Deye told me that it doesn't sync the time unless the internal clock is 5min off networked time, so looks like I can expect +/-5min error  ::)
I'll take the "win".
« Last Edit: June 27, 2025, 11:14:30 pm by EEVblog »
 

Offline Tooms

  • Supporter
  • ****
  • Posts: 105
  • Country: dk
Re: Deye Hybrid Inverter RTC Problem
« Reply #61 on: June 28, 2025, 07:38:16 am »


So with the wifi dongle it is just put on internet access even you dont like that.

was it not possible to write the datetime via modbus on rs485, just os you can keep it offline and update the datetime as often as you like, it seems in this thread there was posted the modbus details for setting the datetime but i can be wrong
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #62 on: June 28, 2025, 08:54:39 am »
Today it drifted by 5min and I just saw it tie sync back. So yes, they allow up to a 5min drift before syncing, why?  :-//
What's the point of a time sync if it's not actually synced?
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #63 on: June 28, 2025, 08:57:02 am »
So with the wifi dongle it is just put on internet access even you dont like that.

Yes.

Quote
was it not possible to write the datetime via modbus on rs485, just os you can keep it offline and update the datetime as often as you like, it seems in this thread there was posted the modbus details for setting the datetime but i can be wrong

I haven't tried it yet, I'd have the figure out how to do that, and I'm not sure if a script could even run the RPi alongside Solar Analytics.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11043
  • Country: fi
Re: Deye Hybrid Inverter RTC Problem
« Reply #64 on: June 28, 2025, 09:25:22 am »
Today it drifted by 5min and I just saw it tie sync back. So yes, they allow up to a 5min drift before syncing, why?  :-//
What's the point of a time sync if it's not actually synced?

The point of having correct clock on battery inverter is to schedule charge-from-grid and self-use modes based on clock-based dynamic electricity pricing. Maybe they concluded that 5 minutes is enough for that. I would disagee; price difference between adjacent hours can be pretty significant, so doing 5 minutes of the Wrong Thing becomes significant on the bill in the long run. You can work around that by timing grid charge starting at :05 minutes instead of :00, but you need to know about this feature and remember to do that.

Why not 30 seconds or something sensible like that?

Maybe the firmware is stupid enough to do a flash write when time registers are written to; maybe they are limiting these write cycles.
« Last Edit: June 28, 2025, 09:28:07 am by Siwastaja »
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 9692
  • Country: nl
  • Current job: ATEX product design
Re: Deye Hybrid Inverter RTC Problem
« Reply #65 on: June 28, 2025, 10:48:31 am »
Today it drifted by 5min and I just saw it tie sync back. So yes, they allow up to a 5min drift before syncing, why?  :-//
What's the point of a time sync if it's not actually synced?
Probably some database saving and energy calculation reasons. Like if you measure the power as 1KW for 59 minutes, and your RTC is set to 60 minutes, do you call that 1KWh or 59/60KWh?
I'm not saying its a good reason, but its the only sensible I can think of.
IDK how they couldn't have a proper RTC circuit in the first place though. Sounds like the FW team messed up big time.
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2893
  • Country: fr
    • kripton2035 schematics repository
Re: Deye Hybrid Inverter RTC Problem
« Reply #66 on: June 28, 2025, 01:31:11 pm »
more on that if you have a few minutes differences with universal time, the wifi credentials will not be accepted !?!?
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #67 on: June 29, 2025, 04:29:38 am »
The point of having correct clock on battery inverter is to schedule charge-from-grid and self-use modes based on clock-based dynamic electricity pricing. Maybe they concluded that 5 minutes is enough for that. I would disagee; price difference between adjacent hours can be pretty significant, so doing 5 minutes of the Wrong Thing becomes significant on the bill in the long run. You can work around that by timing grid charge starting at :05 minutes instead of :00, but you need to know about this feature and remember to do that.

Yes. I have to set my charge timers 5 minutes after and before my free energy window just to be sure. So I'm also wasting 10 minutes of free energy time a day.
It's stupid.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #68 on: July 07, 2025, 01:03:12 am »
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2893
  • Country: fr
    • kripton2035 schematics repository
Re: Deye Hybrid Inverter RTC Problem
« Reply #69 on: July 07, 2025, 06:05:30 am »
how can a company sell devices in 2025 that have a rtc chip, a wifi time sync, and still be off by 5 mins !?!?
 
The following users thanked this post: EEVblog

Online Psi

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: nz
Re: Deye Hybrid Inverter RTC Problem
« Reply #70 on: July 07, 2025, 06:21:30 am »
how can a company sell devices in 2025 that have a rtc chip, a wifi time sync, and still be off by 5 mins !?!?

Bugs + No willingness to fix them.

In rare cases the company is contracting out all the development/maintenance. Since that's so expensive they never spend money unless it's for a new feature they need or unless customers are screaming about a bug.
(I'm not saying this is the case with Deye, just a general comment why bugs sometimes don't get fixed)
« Last Edit: July 07, 2025, 06:29:51 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #71 on: July 07, 2025, 06:52:27 am »
how can a company sell devices in 2025 that have a rtc chip, a wifi time sync, and still be off by 5 mins !?!?

It takes skill.
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2893
  • Country: fr
    • kripton2035 schematics repository
Re: Deye Hybrid Inverter RTC Problem
« Reply #72 on: July 08, 2025, 09:37:29 am »
just saying, my wks inverter does almost the same !
so may all these inverters axpert, voltxxx etc...
 

Offline ZambianRob

  • Newbie
  • Posts: 6
  • Country: zm
Re: Deye Hybrid Inverter RTC Problem
« Reply #73 on: July 08, 2025, 03:58:22 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.
 

Offline rteodor

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: ro
Re: Deye Hybrid Inverter RTC Problem
« Reply #74 on: July 08, 2025, 05:19:52 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 ?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf