Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RS485 Solax X3 #16

Merged
merged 1 commit into from
Jun 5, 2021
Merged

Conversation

barche
Copy link
Contributor

@barche barche commented Jun 2, 2021

This adds a new Input module to read the Solax X3 registers directly from the RS485 interface. Note that I connected to the built-in RJ45 sockets on pins 4 and 5 as described in the "meter connection" in the manual:
Screenshot 2021-06-03 at 01 00 03

What seems really strange to me is that the register addresses are completely off compared to the TCP Modbus input. I had to loop over all possible addresses to find them. I also can't find any documentation on them, hence the many unlabeled registers (the ones I labeled are deduced from the values shown when dumping raw values). These 53 registers are the only ones that don't return an "illegal address" error.

Copy link
Contributor

@deece deece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a couple of minor points, the sample RS485 port should be called something like ttySolaxX3.

There's a copy of the X series docs here: https://github.com/squishykid/solax/files/6147937/Hybrid.X1.X3-G3.ModbusTCP.RTU.V3.21-.English.pdf

I think this patch would support any Solax X series, including the X1 hybrid & retrofit chargers, so references to 'X3' should just be 'X'.

config-sample.toml Outdated Show resolved Hide resolved
@deece
Copy link
Contributor

deece commented Jun 3, 2021

Hmm, the registers in the docs don't align with your code. I wonder if you've stumbled across some other interface designed for the master/slave (parallel control) feature.

With the above docs, I think you may be better off looking at the TCP modbus registers, which hopefully will align.

Side note: the meter pinout in https://www.solaxpower.com/wp-content/uploads/2021/04/X3-Hybrid-User-Manual.pdf seems quite different to what you've posted, which inverter do you have?

@deece
Copy link
Contributor

deece commented Jun 3, 2021

Hmm, I wonder if those docs might only be applicable for the inverters & chargers that support batteries, but not the standalone inverters.

If that's the case, I would suggest reaching out to your local Solax engineer (call them, rather than email), explain that you are trying to implement some monitoring, and see if they can provide you with the documentation for the read-only registers. They should be able to do this without any NDA (they are a bit tighter with access to the write registers).

@barche
Copy link
Contributor Author

barche commented Jun 3, 2021

Yes, it seems to me the hybrid inverters are quite different, here is the user manual for mine: https://www.europe-solarstore.com/download/solax/solax-X3-4.0-T-X3-10.0-T-user-manual.pdf

I had already seen that modbus protocol document, but no luck at all trying to read those registers (Illegal Address for all). And if I use 115200 baud (or braud as Solax call it ;) it won't connect at all. I wonder if it's possible that the "engineer settings tool" and the meter use different pins of the RJ45 socket? I've tried a few, but randomly connecting pins makes me a bit nervous.

@barche
Copy link
Contributor Author

barche commented Jun 3, 2021

Update: having no hope or expectation of any kind, I followed your suggestion and called the nearest Solax service desk. Literally 30 seconds later I had a modbus protocol document in my mailbox that is different from the one for the hybrids, with addresses that match my findings. I'll update this PR accordingly.

Kudos to Solax for their willingness to help.

@deece
Copy link
Contributor

deece commented Jun 3, 2021

Oh that's wonderful news! If you could please send the doc to me too, it will make it easier to review your patches.

You can find my email in the commit history

@barche
Copy link
Contributor Author

barche commented Jun 4, 2021

I have updated the PR with the proper register names. Note that I left the last few about fault codes out, these seem less useful.

@deece deece merged commit 9beaed0 into InfernoEmbedded:master Jun 5, 2021
@deece
Copy link
Contributor

deece commented Jun 5, 2021

Thanks for your efforts :)

@barche barche deleted the solax3-rs485 branch June 5, 2021 11:16
@aeroboy86
Copy link

te: having no hope or expectation of any kind, I followed your suggestion and called the nearest Solax service desk. Literally 30 seconds later I had a mod

@barche : Hello, i know this is a bit of an old topic, however I was wondering if you were able to share the modbus rtu protocol definition you got from the team. I have a X3-MIC/PRO and I would like to tinker with writing a driver for it. Tia

@barche
Copy link
Contributor Author

barche commented Apr 20, 2022

Hello, i know this is a bit of an old topic, however I was wondering if you were able to share the modbus rtu protocol definition you got from the team. I have a X3-MIC/PRO and I would like to tinker with writing a driver for it. Tia

Not publicly, but I can email it to you. You should be able to find my email in the git commit log, send me a mail and I will reply with the document.

@aeroboy86
Copy link

Hello, i know this is a bit of an old topic, however I was wondering if you were able to share the modbus rtu protocol definition you got from the team. I have a X3-MIC/PRO and I would like to tinker with writing a driver for it. Tia

Not publicly, but I can email it to you. You should be able to find my email in the git commit log, send me a mail and I will reply with the document.

Thanks @barche , I'll go have a look for your email now. Cheers

@rand12345
Copy link

Hello, i know this is a bit of an old topic, however I was wondering if you were able to share the modbus rtu protocol definition you got from the team. I have a X3-MIC/PRO and I would like to tinker with writing a driver for it. Tia

Not publicly, but I can email it to you. You should be able to find my email in the git commit log, send me a mail and I will reply with the document.

Hi, @barche just a courtesy message to say I've also sent an email to you regarding those documents.

@CristiXP
Copy link

Hello, did anyone try to fix the Solax Modbus integration for the homeassistant? I am using an X3 Pro and stil cannot manage to work with it. If I try to read anything from the inverter, I am receiving only Illegal adress exception error. Can anyone mail to me also the pdf from solax for this inverter? Thank you! cristian.goian.cg[at]gmail.com

@barche
Copy link
Contributor Author

barche commented Aug 4, 2022

I haven't looked into direct HA integration, it's best to open an issue there. I have the X3 PDF, no idea if that is the same as the X3 Pro, I get the feeling Solax builds a new Modbus protocol for each variant.

@DanielVacha0
Copy link

Hello,

I have a smart meter Solax Eastron SDM630-Modbus V2 3F with adapted firmware directly for Solax. Is it possible to communicate with that smart meter via modbus like you do it with X3 series inverter? If yes, could you provide me some kind of example or send me a link with such exmaple? I found documentation with commands and meaning of bits, but I cannot find how to create a connection and send those commands in script.

Thank you, Daniel.

@barche
Copy link
Contributor Author

barche commented Oct 31, 2022

Yes, you would need to add a new input, pretty much like I did in this PR. See the "Files changed" tab for what kind of changes are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants