Deye Hybrid Inverter RTC Problem - Page 1
Forum section: electronics / general

author: EEVblog
author_rank: Unknown
timestamp: June 10, 2025, 01:02:12 am
content: With my new 3 hour window free energy plan, I've got the Deye inverter set to charge the battery from 11am to 2pm every day with the timer system.Only problem is, I've discovered that the internal RTC clock drifts massively every day. I'm talking 10 minutes per day or something like that. I only set it like 5 days ago and it's now more a hour behind.The only thing I could think of was an incorrect mains frequency setting, but it's set to 50Hz. There are occasional mains frequency drops every day so some unknown reason, but surely it's not mains referenced time?And another problem is I can only reset it from he unit front panel, not via Solar Assistance over the serial line.There is a "Time Sync" option that makes no difference.Anyone got any idea?

author: Poroit
author_rank: Frequent Contributor
timestamp: June 10, 2025, 07:03:22 am
content: It looks like others have had the same problem.https://powerforum.co.za/topic/19005-time-setting-automatically-jumping-ahead-1-hour-on-deye-inverter/

author: EEVblog
author_rank: Unknown
timestamp: June 10, 2025, 07:06:40 am
content: Quote from: Poroit on June 10, 2025, 07:03:22 amThanks. It's not the time sync. And mine drifts in time backwards, not jump forward an hour.

author: rteodor
author_rank: Frequent Contributor
timestamp: June 10, 2025, 03:17:24 pm
content: Quote from: EEVblog on June 10, 2025, 01:02:12 amDoes the inverter has an NTP client in it ? I'm thinking on a badly configured NTP server.Another quite unlikely idea: RTC internal battery - seen something alike with PC motherboards.

author: EEVblog
author_rank: Unknown
timestamp: June 10, 2025, 11:30:18 pm
content: Quote from: rteodor on June 10, 2025, 03:17:24 pmIt's not connected to the internet, only via serial port to the Solar Assistant Raspberry Pi.

author: floobydust
author_rank: Super Contributor
timestamp: June 11, 2025, 02:42:04 am
content: What RTC chip is it using? EEVblog1620last 5kW one has some SOIC-8 with tuning caps, so it's not a DS1307.The Microchip ones have some strange silicon errata (over 11 years lol) oddball hoops to jump through that might be causing this.I would check what RTC is used and for any associated baloney.Otherwise this looks like a firmware problembecause it's way more than a crystal osc could be pulled slow. Once an RTC is set, you leave it alone unless there is some periodic time sync being bungled.

author: nctnico
author_rank: Super Contributor
timestamp: June 11, 2025, 07:44:25 am
content: Quote from: EEVblog on June 10, 2025, 01:02:12 amIt could be. If you measure the mains frequency over the course of a few days you should be able to correlate the offset.

author: EEVblog
author_rank: Unknown
timestamp: June 11, 2025, 11:06:10 am
content: Quote from: nctnico on June 11, 2025, 07:44:25 amThe 50Hz is bang on on average.The drops are not the mains, it's something unknown in the internal measurement in the Deye.

author: EEVblog
author_rank: Unknown
timestamp: June 11, 2025, 11:21:34 am
content: I got a reply from Deye:Quote

author: Psi
author_rank: Super Contributor
timestamp: June 11, 2025, 11:27:07 am
content: So your choice is to pay for a 4G connection.Or can you just put it on your home network somehow?If forced to pay 4G I think I would just rip it open and change the crystal caps, assuming they are easy to get to without needing to remove too much.Should be able to fix the drift with a few cap changes. Or maybe just caps + new known good crystal. That would probably be quicker than trying to retune the existing crystal.

author: tszaboo
author_rank: Super Contributor
timestamp: June 11, 2025, 11:32:37 am
content: Quote from: EEVblog on June 11, 2025, 11:21:34 amNot that industrial 4G is very expensive if you buy thousands of SIM cards, but.Don't they have Wifi?I have the Ethernet (wifi) modbus connection open on my inverter so I can practically do whatever I want with it.

author: thm_w
author_rank: Super Contributor
timestamp: June 12, 2025, 11:50:18 pm
content: It doesn't come with built in wifi or ethernet, you'd need a special dongle, don't think Dave bought that and maybe didn't want it hooked up via cloud.https://www.facebook.com/groups/849427822349939/posts/1417915002167882/- this guy says 1 minute slow per monthhttps://www.facebook.com/groups/419156130163742/posts/856197569792927/- this one says off by 10 minute per month and that it uses the grid, and "time sync" option didnt work even with internet.I don't think your grid would actually be off by that much:https://www.eevblog.com/forum/projects/ac-power-line-frequency-accuracy-question/but maybe its a bug where it stops counting during those dropouts?There is a modbus command that might be able to set time:https://github.com/Hypfer/deye-microinverter-cloud-free-assets/blob/master/Deye_Modbus.-.-.V118.pdfmaybe solar assistant hasn't implemented it properly, or its read only.Otherwise can you just ignore the time completely and use software to enable and disable the battery charging based on network time?

author: EEVblog
author_rank: Unknown
timestamp: June 13, 2025, 12:30:24 am
content: Quote from: thm_w on June 12, 2025, 11:50:18 pmI did get a dongle with it but didn't want to use it for that cloud reason.And now I have the Solar Assistant hooked up to the port.Deye responded asking if I can use the special USB-485 cable to free up the RS232 for the WiFi dongle.If that still doesn't work they will replace the display board.So it seems they think I have a hardware RTC fault.

author: kripton2035
author_rank: Super Contributor
timestamp: June 13, 2025, 06:47:39 am
content: I have a wks hybrid inverter, which is more or less than all these growatt,deye,volt you name it invertersI noticed the same behavior the time is not correctand mine is also not connected to internet (and the chinese servers...)so I ended up building a small esp32c3 mini board connected in serial to the inverterthere is a command to set the time, I 'm connected to my home wifi and ntpand I set the time of the inverter every 5 minsworks fine.edit: the esp32c3 can also do other nice things...

author: EEVblog
author_rank: Unknown
timestamp: June 13, 2025, 10:50:46 am
content: Quote from: EEVblog on June 13, 2025, 12:30:24 amIn a further email they said it would be a new board design that would not have this issue.Sounds like they knew it was a bad design in terms of RTC and they don't want to flat out tell me that.

author: tszaboo
author_rank: Super Contributor
timestamp: June 13, 2025, 10:59:18 am
content: Quote from: EEVblog on June 13, 2025, 10:50:46 amI'm just wondering how do you mess up something as simple as an RTC circui?Only thing I can think of is they didn't have a dedicated RTC, and used the 16 MHz (or however much) oscillator for timekeeping.

author: kripton2035
author_rank: Super Contributor
timestamp: June 13, 2025, 11:32:46 am
content: I just think they did not test it, they hope everyone use the internet and ntp connexion and it works ok with ntp.on my inverter I had something like 5mins late or advance every hour ! it was never consistent.

author: rteodor
author_rank: Frequent Contributor
timestamp: June 13, 2025, 11:38:29 am
content: Quote from: tszaboo on June 13, 2025, 10:59:18 am10 minutes drift per day: 600 / 86400 => 6944 ppm. That sounds more like an RC oscillator. Especially if other users found different drift rates.Maybe there's a new video incoming: old board vs. new board....

author: floobydust
author_rank: Super Contributor
timestamp: June 14, 2025, 02:00:02 am
content: I think that's too much skew for a 32.768kHz crystal (down to 32.540). Leads me to think it's a firmware problem with the RTC used.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 14, 2025, 05:28:34 am
content: Quote from: floobydust on June 14, 2025, 02:00:02 amMaybe it does not have a 32768Hz crystal. Or any other crystal.Quote from: tszaboo on June 13, 2025, 10:59:18 amBy initial misjudgement: not understanding that an RTC would be valuable. Software features are easy to add on-demand, but HW cycle is much longer. It is careful balancing trying to guess which features will be important in a few years, without blowing up costs (design time and BOM), especially for a cheap consumer product.

author: rteodor
author_rank: Frequent Contributor
timestamp: June 14, 2025, 05:47:15 am
content: What I wanted to say: if the problem would be internal firmware (actual software) it would drift with the same rate for all users, most likely.Probably they wanted to save on MCU pins and/or XTAL and used an internal RC oscillator. If I am right it then the new board should have some extra XTAL and maybe a slightly different MCU.ATmega's for example have for the internal RC oscillator, a factory calibration accuracy +/-10% and user calibration accuracy +/-1%. In the latter case it would mean a drift up to +/-864 seconds/day.

author: floobydust
author_rank: Super Contributor
timestamp: June 14, 2025, 06:08:15 am
content: Quote from: Siwastaja on June 14, 2025, 05:28:34 amReply #5, the EEV 1620 pics show there is an RTC+tuning fork crystal and coin cell on the board.

author: EEVblog
author_rank: Unknown
timestamp: June 14, 2025, 06:59:51 am
content: Quote from: rteodor on June 14, 2025, 05:47:15 amYes, that's what I'm seeing, something like 600 seconds per day.

author: rteodor
author_rank: Frequent Contributor
timestamp: June 14, 2025, 12:59:23 pm
content: Quote from: floobydust on June 14, 2025, 06:08:15 amYou are right, there seems to be an external RTC chip U15 with crystal Y2:

author: Peabody
author_rank: Super Contributor
timestamp: June 14, 2025, 04:19:54 pm
content: If the RTC chip can be identified, that could provide useful information, particularly if there's an errata for it.In any case, perhaps the RTC's output pin is outputting something that would tell you the frequency of the crystal - 32KHz out, or a slower square wave of some kind.And the creator of the uCurrent may have a way of directly measuring the crystal's frequency without materially affecting that frequency.It just seems if the crystal is running slow, then it might be speeded up with smaller load capacitors. But if the crystal is spot on, then it's a firmware problem - possibly an adjustment register that's being set wrong.

author: rteodor
author_rank: Frequent Contributor
timestamp: June 14, 2025, 05:16:55 pm
content: Anyone knows what MCU is there ?I just looked at GD32F407x and GD32F303x and both have internal RTC.

author: NiHaoMike
author_rank: Super Contributor
timestamp: June 16, 2025, 12:27:10 am
content: Might there be a chance that the flux has not been properly cleaned off causing some leakage that disturbs the oscillator?

author: EEVblog
author_rank: Unknown
timestamp: June 16, 2025, 05:23:17 am
content: Quote from: NiHaoMike on June 16, 2025, 12:27:10 amRC oscillators are internal to the chip.

author: floobydust
author_rank: Super Contributor
timestamp: June 16, 2025, 09:33:16 pm
content: An RTC can lose time if it is not read properly, cheaper ones are not double-buffered, some have a busy flag or hoops to jump when doing a read etc. so the counters fall behind if you are reading the RTC in a constant barrage or doing it wrong. They are slow, simple state machines.An RTC can run fast due to poor PCB layout with high speed traces near the xtal oscillator traces, you get extra clock counts. Or EMI from the inverter loose wiring, ungrounded xtal case etc.One check is with the inverter powered off, how the RTC does running off just battery for say a day.

author: thm_w
author_rank: Super Contributor
timestamp: June 16, 2025, 11:23:44 pm
content: That is conformal coating, not flux, though its kind of nonsensically applied. Normally you'd cover all fine pitch pins.Teardown part numbers:-GD32F427-DS1302ZAssuming this "Deye SUN-5K-SG04LP1 5kW" is the same as Daves unit.The spec for the GD32 with RTC on is less than 10uA, so that would last 2.5+ years on the shelf, maybe that wasn't enough for them, or they couldn't get that number, or didn't want to bother and put the RTC IC in.I don't see any issues with the layout.

author: EEVblog
author_rank: Unknown
timestamp: June 16, 2025, 11:42:03 pm
content: Quote from: thm_w on June 16, 2025, 11:23:44 pmMine is the same unit, just like the extreme teardown here:But Deye have hinted that there is a new design board. So maybe I've got an old design that uses RC timer.It would be really hard to goof up the design of a proper RTC chip like that. The only way would be in the implementation, e.g. you read the time out once on boot-up and then rely on an internal CPU timer or whatever from that point on.I guess I could test that by entirely powering off the unit at night and then switching it back on. And if the time comes back correct then they have goofed it as described.I do actually have that spare board form that teardown, but it's practically impossible to replace, as you have to gut the entire unit to get to it.So even if they sent me new board, I really wouldn't be able to replace it.

author: Peabody
author_rank: Super Contributor
timestamp: June 17, 2025, 03:36:33 am
content: The DS1302 has twin 6pf crystal load capacitors built in. If there are also external load capacitors, as it appears is the case, perhaps that's slowing things down.

author: EEVblog
author_rank: Unknown
timestamp: June 17, 2025, 03:59:51 am
content: Quote from: Peabody on June 17, 2025, 03:36:33 amPossible. But not something I can easily test.

author: kripton2035
author_rank: Super Contributor
timestamp: June 17, 2025, 06:07:52 am
content: Quoteso the solution I gave you earlier to sent the time from ntp using the inverter serial port make sense...

author: Jeroen3
author_rank: Super Contributor
timestamp: June 17, 2025, 06:37:22 am
content: Quote from: EEVblog on June 14, 2025, 06:59:51 amCan it even measure mains frequency within the required 10 mHz if it's off this much?

author: EEVblog
author_rank: Unknown
timestamp: June 17, 2025, 06:39:54 am
content: Quote from: kripton2035 on June 17, 2025, 06:07:52 amThe problem is that Solar Assistant does not allow this, and it currently uses the serial port.

author: kripton2035
author_rank: Super Contributor
timestamp: June 17, 2025, 10:09:35 am
content: there may also be a rs485 port, or a can port that can be used ?

author: rteodor
author_rank: Frequent Contributor
timestamp: June 17, 2025, 10:37:03 am
content: Quote from: EEVblog on June 17, 2025, 06:39:54 amIt should not be a big hassle to the SA guys to implement a simple command (except if they did but the command is botched as with the RTC).

author: Psi
author_rank: Super Contributor
timestamp: June 17, 2025, 10:10:23 pm
content: Can you give Home Assistant access to the device, maybe in conjunction with an ESPHome using UART output mode, Edit: or modbus if it's one of those ones.Then script HA/ESPHome to login once an hour/day and set the time correctly.You'd probably have to use lambdas in ESPHome if you need some intelligent back and forward uart comms.Would be easier to setup if you can simply send some command to the Deye blind.Might be easier to pass the UART from ESPhome directly into HA and do the logic in HA, but i've never done that myselfI've setup UART stuff on HA with ESPHome before, i use it to turn my projector on/off over RS485 so i know it works.It's really down to how complex the UART protocol is, and how complex the ESPhome script becomes, but should be possible .https://esphome.io/components/uart.html

author: EEVblog
author_rank: Unknown
timestamp: June 17, 2025, 11:44:25 pm
content: Quote from: kripton2035 on June 17, 2025, 10:09:35 amYes, I have ordered an RS485 cable to connect to the Solar Assistant, freeing up the RS232 for the Wifi thingo, but I can't find that

author: EEVblog
author_rank: Unknown
timestamp: June 19, 2025, 11:45:50 pm
content: Deye have now offered to replace the entire inverter for me.I'm actually not sure if this is worth it, as there is significant effort in physically replacing it, AND they want me to return the old unit.And I might be getting a battery upgrade this year under the new government rebate scheme, and AERL have offered a their new 10kW inverter (no details yet though) to replace the 5kW Deye. So if that goes ahead, seems like a waste of time to replace to the Deye?PLus I haven't tried the RS465 cable and Wifi dongle yet (still can't find it though).

author: Tooms
author_rank: Unknown
timestamp: June 23, 2025, 04:15:59 am
content: so what the serial command for setting the time

author: EEVblog
author_rank: Unknown
timestamp: June 23, 2025, 05:12:53 am
content: Quote from: Tooms on June 23, 2025, 04:15:59 amSolar Assistant cannot do it, so

author: Psi
author_rank: Super Contributor
timestamp: June 23, 2025, 07:23:24 am
content: I asked Grok, Google AI and ChatGPT about commands to set the clock on deye inverters over rs232.Pretty sure Google AI and ChatGPT and just making shit up, but you never know. Probably just giving RS232 command formats similar to other devices it has been trained on.Grok was the best. Bit too long to post what it said here, but Grok at least did admitted that there isn't much info available.Grok did find a reference to Deye modbus and time command registers on a diysolarforum.com forum post here.https://diysolarforum.com/threads/deye-inverter-modbus-time-information.76195/So that is interesting.Google AIQuoteChatGPTQuote

author: kripton2035
author_rank: Super Contributor
timestamp: June 23, 2025, 10:17:30 am
content: my wks inverter uses the "max protocol" that many inverter seems to use.I attached the pdf of it , don't know for the deye but this protocol seems ok among many inverters.EDIT: seems the deye uses a complete different protocol !found this :https://fr.scribd.com/document/838419980/MODBUS-RTU-DEYE

author: Siwastaja
author_rank: Super Contributor
timestamp: June 23, 2025, 10:58:05 am
content: Maybe modbus registers 62-64?

author: EEVblog
author_rank: Unknown
timestamp: June 23, 2025, 12:11:57 pm
content: Quote from: Siwastaja on June 23, 2025, 10:58:05 amThanks.I've ordered an RS485 lead, so worth trying. Maybe the Raspberry Pi can run a script every hour to update the time and date.

author: EEVblog
author_rank: Unknown
timestamp: June 23, 2025, 12:13:52 pm
content: Quote from: Psi on June 23, 2025, 07:23:24 amI got the same halucination when I used Grok for this, it also admitted it may not actually know.I've had a couple of poeple tell me it's not possible, but who knows.

author: Psi
author_rank: Super Contributor
timestamp: June 23, 2025, 01:36:26 pm
content: 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.

author: floobydust
author_rank: Super Contributor
timestamp: June 23, 2025, 05:54:43 pm
content: 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 23, 2025, 06:33:52 pm
content: Quote from: Psi on June 23, 2025, 01:36:26 pmIndeed 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.Quote from: floobydust on June 23, 2025, 05:54:43 pmWhat 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 alist of model numbersthat 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 isunlikelyyou 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'spossible.

author: EEVblog
author_rank: Unknown
timestamp: June 23, 2025, 10:44:27 pm
content: 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.

author: Peabody
author_rank: Super Contributor
timestamp: June 23, 2025, 11:02:03 pm
content: Were you able to identify the RTC?

author: Psi
author_rank: Super Contributor
timestamp: June 23, 2025, 11:03:09 pm
content: Quote from: EEVblog on June 23, 2025, 10:44:27 pmI'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

author: nctnico
author_rank: Super Contributor
timestamp: June 25, 2025, 11:27:30 am
content: Quote from: EEVblog on June 23, 2025, 10:44:27 pmAn 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.

author: Psi
author_rank: Super Contributor
timestamp: June 25, 2025, 11:44:26 am
content: Quote from: nctnico on June 25, 2025, 11:27:30 amSomething stupid like that would not surprise me.

author: rteodor
author_rank: Frequent Contributor
timestamp: June 25, 2025, 12:25:47 pm
content: Mandatory joke as there are two RTC's on that board: the engineer with only one RTC know exactly what datetime it is.

author: nctnico
author_rank: Super Contributor
timestamp: June 25, 2025, 03:56:19 pm
content: Quote from: rteodor on June 25, 2025, 12:25:47 pmAs 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.

author: EEVblog
author_rank: Unknown
timestamp: June 26, 2025, 10:34:54 am
content: 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.

author: EEVblog
author_rank: Unknown
timestamp: June 27, 2025, 10:29:37 pm
content: I actually found my WiFi dongleInstalled, 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 errorI'll take the "win".

author: Tooms
author_rank: Unknown
timestamp: June 28, 2025, 07:38:16 am
content: 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

author: EEVblog
author_rank: Unknown
timestamp: June 28, 2025, 08:54:39 am
content: 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?

author: EEVblog
author_rank: Unknown
timestamp: June 28, 2025, 08:57:02 am
content: Quote from: Tooms on June 28, 2025, 07:38:16 amYes.QuoteI 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 28, 2025, 09:25:22 am
content: Quote from: EEVblog on June 28, 2025, 08:54:39 amThe 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.

author: tszaboo
author_rank: Super Contributor
timestamp: June 28, 2025, 10:48:31 am
content: Quote from: EEVblog on June 28, 2025, 08:54:39 amProbably 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.

author: kripton2035
author_rank: Super Contributor
timestamp: June 28, 2025, 01:31:11 pm
content: more on that if you have a few minutes differences with universal time, the wifi credentials will not be accepted !?!?

author: EEVblog
author_rank: Unknown
timestamp: June 29, 2025, 04:29:38 am
content: Quote from: Siwastaja on June 28, 2025, 09:25:22 amYes. 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.

author: kripton2035
author_rank: Super Contributor
timestamp: July 07, 2025, 06:05:30 am
content: how can a company sell devices in 2025 that have a rtc chip, a wifi time sync, and still be off by 5 mins !?!?

author: Psi
author_rank: Super Contributor
timestamp: July 07, 2025, 06:21:30 am
content: Quote from: kripton2035 on July 07, 2025, 06:05:30 amBugs + 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)

author: EEVblog
author_rank: Unknown
timestamp: July 07, 2025, 06:52:27 am
content: Quote from: kripton2035 on July 07, 2025, 06:05:30 amIt takes skill.

author: kripton2035
author_rank: Super Contributor
timestamp: July 08, 2025, 09:37:29 am
content: just saying, my wks inverter does almost the same !so may all these inverters axpert, voltxxx etc...

author: ZambianRob
author_rank: Newbie
timestamp: July 08, 2025, 03:58:22 pm
content: 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.

author: rteodor
author_rank: Frequent Contributor
timestamp: July 08, 2025, 05:19:52 pm
content: Quote from: ZambianRob on July 08, 2025, 03:58:22 pmSo 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 ?

author: ZambianRob
author_rank: Newbie
timestamp: July 08, 2025, 06:28:16 pm
content: 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-solarmanI 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 08, 2025, 06:46:23 pm
content: Quote from: rteodor on July 08, 2025, 05:19:52 pmI 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#L167This 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.

author: ZambianRob
author_rank: Newbie
timestamp: July 08, 2025, 06:57:52 pm
content: 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.

author: rteodor
author_rank: Frequent Contributor
timestamp: July 08, 2025, 07:02:43 pm
content: Quote from: Siwastaja on July 08, 2025, 06:46:23 pmSo 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.

author: ZambianRob
author_rank: Newbie
timestamp: July 08, 2025, 07:11:19 pm
content: 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.pyForgive me if not like I said the coding is a little bit beyond me I know enough to be dangerous.

author: Tooms
author_rank: Unknown
timestamp: July 08, 2025, 07:24:02 pm
content: HiDont 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 ssh2. install modpool>sudo apt install mbpollRead and set time over serialRead and set time over TCP

author: ZambianRob
author_rank: Newbie
timestamp: July 08, 2025, 07:37:44 pm
content: 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.

author: rteodor
author_rank: Frequent Contributor
timestamp: July 08, 2025, 07:45:25 pm
content: 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 ...

author: Tooms
author_rank: Unknown
timestamp: July 08, 2025, 07:45:59 pm
content: if you can try the READ commandvia tcpmodpoll -m tcp -t 4 -r 130 -c 7 <DeyeIP>or via serialmodpoll -m rtu -a 1 -r 130 -c 7 -t 4 -o 3 /dev/ttyUSB0 9600n8then you can see if it return the date time values

author: Tooms
author_rank: Unknown
timestamp: July 08, 2025, 08:00:25 pm
content: based on the post on page 2 in this thread from Siwastajathere 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 9600n8tcp: modpoll -m tcp -r 62 -c 3 -t 3 192.168.1.100if anyone has the deye and can test this and reply the output

author: rteodor
author_rank: Frequent Contributor
timestamp: July 09, 2025, 07:11:21 am
content: Quote from: Tooms on July 08, 2025, 08:00:25 pmBased on Siwastaja's reply #46 then reply #76 and ZambianRob's reply #75 and your reply #80:Code:# repeat the command a few times and check the changes!modpool -m tcp -t 4 -r 22 -c 3 $INVERTER_IP

author: Siwastaja
author_rank: Super Contributor
timestamp: July 09, 2025, 07:37:13 am
content: 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.

author: ZambianRob
author_rank: Newbie
timestamp: July 09, 2025, 07:58:59 am
content: Quote from: Tooms on July 08, 2025, 08:00:25 pmQuote from: rteodor on July 09, 2025, 07:11:21 amQuote from: Siwastaja on July 09, 2025, 07:37:13 amHi 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.htmlI 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 09, 2025, 08:06:20 am
content: Quote from: ZambianRob on July 09, 2025, 07:58:59 amThe 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.

author: rteodor
author_rank: Frequent Contributor
timestamp: July 09, 2025, 08:34:41 am
content: Quote from: ZambianRob on July 09, 2025, 07:58:59 amUps, 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:QuoteLater edit: Not sure if this is comes from Deye or from SolarMan.

author: EEVblog
author_rank: Unknown
timestamp: July 16, 2025, 08:37:34 am
content: Deye have updated my Wifi dongle remotely to update every minuteQuote

author: kripton2035
author_rank: Super Contributor
timestamp: July 16, 2025, 10:06:39 am
content: solar panel inverter soon to be synchronized at ±1µs?