logo elektroda
logo elektroda
X
logo elektroda

Sofar Solar KTL-X Inverter: RS485 MODBUS Integration with Domoticz - Setup & Tips [90]

starob 98010 318
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18723686
    starob
    Level 29  
    I need to integrate the inverter with Domoticz via modbus.
    Since the Wifi logger keeps disconnecting and can't be seen for more time, I wanted to connect to the inverter via RS485.
    I am looking for transmission parameters or how to check and set it.
    In this respect, the Sofar inverters are a failure - everything is "military-secret".
    Does anyone have any additional info on this?

    Thanks
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #3 18724826
    starob
    Level 29  
    I had a connection problem, the RS485 was connected to the inverter manual.
    In desperation I reversed the wires - it worked (?), speed 9600/8/n/1.
    Everything is running, registers in accordance with the attachment
  • #4 18834802
    lukasz_sz21
    Level 2  
    Hello.
    How the electrical connection of the RJ45 plug in the inverter should look like. I am asking because in the manual there are as many as 6 pins and they all have only two descriptions.
  • #5 18835052
    starob
    Level 29  
    Sofar Solar KTL-X Inverter: RS485 MODBUS Integration with Domoticz - Setup & Tips [90]

    Pins 2,3,4 is A+ ; 1,5,6 is B-.
    These pins are shorted in the inverter. Using a ready-made cable, I have transmissions connected to 1 2 and the 120ohm terminator to 3.4 5.6. So that there are no "fringes" hanging on the line.
    Both RJ45 connectors are identical and can be plugged into any
  • #6 18835317
    lukasz_sz21
    Level 2  
    Thank you very much. Very useful information, it's a pity that it is not in the datasheet of the inverter
  • #7 18835325
    starob
    Level 29  
    lukasz_sz21 wrote:
    it is a pity that it is not in the datasheet of the inverter


    .. that's where I took it from.
    Please provide the exact model.
  • ADVERTISEMENT
  • #8 18843290
    TadekK
    Level 12  
    starob wrote:
    I need to integrate the inverter with Domoticz via modbus.
    ....

    Hello after a long break on Elektroda...
    Has your colleague achieved any success in this integration?
    I am just getting started on this topic for the Sofar Solar 5.5 ktl-x inverter and I would love to use the experience and hints ...
    I will not be integrating with Domoticz, just making a simple production and consumption monitor for charging 2 electric cars and then to the Supla cloud, but it does not matter at the level of communication with the inverter ...
    If a colleague wants to reveal what and how he made this communication, maybe we can find a way to revenge...
    Tadeusz Ford-Expert tel. 660 675 026
  • #9 18843447
    lukasz_sz21
    Level 2  
    Hello.
    I combined it with a system based on a SIEMENS PLC. However, at the moment it is in the phase of figuring out the register map, as the SOFAR documentation from 2017 is out of date. The electrical connection was described by a colleague above and it is correct, although in my opinion the documentation is not complete because on pins 1-2 of the RJ45 plug there is RS485 and on pins 3,4,5,6, RS422. When I write a map of registers currently present in SOFAR, I will throw it on the forum
  • #10 18843458
    starob
    Level 29  
    Topic finished.
    The effect as in the topic https://www.elektroda.pl/rtvforum/topic3709584.html#18798223#gallery
    I have an inverter and an additional two-way counter SDM630 connected to the modbusWifi Elfin EW11 converter.
    I wrote a plug-in for domoticz in python, it will display and record only the parameters I am interested in.
    You won't get much out of the original logger (whether wired or WiFi) ... such a gadget for the needs of the cloud.
    TadekK wrote:
    such a simple production and consumption monitor for charging 2 electric cars and then to the Supla cloud

    The data from the inverter will be contaminated with "self-consumption" and it will probably not be possible without an additional counter.
    The cost of the project should be up to PLN 1,000.
    In your case it could look like this:
    1. RS485USB converter connected to RPi.
    2. On RPi - Supla and some python script reading parameters from devices.

    The idea from the "cap" because I don't know Supla and I don't know how to connect it.
    Another way is to install Influx and Grafiana instead of supli, record everything locally.
    There are guides out there.

    Added after 10 [minutes]:

    lukasz_sz21 wrote:
    because on pins 1-2 of the RJ45 plug there is RS485 and on pins 3,4,5,6, RS422.

    I have pins 2,3,4 and 1,5,6 shorted in the inverter, so it's probably not the case?

    Added after 7 [minutes]:

    lukasz_sz21 wrote:
    because SOFAR documentation from 2017 is out of date.

    The one that is in the subject yes.. here you have a better one
  • #11 18843519
    starob
    Level 29  
    I exaggerated a bit (I wrote that I do not know supla :) )
    All you need is the MEW-01 supla meter and the subject
  • #12 18843574
    lukasz_sz21
    Level 2  
    Thank you. these records seem to agree with my discovery of america.
  • #13 18843576
    TadekK
    Level 12  
    starob wrote:
    ...
    All you need is the MEW-01 supla meter and the subject


    I have MEW-01 at the "entrance" to the installation (as a duplicate of the Tauron meter). I considered installing a second one at the output of the inverter, but this is not an ambitious solution considering the possibility of building a much cheaper and more flexible own measurement.
    The "self-consumption" of the inverter does not interest me. I am interested in "useful production" broken down into immediately consumed and delivered to the network. This is the role for MEW-01 - because he will give me this information. Consumed immediately can be multiplied by 0.5556 PLN/kWh, but the one given back must be reduced by the "network commission".
    I just want to make a "countdown to zero" value of outlays for construction, successively reduced by the actual value of the energy produced.
    Such a "whim".

    BTW - I have no problem with a large amount of my energy stored in the network - my roof is too small, the 4.75kWp installation will fit (and after the planned addition of 2 panels it will be less than 5.5kWp) and 10kWp would be "OK". So for me "transferred to storage" during the day is used up immediately in the evening / night ...
  • ADVERTISEMENT
  • #14 18843607
    starob
    Level 29  
    TadekK wrote:
    Such a "whim".

    Will - Your lady
    To sum up - EW11 is the cheapest solution I have found to extract all the information that the inverter provides according to. attached list of registers.
    What you will do with this data is your invention and skills.
    Once you choose a direction, I will try to help.
  • #15 18846494
    TadekK
    Level 12  
    starob wrote:
    ...
    ...I will try to help.

    For now, I haven't connected to the inverter yet, so I'm asking "dry" - how my colleague interpreted these "double registers" (15-16 and 17-18) in the function 3 - those from production - are they uint32 or what's up with them because the description is so confusing...
  • #16 18846780
    starob
    Level 29  
    "total energy" reads as uint32 , 4 bytes from register 0x15.
    I do not know if it is good? For now, it shows correctly - with my production, the error may appear after 2035, which I will notify you immediately :)
  • #17 18846858
    TadekK
    Level 12  
    starob wrote:
    ... which I will notify you immediately :)

    Probably at a similar time I will exceed the limit of 65536kWh of production ...
    With the active exchange of views on the "uint32" effect (analogous to the former "Y2K effect..."), I may have a problem with the fact that I am already a pensioner of the right age...
    How will it be - we'll live, we'll see...
    Thank you and I wish you health and longevity!
  • #18 18884677
    TadekK
    Level 12  
    lukasz_sz21 wrote:
    ... When I write a map of registers currently present in SOFAR, I will throw it on the forum

    starob wrote:
    ...Once you choose a direction, I will try to help.


    It took a while (too many different ideas in retirement...), but I also finally started communication via Modbus RTU with my Sofar Solar... For now in terms of production data. https://www.dropbox.com/s/fjl9v09dxmt6a5z/VID_20200822_183150.mp4?dl=0

    To "go further" I need to get the current date/time from the inverter.

    Have any of your esteemed Colleagues "tracked" the relevant registers?
    I will be obliged for a hint...
  • #19 18895021
    TadekK
    Level 12  
    While waiting for my colleagues to come up with something in the analysis of the purpose of the identified and not described registers of the Sofar Solar inverter, I "worked around the problem" - I just started WiFi in WemoS D1 mini Pro and used the NTP client. I have time - although it's a bit unstable.
    https://youtu.be/cIXboKdwgT8

    If it is possible to read the current time from the inverter, I will return to the topic.
  • #20 18895057
    starob
    Level 29  
    Not really possible, I tried to check the available registers. There is nothing that resembles time. The inverters are probably drawn from the same source, so it will be ok.
  • #21 18963309
    iksilak
    Level 11  
    May I ask a strange question, why do you need these combinations? After all, all this data can be read using the available websites designed for this purpose, e.g. solarmanpv. Is it just to not send it to the network (internet means)?
  • #22 18963619
    TadekK
    Level 12  
    iksilak wrote:
    May I ask a strange question, why do you need these combinations? After all, all this data can be read using the available websites designed for this purpose, e.g. solarmanpv. ...?

    Production is at https://www.solarmanpv.com/, Export and import is at https://logowanie.tauron-dystrybucja.pl/, Own consumption (production used "immediately") is nowhere, and the calculation of the actual economic effect installation requires "a lot of head scratching"...
    I don't like to scratch my head and I prefer to have it shown directly on the screen ... As for kWh / zloty ...
    The picture, of course, requires data from the e-Counter. Since integration with Tauron is almost an "impossible mission" (outside Lower Silesia), I chose integration with Supla (I have MEW-01 meter). Integration via REST works great and the data is practically exactly the same as from Tauron...

    Sofar Solar KTL-X Inverter: RS485 MODBUS Integration with Domoticz - Setup & Tips [90]
  • #23 18964721
    iksilak
    Level 11  
    There is a nice Polish website PVmonitor.pl. I was going to register on their portal someday, from what I remember, unfortunately, they require devices purchased from them, doubling the two-way meter, total energy consumption at home and doubling from the inverter (probably only from fronius they read directly) everything plugged into the device collecting info and sending to your account on the portal and you can read everything in one place with statistics and graphs. I gave up because I don't have space for these meters, all I need is solarmanpv and reading the indications from the PGE meter (of course, only physical ones from the display because they do not provide a preview via the net - I do not understand it) and then manually calculate consumption and overproduction.
  • Helpful post
    #24 18964808
    Krzychooo
    Level 16  
    I've been interested in the subject for a long time, but I can't understand why you make such breakneck inventions to find out what can be read from the meter (1.8 and 2.8) and the inverter (total)?
    I am interested in this because I want to insert information from the current state of the installation into the control of receivers (4 heaters on 3 phases, 1.5 kW each), so as to adjust consumption in REAL TIME to production and avoid maximum accumulation in the network. From what I see you are interested in a summary, i.e. what I wrote at the beginning.
    I'm wrong?
    OK, I don't care, but isn't it better to put the above-mentioned data into a spreadsheet, let's say every week/10 days/month and have everything at your fingertips in any format and on charts?

    I'm just asking, sorry.

    Krzychoo
    8kWp Sofar8.8
  • #25 18965010
    TadekK
    Level 12  
    Krzychooo wrote:
    .... adjust consumption in REAL TIME to production and avoid grid accumulation as much as possible. ...

    All information is collected in real time. I could - if it would give me anything - make any control based on "instantaneous" values ... I have the production state sampled every 10 seconds, the consumption state I sample at the moment (RESTem) every 10 minutes - but I can change it freely. I do not need consumption data more often, because my installation is too small (too small roof ...) for my consumption ... So I never have "overproduction" ...
    And I do it so that it counts for itself and I don't have to copy anything to the spreadsheet once a week..
    In my solution, I have several very nice formats showing the operation of the installation - including the calculation of the "production capacity curve of the installation" as a function of the current time (the algorithm calculates the current angle of incidence of sunlight on my panels from appropriate astronomical formulas ...).
    Sofar Solar KTL-X Inverter: RS485 MODBUS Integration with Domoticz - Setup & Tips [90]
    I like such intellectual games - being a retired IT specialist, I prefer to show off something impressive on WeMos D1 mini Pro (ESP8266) than to solve crossword puzzles ... The cost of all the equipment necessary to carry out my needlework does not exceed PLN 150 ...
    Sofar Solar KTL-X Inverter: RS485 MODBUS Integration with Domoticz - Setup & Tips [90]

    I did not include the price of the MEW-01 meter above (it kills a bit ...), but I am having unofficial talks with people from Tauron to be able to read my meter through their "AMI-Plus interface" and be able to eliminate the "doubling Tauron MEW-01". ..
  • #27 18969472
    TadekK
    Level 12  
    starob wrote:
    ... without the grace of tauron. ...


    Tauron's "Without Grace" can't be helped.
    Each meter has individual communication encryption keys.
    It is necessary for Tauron to officially hand over the key to the user of the meter.
    And let it be...
    I don't need the HA plugin for anything because I don't use HA.
    There is an application for any linux that uses the DVBT USB RTL tuner to implement WMBUS - https://github.com/xaelsouth/rtl-wmbus, and this in turn allows you to handle many different meters - including the Tauron one - https://github.com /weetmuts/wmbusmeters

    Just such a DVBT tuner - https://allegrolokalnie.pl/oferta/tuner-dvb-t-rtl2832u-skaner-new-sdr

    And it makes some sense, because for PLN 50 (and not PLN 400 as in the case of MEW-01 ...) you have a consumption reading. The disadvantage is that you have to put some linux on it and put REST on it again to transfer the values read from the counter.
  • #28 18969600
    starob
    Level 29  
    .. Ok, you want to go this way.
  • #29 19015451
    wilk125
    Level 23  
    If someone needs to extract data from the sofar via modbus, I am making such an option in the lan controller (Lk3.8) https://tinycontrol.pl/pl/lan-controller-35/ . I also have a bi-directional (3-phase) SDM72D-M meter connected, to measure what the inverter will produce, also reading via modbus via LK. LK sends data via mqtt to the server (own or mqtt.ats.pl - free) or via http with GET queries.
    If I installed this SDM72D-M right after the tauron meter, I have a full picture of what the inverter produced (from the inverter reading), what went to the tauron and what I downloaded from the tauron (SDM). Inverter and SDM connected on the same two-wire cable to LK.

    The cost of SDM72D about PLN 200, the cost of LK about PLN 250. You can add a second SDM to control the inverter, but I don't think it makes sense, I see small discrepancies at home.

    I attach a screenshot from LK (SDM72 reading) and a graph of the instantaneous power inverter (reading every 20 seconds).

    Sofar Solar KTL-X Inverter: RS485 MODBUS Integration with Domoticz - Setup & Tips [90] Sofar Solar KTL-X Inverter: RS485 MODBUS Integration with Domoticz - Setup & Tips [90]

Topic summary

The discussion revolves around integrating the Sofar Solar KTL-X inverter with Domoticz via RS485 Modbus, addressing issues related to communication, configuration, and data retrieval. Users share experiences with various setups, including the use of Ethernet-to-RS485 converters and the LSW-3 logger. Key points include the need for correct transmission parameters (9600 baud, 8 data bits, no parity, 1 stop bit), the importance of proper wiring, and the challenges faced when using different firmware versions. Participants also discuss the mapping of Modbus registers for accurate data reading and the potential for using Node-RED for automation. Solutions for common problems, such as timeouts and data retrieval errors, are provided, along with suggestions for configuring Home Assistant for monitoring.
Summary generated by the language model.
ADVERTISEMENT