logo elektroda
logo elektroda
X
logo elektroda

PV InverterBroker, a Linux-based programme for communicating with Sofar's KTL and KTL-X family of in

michal.zd 588 56
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21407292
    michal.zd
    Level 28  
    Hello.
    I have created a separate topic separating from the thread: https://www.elektroda.pl/rtvforum/topic4095968.html
    topic PV Inverter Broker .
    Together with @Daro1003 we are testing the program inverterbroker .
    This is my own program written under Linux, initially running on a router running OpenWrt, then on a laptop running Debian to finally sit on a Raspberry Pi.
    It communicates with the Sofar inverter, passing data from it via the Wifi logger LSW-3 to the mqtt server, mosquitto. Further this data is at your discretion, I use node-red.
    The source code and binaries for Raspberry processors are here: https://github.com/michalzd/pvInverterBroker/tree/mqtt.
    For this you need the library: https://github.com/michalzd/MQTT_LinuxLib

    I've had the program running on a RaspberryPi 1B+ for over a year now, and the information from it is used to turn on the DHW cylinder heat pump and additionally the heaters when the voltage exceeds 252V without letting it exceed the magic 253V.

    I have an on-grid Sofar 15KTL-X G3.
    Colleague @Daro1003 has installed at his place and is testing on a Sofar HYD 15KTL hybrid inverter.
    It looks like the modbus data is identical across the KTL family[/i].

    Added after 10 [minutes]:

    I separated for one reason.
    @Daro1003's tests show an anomaly:
    as long as the panels are giving some energy, the power transmitted by the inverter is correct, but once it is dark and there is no energy from them, the power value :
    is from the hours when it is still light, the power sent to the grid P 310 or 31W (the power the inverter returns in decaWatts) :
    Console display showing JSON data from an inverter. .
    In the moment of darkness it is 65531
    Screenshot showing inverter data in JSON format.

    Today it occurred to me that this is a number with a sign. As the modbus register data is 16-bit, I converted 65536 - 65531 = -5 W.
    Daro wrote back to me on pw: "This may be correct because I have 6W per phase on the PZEM 004T meter."
    As I also have phase voltages and phase currents among the information from the inverter, I calculated this as well.
    It comes out for the selected phase: 241.4 V * 0.02 A = 4.828 W. A little less, but let's say that's it.
    The question is why the power shown in the ActivePowerOutputTotal register is not the sum of all phases?
    This is only the case when there is no power from the panels, if they are working the ActivePowerOutputTotal power is correct.
    At my place I am not able to check this, I do not have a hybrid.
    Do you have a problem with Raspberry? Ask question. Visit our forum Raspberry.
  • ADVERTISEMENT
  • #2 21408334
    Daro1003
    Level 33  
    michal.zd wrote:
    Daro wrote me back on pw: "This may be correct because on the PZEM 004T meter I have 6W per phase."
    .

    I'll throw in a screen shot from Tasmota with the super accuracy of the PZEM 004T modules may be rife but here are the indications as it is dark.

    Screenshot from Tasmota showing precise readings of PZEM 004T modules related to photovoltaics.
  • ADVERTISEMENT
  • #3 21408458
    michal.zd
    Level 28  
    michal.zd wrote:
    ActivePowerOutputTotal
    .
    I found the documentation, it is as I guessed: type int_16, so that the sign, description:
    Total Active power.Charge is positive,Discharge is negative,
    But only valid for HYD 5 ... 20K-3PH and HYD3 ... 6K-EP.
    For online inverters it is without sign, known.
  • #4 21408477
    Daro1003
    Level 33  
    That is, these are negative values, so it would be good if it then displayed, for example, -6 or some sensible information.
  • #5 21408498
    michal.zd
    Level 28  
    Daro1003 wrote:
    That is, these are negative values so it would be good if it would then display e.g. -6 or some sensible information.
    .
    This will be done, it will go into mqtt correctly.
  • ADVERTISEMENT
  • Helpful post
    #6 21408582
    Daro1003
    Level 33  
    I look forward to seeing the results. I think many people will benefit @michal.zd from your work.

    Added after 7 [hours] 38 [minutes]: .

    Today I caught a reading in the morning as it goes from night to day:

     PV State:0 Power[dekaWaty]: 65535 Avg: 3851;  RST [decyVolty]:2394 2402 2399  [centyAmpery]: 147 140 150  Avg: 2383 2410 2400
     PV State:0 Power[dekaWaty]: 65535 Avg: 58250;  RST [decyVolty]:2392 2400 2396  [centyAmpery]: 147 139 150  Avg: 2384 2409 2399
     PV State:0 Power[dekaWaty]: 65535 Avg: 58250;  RST [decyVolty]:2393 2402 2395  [centyAmpery]: 145 138 151  Avg: 2385 2409 2399
     PV State:0 Power[dekaWaty]: 65535 Avg: 17242;  RST [decyVolty]:2392 2401 2393  [centyAmpery]: 144 137 150  Avg: 2386 2408 2399
     PV State:0 Power[dekaWaty]: 65535 Avg: 17242;  RST [decyVolty]:2394 2400 2389  [centyAmpery]: 140 134 147  Avg: 2386 2408 2398
     PV State:0 Power[dekaWaty]: 65535 Avg: 52425;  RST [decyVolty]:2392 2397 2387  [centyAmpery]: 135 131 133  Avg: 2388 2406 2396
     PV State:0 Power[dekaWaty]: 65535 Avg: 52425;  RST [decyVolty]:2387 2394 2386  [centyAmpery]: 133 133 132  Avg: 2387 2405 2396
     PV State:0 Power[dekaWaty]: 1 Avg: 49928;  RST [decyVolty]:2383 2394 2384  [centyAmpery]: 132 130 131  Avg: 2388 2404 2395
     PV State:0 Power[dekaWaty]: 1 Avg: 49928;  RST [decyVolty]:2391 2395 2358  [centyAmpery]: 131 130 131  Avg: 2389 2404 2392
     PV State:0 Power[dekaWaty]: 1 Avg: 59575;  RST [decyVolty]:2397 2405 2368  [centyAmpery]: 132 131 132  Avg: 2393 2402 2389
     PV State:0 Power[dekaWaty]: 1 Avg: 25641;  RST [decyVolty]:2393 2401 2367  [centyAmpery]: 132 130 132  Avg: 2394 2401 2385
     PV State:0 Power[dekaWaty]: 1 Avg: 25641;  RST [decyVolty]:2392 2399 2367  [centyAmpery]: 132 130 132  Avg: 2394 2401 2385
     PV State:0 Power[dekaWaty]: 3 Avg: 43688;  RST [decyVolty]:2397 2400 2365  [centyAmpery]: 132 131 132  Avg: 2393 2400 2382
     PV State:0 Power[dekaWaty]: 2 Avg: 43688;  RST [decyVolty]:2396 2397 2362  [centyAmpery]: 131 130 132  Avg: 2393 2400 2381
     PV State:0 Power[dekaWaty]: 2 Avg: 28833;  RST [decyVolty]:2401 2402 2366  [centyAmpery]: 131 131 132  Avg: 2393 2399 2378
     PV State:0 Power[dekaWaty]: 2 Avg: 28833;  RST [decyVolty]:2401 2405 2369  [centyAmpery]: 131 131 132  Avg: 2393 2400 2379
     PV State:0 Power[dekaWaty]: 4 Avg: 40327;  RST [decyVolty]:2376 2402 2389  [centyAmpery]: 131 131 131  Avg: 2392 2400 2378
     PV State:0 Power[dekaWaty]: 3 Avg: 40327;  RST [decyVolty]:2365 2408 2396  [centyAmpery]: 132 131 132  Avg: 2391 2400 2378
     PV State:0 Power[dekaWaty]: 3 Avg: 16988;  RST [decyVolty]:2365 2408 2396  [centyAmpery]: 131 131 131  Avg: 2388 2401 2378
     PV State:0 Power[dekaWaty]: 5 Avg: 16988;  RST [decyVolty]:2375 2414 2402  [centyAmpery]: 131 131 132  Avg: 2389 2401 2379
     PV State:0 Power[dekaWaty]: 4 Avg: 37447;  RST [decyVolty]:2374 2403 2391  [centyAmpery]: 131 131 132  Avg: 2387 2402 2378
     PV State:0 Power[dekaWaty]: 5 Avg: 37447;  RST [decyVolty]:2375 2392 2383  [centyAmpery]: 131 131 131  Avg: 2387 2400 2378
     PV State:0 Power[dekaWaty]: 5 Avg: 56494;  RST [decyVolty]:2383 2386 2390  [centyAmpery]: 131 131 131  Avg: 2386 2399 2378
     PV State:0 Power[dekaWaty]: 6 Avg: 56494;  RST [decyVolty]:2390 2387 2385  [centyAmpery]: 131 131 132  Avg: 2386 2399 2377
     PV State:0 Power[dekaWaty]: 6 Avg: 34951;  RST [decyVolty]:2395 2359 2381  [centyAmpery]: 130 131 131  Avg: 2387 2396 2377
     PV State:0 Power[dekaWaty]: 8 Avg: 34951;  RST [decyVolty]:2400 2368 2387  [centyAmpery]: 130 131 132  Avg: 2388 2397 2377
     PV State:0 Power[dekaWaty]: 9 Avg: 4227;  RST [decyVolty]:2400 2369 2386  [centyAmpery]: 130 131 132  Avg: 2389 2394 2380
     PV State:0 Power[dekaWaty]: 10 Avg: 4227;  RST [decyVolty]:2402 2371 2387  [centyAmpery]: 131 132 132  Avg: 2389 2394 2380
     PV State:0 Power[dekaWaty]: 10 Avg: 65535;  RST [decyVolty]:2404 2395 2359  [centyAmpery]: 131 131 132  Avg: 2390 2393 2379
     PV State:0 Power[dekaWaty]: 11 Avg: 65535;  RST [decyVolty]:2397 2390 2366  [centyAmpery]: 131 132 132  Avg: 2389 2393 2380
     PV State:0 Power[dekaWaty]: 12 Avg: 61563;  RST [decyVolty]:2394 2385 2392  [centyAmpery]: 131 132 133  Avg: 2389 2391 2382
     PV State:0 Power[dekaWaty]: 13 Avg: 61563;  RST [decyVolty]:2391 2383 2387  [centyAmpery]: 132 132 133  Avg: 2389 2391 2382
     PV State:0 Power[dekaWaty]: 13 Avg: 0;  RST [decyVolty]:2385 2369 2384  [centyAmpery]: 131 132 132  Avg: 2388 2388 2384
     PV State:0 Power[dekaWaty]: 14 Avg: 0;  RST [decyVolty]:2388 2384 2388  [centyAmpery]: 132 132 132  Avg: 2388 2390 2385
     PV State:0 Power[dekaWaty]: 15 Avg: 0;  RST [decyVolty]:2387 2379 2385  [centyAmpery]: 132 132 133  Avg: 2387 2387 2386
     PV State:0 Power[dekaWaty]: 16 Avg: 0;  RST [decyVolty]:2385 2376 2389  [centyAmpery]: 133 133 134  Avg: 2386 2387 2387
     PV State:0 Power[dekaWaty]: 18 Avg: 1;  RST [decyVolty]:2388 2381 2388  [centyAmpery]: 133 133 133  Avg: 2389 2384 2386
     PV State:0 Power[dekaWaty]: 20 Avg: 1;  RST [decyVolty]:2389 2383 2391  [centyAmpery]: 133 133 134  Avg: 2389 2384 2386
     PV State:0 Power[dekaWaty]: 22 Avg: 1;  RST [decyVolty]:2388 2383 2393  [centyAmpery]: 134 134 134  Avg: 2390 2381 2385
     PV State:0 Power[dekaWaty]: 23 Avg: 1;  RST [decyVolty]:2384 2380 2392  [centyAmpery]: 134 134 134  Avg: 2390 2381 2385
     PV State:0 Power[dekaWaty]: 25 Avg: 2;  RST [decyVolty]:2385 2376 2372  [centyAmpery]: 135 135 135  Avg: 2391 2379 2384
     PV State:0 Power[dekaWaty]: 26 Avg: 2;  RST [decyVolty]:2382 2378 2392  [centyAmpery]: 135 135 135  Avg: 2390 2380 2386
     PV State:0 Power[dekaWaty]: 29 Avg: 2;  RST [decyVolty]:2378 2373 2387  [centyAmpery]: 137 136 135  Avg: 2389 2378 2386
     PV State:0 Power[dekaWaty]: 30 Avg: 2;  RST [decyVolty]:2387 2380 2393  [centyAmpery]: 138 137 137  Avg: 2390 2379 2387
     PV State:0 Power[dekaWaty]: 32 Avg: 3;  RST [decyVolty]:2377 2380 2391  [centyAmpery]: 139 137 136  Avg: 2388 2380 2387
     PV State:0 Power[dekaWaty]: 33 Avg: 3;  RST [decyVolty]:2369 2378 2388  [centyAmpery]: 140 138 136  Avg: 2387 2380 2387
     PV State:0 Power[dekaWaty]: 35 Avg: 4;  RST [decyVolty]:2366 2378 2389  [centyAmpery]: 141 138 136  Avg: 2383 2381 2387
     PV State:0 Power[dekaWaty]: 37 Avg: 4;  RST [decyVolty]:2367 2378 2391  [centyAmpery]: 143 140 137  Avg: 2383 2381 2387
     PV State:0 Power[dekaWaty]: 39 Avg: 5;  RST [decyVolty]:2368 2379 2394  [centyAmpery]: 144 141 139  Avg: 2381 2379 2390
     PV State:0 Power[dekaWaty]: 41 Avg: 5;  RST [decyVolty]:2371 2381 2394  [centyAmpery]: 145 142 140  Avg: 2381 2380 2390
     PV State:0 Power[dekaWaty]: 42 Avg: 6;  RST [decyVolty]:2369 2377 2391  [centyAmpery]: 144 142 141  Avg: 2379 2379 2390
     PV State:0 Power[dekaWaty]: 44 Avg: 6;  RST [decyVolty]:2370 2384 2392  [centyAmpery]: 146 143 142  Avg: 2377 2379 2391
     PV State:0 Power[dekaWaty]: 46 Avg: 6;  RST [decyVolty]:2370 2390 2394  [centyAmpery]: 148 145 144  Avg: 2377 2380 2391
     PV State:0 Power[dekaWaty]: 48 Avg: 7;  RST [decyVolty]:2382 2384 2390  [centyAmpery]: 148 146 145  Avg: 2377 2380 2391
     PV State:0 Power[dekaWaty]: 50 Avg: 7;  RST [decyVolty]:2383 2384 2390  [centyAmpery]: 149 146 145  Avg: 2377 2380 2391
     PV State:0 Power[dekaWaty]: 53 Avg: 8;  RST [decyVolty]:2382 2382 2392  [centyAmpery]: 151 149 148  Avg: 2376 2380 2391
     PV State:0 Power[dekaWaty]: 55 Avg: 8;  RST [decyVolty]:2388 2388 2398  [centyAmpery]: 153 150 150  Avg: 2377 2381 2392
     PV State:0 Power[dekaWaty]: 57 Avg: 9;  RST [decyVolty]:2391 2391 2394  [centyAmpery]: 155 153 152  Avg: 2377 2382 2392
     PV State:0 Power[dekaWaty]: 58 Avg: 9;  RST [decyVolty]:2391 2389 2396  [centyAmpery]: 154 154 154  Avg: 2377 2382 2392
     PV State:0 Power[dekaWaty]: 60 Avg: 10;  RST [decyVolty]:2374 2398 2400  [centyAmpery]: 156 155 155  Avg: 2376 2384 2393
     PV State:0 Power[dekaWaty]: 62 Avg: 10;  RST [decyVolty]:2379 2395 2397  [centyAmpery]: 157 157 157  Avg: 2377 2384 2393
    
  • #7 21408717
    michal.zd
    Level 28  
    Great, thanks.
    Daro1003 wrote:
    Power[decaWatts]: 65535

    Converting to a negative number will be -1 decaWatts and then grows on the plus side.

    Added after 2 [minutes]:

    michal.zd wrote:
    I converted 65536 - 65531 = -5 W
    .
    Eh, zem about forgot the unit myself. These are decaWatts, so 5deka is 50W drawn from the mains.
  • #8 21408724
    Daro1003
    Level 33  
    michal.zd wrote:
    50W draws from the mains.


    That much it draws from the mains in the evening when idle ?
    Strange why the PZEM only shows 6W or rather it shows reasonably ok because I tested it on light bulbs.
  • #9 21408735
    michal.zd
    Level 28  
    Daro1003 wrote:
    Power[decaWatts]: 1 Avg: 49928; RST [deciVolts]:2383 2394 2384 [centsAmps]: 132 130 131
    .
    I will still recalculate the power on the three phases:
    238,3 × 1,32 = 315,2 W
    Other similar values come out, times three is around 1kW. This is where it doesn't add up for me, 1dekawat?
    I have a request, give from the same time broker information and screenshots of the inverter page. You need to work out what this data relates to. I will look in the documentation, maybe I can find something online.

    Added after 7 [minutes]: .

    Daro1003 wrote:
    This is how much it draws from the network in the evening when idle ?
    Strange why PZEM only shows 6W
    .
    Well there is just something wrong with this value.
    According to the phase voltage and current the values come out close to pzem. As I calculated in the first post:
    for the selected phase: 241.4 V * 0.02 A = 4.828 W.
    If we consider that the resolution of the current measurement by the inverter is 10mA, the difference is within error. A current value of 0.03 would give more than 7.2W.
    Pzem certainly has a resolution of at least 1mA, otherwise there is no point.

    In any case, the sum of the power from all phases is not equal to what it reports as power.
    Something else is here for the hybrid, because in my case it agrees exactly (according to resolution).
  • ADVERTISEMENT
  • #10 21408766
    Daro1003
    Level 33  
    michal.zd wrote:
    I have a request, give from the same time broker information and screenshots of the inverter page.
    .

    You mean the data from Solar Man because there is not much data at the inverter address.
    In SolarMan on the website is also poor.
    And the broker ?

    Added after 2 [minutes]: .

    Here such detailed data from fsal today.
  • #12 21408773
    michal.zd
    Level 28  
    The descriptions of this register for HYD are puzzling:
    ActivePower_Output_Total ; 0.01 kW ; Total Active power. Charge is positive, Discharge is negative;

    The words Charge and Discharge... As if referring to the battery and not the power grid.
    Is there such information on the inverter or solarman website?

    Added after 1 [hour] 8 [minutes]: .

    Eureka !!! Thanks @Daro1003 for the inverter data !!!

    The example of the night brightened everything up:
    Graph with energy data showing voltage, current, and power information. .
    Phase voltages known, but phase current: 0.02A and Power agree with the broker data (slightly different time but no harm done):
     Power[dekaWaty]: 0 ... RST [decyVolty]:2399 2399 2375  [centyAmpery]: 2 2 2
    .
    everything becomes clear.
    The power calculated from the phase voltages and currents gives the total power shown in the inverter as Total Power Consumption.

    The comparison of the data from the morning itself is similar:
    Graph displaying energy production parameters on January 25, 2025, at 07:16:25. .
    which corresponds to the data from the broker (also about the same minute, unfortunately the time accuracy on the solarman is not the same as the broker):
    PV State:0 Power[dekaWaty]: 65535 Avg: 3851;  RST [decyVolty]:2394 2402 2399  [centyAmpery]: 147 140 150  Avg: 2383 2410 2400
     PV State:0 Power[dekaWaty]: 65535 Avg: 58250;  RST [decyVolty]:2392 2400 2396  [centyAmpery]: 147 139 150  Avg: 2384 2409 2399
    .

    All clear.
  • #13 21408964
    Daro1003
    Level 33  
    I am still throwing in data from the broker from the current hour:

     PV State:0 Power[dekaWaty]: 349 Avg: 269;  RST [decyVolty]:2347 2321 2375  [centyAmpery]: 515 511 513  Avg: 2339 2339 2362
     PV State:0 Power[dekaWaty]: 359 Avg: 269;  RST [decyVolty]:2376 2323 2351  [centyAmpery]: 528 524 526  Avg: 2342 2339 2359
     PV State:0 Power[dekaWaty]: 387 Avg: 272;  RST [decyVolty]:2379 2356 2356  [centyAmpery]: 565 560 562  Avg: 2346 2341 2359
     PV State:0 Power[dekaWaty]: 380 Avg: 272;  RST [decyVolty]:2378 2362 2353  [centyAmpery]: 555 551 553  Avg: 2346 2342 2359
     PV State:0 Power[dekaWaty]: 387 Avg: 274;  RST [decyVolty]:2371 2376 2344  [centyAmpery]: 565 561 562  Avg: 2350 2347 2359
     PV State:0 Power[dekaWaty]: 413 Avg: 274;  RST [decyVolty]:2374 2375 2356  [centyAmpery]: 599 594 596  Avg: 2351 2347 2360
     PV State:0 Power[dekaWaty]: 487 Avg: 278;  RST [decyVolty]:2382 2390 2363  [centyAmpery]: 694 689 690  Avg: 2356 2353 2362
     PV State:0 Power[dekaWaty]: 580 Avg: 278;  RST [decyVolty]:2386 2408 2407  [centyAmpery]: 821 815 817  Avg: 2356 2355 2366
     PV State:0 Power[dekaWaty]: 1032 Avg: 293;  RST [decyVolty]:2403 2413 2441  [centyAmpery]: 1437 1427 1431  Avg: 2363 2360 2375
     PV State:0 Power[dekaWaty]: 961 Avg: 293;  RST [decyVolty]:2415 2412 2422  [centyAmpery]: 1340 1330 1334  Avg: 2364 2360 2373
     PV State:0 Power[dekaWaty]: 983 Avg: 306;  RST [decyVolty]:2415 2395 2427  [centyAmpery]: 1373 1363 1367  Avg: 2374 2363 2380
     PV State:0 Power[dekaWaty]: 1059 Avg: 306;  RST [decyVolty]:2399 2455 2412  [centyAmpery]: 1473 1462 1466  Avg: 2373 2369 2379
     PV State:0 Power[dekaWaty]: 759 Avg: 314;  RST [decyVolty]:2424 2417 2421  [centyAmpery]: 1060 1052 1055  Avg: 2383 2374 2386
     PV State:0 Power[dekaWaty]: 882 Avg: 314;  RST [decyVolty]:2425 2415 2422  [centyAmpery]: 1230 1221 1224  Avg: 2383 2374 2386
     PV State:0 Power[dekaWaty]: 924 Avg: 325;  RST [decyVolty]:2411 2440 2428  [centyAmpery]: 1284 1275 1278  Avg: 2388 2384 2391
     PV State:0 Power[dekaWaty]: 751 Avg: 325;  RST [decyVolty]:2412 2420 2418  [centyAmpery]: 1051 1043 1046  Avg: 2388 2382 2390
     PV State:0 Power[dekaWaty]: 723 Avg: 332;  RST [decyVolty]:2406 2424 2418  [centyAmpery]: 1031 1023 1026  Avg: 2391 2392 2394
     PV State:0 Power[dekaWaty]: 714 Avg: 332;  RST [decyVolty]:2411 2420 2419  [centyAmpery]: 1000 992 995  Avg: 2392 2391 2394
     PV State:0 Power[dekaWaty]: 870 Avg: 342;  RST [decyVolty]:2422 2443 2418  [centyAmpery]: 1210 1201 1204  Avg: 2399 2403 2397
     PV State:0 Power[dekaWaty]: 848 Avg: 342;  RST [decyVolty]:2434 2428 2422  [centyAmpery]: 1205 1196 1199  Avg: 2401 2401 2398
     PV State:0 Power[dekaWaty]: 644 Avg: 347;  RST [decyVolty]:2414 2429 2401  [centyAmpery]: 905 898 900  Avg: 2404 2412 2403
     PV State:0 Power[dekaWaty]: 632 Avg: 347;  RST [decyVolty]:2429 2406 2435  [centyAmpery]: 885 878 881  Avg: 2406 2410 2406
     PV State:0 Power[dekaWaty]: 640 Avg: 352;  RST [decyVolty]:2442 2444 2419  [centyAmpery]: 884 877 880  Avg: 2412 2418 2413
     PV State:0 Power[dekaWaty]: 728 Avg: 352;  RST [decyVolty]:2442 2436 2427  [centyAmpery]: 1012 1004 1007  Avg: 2412 2417 2414
     PV State:0 Power[dekaWaty]: 780 Avg: 780;  RST [decyVolty]:2398 2477 2418  [centyAmpery]: 1084 1077 1079  Avg: 2415 2427 2420
     PV State:0 Power[dekaWaty]: 759 Avg: 780;  RST [decyVolty]:2388 2458 2418  [centyAmpery]: 1060 1052 1055  Avg: 2414 2425 2420
     PV State:0 Power[dekaWaty]: 728 Avg: 728;  RST [decyVolty]:2394 2438 2422  [centyAmpery]: 1018 1011 1014  Avg: 2414 2428 2421
     PV State:0 Power[dekaWaty]: 633 Avg: 680;  RST [decyVolty]:2383 2426 2422  [centyAmpery]: 891 885 887  Avg: 2411 2430 2421
     PV State:0 Power[dekaWaty]: 786 Avg: 680;  RST [decyVolty]:2389 2427 2429  [centyAmpery]: 1166 1158 1161  Avg: 2412 2430 2422
     PV State:0 Power[dekaWaty]: 563 Avg: 641;  RST [decyVolty]:2378 2409 2419  [centyAmpery]: 797 791 793  Avg: 2410 2425 2423
     PV State:0 Power[dekaWaty]: 602 Avg: 641;  RST [decyVolty]:2374 2420 2419  [centyAmpery]: 851 845 847  Avg: 2409 2426 2423
     PV State:0 Power[dekaWaty]: 602 Avg: 631;  RST [decyVolty]:2370 2433 2422  [centyAmpery]: 848 842 844  Avg: 2404 2428 2423
     PV State:0 Power[dekaWaty]: 619 Avg: 631;  RST [decyVolty]:2358 2445 2409  [centyAmpery]: 883 877 879  Avg: 2403 2429 2421
     PV State:0 Power[dekaWaty]: 788 Avg: 662;  RST [decyVolty]:2373 2449 2413  [centyAmpery]: 1105 1097 1100  Avg: 2399 2432 2421
     PV State:0 Power[dekaWaty]: 675 Avg: 662;  RST [decyVolty]:2365 2456 2419  [centyAmpery]: 948 941 944  Avg: 2398 2433 2421
    
    .
  • #14 21409303
    michal.zd
    Level 28  
    I have had a look at the graphs from today. Preliminarily, I can say that the value returned by the broker from the ActivePower_Output_Total register corresponds to the blue line on this graph, minus the inverter's own losses. The data to their cloud is sent every few minutes, so this graph on the solarman site is approximated.
    The broker checks in every half an inverter minute, the data is more accurate :
    Chart comparing production and consumption power with marked date and time. .

    In this graph you can better see the difference between ActivePower_Output_Total and the blue 'Production Power' and the red ActivePower_Output_Total underneath it :
    Graph showing total power generation and total AC output power. .

    Consumption power is missing from the total picture.

    Another view, here you can see exactly which value it is:
    Screenshot showing PV device data, including AC output power and voltages. .
  • #15 21409315
    Daro1003
    Level 33  
    michal.zd wrote:
    The whole picture lacks consumable power.



    Pie charts showing energy production, consumption, and self-sufficiency. .

    In this graph we have self-sufficiency and consumption I don't know just how to understand it.
  • #16 21409330
    michal.zd
    Level 28  
    @Daro1003 if you can, check that the broker states a Power value of 65 532 which means -30W
    this is the value from the earlier screenshot

    Added after 1 [minute]:

    Now this is already "Total AC Output Power:-40.00W" or 65,531
  • #17 21409338
    Daro1003
    Level 33  
    At this point it is already flying like this:

     PV State:0 Power[dekaWaty]: 4 Avg: 11;  RST [decyVolty]:2311 2338 2307  [centyAmpery]: 127 127 128  Avg: 2324 2333 2330
     PV State:0 Power[dekaWaty]: 3 Avg: 11;  RST [decyVolty]:2304 2329 2299  [centyAmpery]: 127 126 127  Avg: 2324 2333 2329
     PV State:0 Power[dekaWaty]: 3 Avg: 10;  RST [decyVolty]:2301 2326 2300  [centyAmpery]: 126 126 127  Avg: 2320 2330 2323
     PV State:0 Power[dekaWaty]: 1 Avg: 9;  RST [decyVolty]:2304 2326 2292  [centyAmpery]: 126 126 127  Avg: 2318 2329 2317
     PV State:0 Power[dekaWaty]: 1 Avg: 9;  RST [decyVolty]:2301 2333 2307  [centyAmpery]: 127 127 127  Avg: 2318 2329 2319
     PV State:0 Power[dekaWaty]: 1 Avg: 9;  RST [decyVolty]:2314 2330 2329  [centyAmpery]: 128 127 127  Avg: 2315 2328 2317
     PV State:0 Power[dekaWaty]: 1 Avg: 9;  RST [decyVolty]:2315 2331 2332  [centyAmpery]: 128 127 128  Avg: 2315 2328 2318
     PV State:0 Power[dekaWaty]: 65535 Avg: 8;  RST [decyVolty]:2310 2327 2332  [centyAmpery]: 128 127 128  Avg: 2313 2329 2318
     PV State:0 Power[dekaWaty]: 65535 Avg: 8;  RST [decyVolty]:2313 2328 2326  [centyAmpery]: 127 127 127  Avg: 2314 2329 2318
     PV State:0 Power[dekaWaty]: 65534 Avg: 7;  RST [decyVolty]:2318 2331 2333  [centyAmpery]: 128 127 128  Avg: 2313 2330 2318
     PV State:0 Power[dekaWaty]: 65533 Avg: 7;  RST [decyVolty]:2315 2314 2329  [centyAmpery]: 128 127 127  Avg: 2313 2328 2318
     PV State:0 Power[dekaWaty]: 65534 Avg: 7;  RST [decyVolty]:2326 2309 2334  [centyAmpery]: 128 127 128  Avg: 2312 2326 2318
     PV State:0 Power[dekaWaty]: 65534 Avg: 7;  RST [decyVolty]:2323 2316 2326  [centyAmpery]: 132 128 130  Avg: 2312 2327 2317
     PV State:0 Power[dekaWaty]: 65533 Avg: 6;  RST [decyVolty]:2306 2324 2327  [centyAmpery]: 132 129 130  Avg: 2309 2326 2317
     PV State:0 Power[dekaWaty]: 65533 Avg: 6;  RST [decyVolty]:2320 2335 2326  [centyAmpery]: 133 129 130  Avg: 2311 2327 2317
     PV State:0 Power[dekaWaty]: 65533 Avg: 6;  RST [decyVolty]:2314 2334 2335  [centyAmpery]: 133 129 130  Avg: 2311 2328 2318
     PV State:0 Power[dekaWaty]: 65533 Avg: 6;  RST [decyVolty]:2304 2317 2338  [centyAmpery]: 132 129 130  Avg: 2310 2326 2318
     PV State:0 Power[dekaWaty]: 65533 Avg: 5;  RST [decyVolty]:2309 2320 2342  [centyAmpery]: 132 129 130  Avg: 2310 2324 2322
     PV State:0 Power[dekaWaty]: 65532 Avg: 5;  RST [decyVolty]:2325 2315 2341  [centyAmpery]: 132 130 130  Avg: 2312 2324 2322
     PV State:0 Power[dekaWaty]: 65532 Avg: 5;  RST [decyVolty]:2317 2307 2331  [centyAmpery]: 131 129 129  Avg: 2313 2322 2325
     PV State:0 Power[dekaWaty]: 65532 Avg: 5;  RST [decyVolty]:2320 2309 2334  [centyAmpery]: 132 129 129  Avg: 2313 2322 2325
     PV State:0 Power[dekaWaty]: 65532 Avg: 4;  RST [decyVolty]:2329 2310 2336  [centyAmpery]: 132 130 130  Avg: 2316 2320 2329
     PV State:0 Power[dekaWaty]: 65532 Avg: 4;  RST [decyVolty]:2329 2306 2323  [centyAmpery]: 132 129 130  Avg: 2316 2320 2328
     PV State:0 Power[dekaWaty]: 65532 Avg: 4;  RST [decyVolty]:2315 2311 2326  [centyAmpery]: 131 130 129  Avg: 2317 2318 2330
     PV State:0 Power[dekaWaty]: 65532 Avg: 4;  RST [decyVolty]:2321 2311 2307  [centyAmpery]: 131 130 129  Avg: 2318 2318 2328
     PV State:0 Power[dekaWaty]: 65532 Avg: 4;  RST [decyVolty]:2328 2312 2309  [centyAmpery]: 131 130 129  Avg: 2319 2316 2325
     PV State:0 Power[dekaWaty]: 65532 Avg: 4;  RST [decyVolty]:2325 2318 2318  [centyAmpery]: 131 130 129  Avg: 2319 2316 2326
     PV State:0 Power[dekaWaty]: 65531 Avg: 3;  RST [decyVolty]:2322 2314 2313  [centyAmpery]: 131 130 128  Avg: 2320 2315 2325
     PV State:0 Power[dekaWaty]: 65531 Avg: 3;  RST [decyVolty]:2317 2308 2309  [centyAmpery]: 131 130 128  Avg: 2319 2314 2325
     PV State:0 Power[dekaWaty]: 65531 Avg: 3;  RST [decyVolty]:2327 2318 2321  [centyAmpery]: 131 131 129  Avg: 2321 2315 2324
     PV State:0 Power[dekaWaty]: 65531 Avg: 3;  RST [decyVolty]:2333 2322 2318  [centyAmpery]: 131 130 129  Avg: 2321 2315 2324
     PV State:0 Power[dekaWaty]: 65531 Avg: 3;  RST [decyVolty]:2323 2316 2341  [centyAmpery]: 132 131 129  Avg: 2321 2315 2325 
    .
  • #18 21409342
    michal.zd
    Level 28  
    only now does the sum of the individual phase powers U*I give a total :

    The illustration shows a refrigerator and washing machine with the caption Consumption 1.12 kW. .

    Added after 35 [seconds]:

    Daro1003 wrote:
    PV State:0 Power[decaWatts]: 65531
    .
    own - 40W

    See:

    Diagram of electricity flow between a power grid and a building with solar panels.

    is this value of 1.20 taken from the mains and 1.12 consumption, i.e. in the battery goes.
    A negative value means the battery is charging.
  • #19 21409346
    Daro1003
    Level 33  
    This second diagram shows exactly how much I use the appliance at home:


    Screenshot showing current energy consumption and photovoltaic production at home. .
  • #20 21409368
    michal.zd
    Level 28  
    is this from PZEM?

    anyway, it's already known what the 'Total AC Output Power' value is - it's the power of the PV panels minus the charging power of the storage, that's some concrete.
    As I wrote, it would be useful to know the 'Consumption' to make sense of the HEMS/MEMS algorithm.

    It is also not clear what the values are:
    Table with voltage and current values for three phases R, S, T. .
    and these values are given by the broker after RST
    Quote:
    RST [deciVolts]:2323 2316 2341 [centsAmps]: 132 131 129
    .
    Total power by U*I is 912.5W, does not match the value given in the first image:
    Network: 1.30kW and Consumption:1.24kW

    maybe you can find a link with what PZEM shows ?
  • #21 21409383
    Daro1003
    Level 33  
    michal.zd wrote:
    this from PZEMs?
    .

    Yes exactly.

    Added after 43 [seconds]:

    michal.zd wrote:
    as I wrote, it would be useful to know the 'Consumption' to make sense of the HEMS/MEMS algorithm
    .

    Hmm then where to mount PZEMs or some sort of counter ?
  • #22 21409387
    michal.zd
    Level 28  
    Daro1003 wrote:
    where to fit PZEMs
    .
    where do you currently have them? Behind the inverter on the house network or in front of the inverter on the meter side?

    i think somewhere this information is also available via modbus, currently i don't read it because i don't have this data. I will see later in the documentation.
    We are aiming to get everything we need out of the inverter.
    In addition, we have these voltages and currents of the three phases, as if you trace with PZEMs, whether this somehow agrees with them, it would already be concrete.
  • Helpful post
    #23 21409389
    Daro1003
    Level 33  
    A table with photovoltaic data, including measurements of voltage, frequency, current, power, and energy for three phases L1, L2, L3. .
    Table with energy consumption data for three phases: L1, L2, L3. .

    1. from the photovoltaic has on wires from the inverter to the protection.
    2. the ones on the house I have directly on the house but already before the RCDs themselves.

    I will sketch a diagram
  • #24 21409394
    michal.zd
    Level 28  
    oo great - give the broker data again, I'll see what's there,
    preferably again and the broker data and the PZeM data so that the time is more or less the same

    Added after 1 [minute]:

    I suspect the broker will now show what they show here, which is 20 mA each - they will be 2 2 2 themselves :
    Table with voltage and current values for three phases. .
  • #25 21409420
    Daro1003
    Level 33  
    It should be ok:


    Displays of photovoltaic and whole house data with measurement results. .

    Added after 6 [minutes]:


    Screenshot displaying energy data from photovoltaics and the entire house. .
  • #26 21409803
    michal.zd
    Level 28  
    I found an interesting register in the documentation: activePower_PCC_Total, described as:Totall PCC active power, positive to fed into the grid,negative to draw from the grid.
    I read it, but that it is zero in my case, it does not pass it to mqtt.
    I am still looking for some concerning the power of consumption, I have not seen yet.
    Alternatively it could be defined as the difference of the two I already know.

    Added after 37 [minutes]: .

    There are several potential candidates:
    ActivePower_Load_Total; described as Consumed by load is positive Feedback from load is negative
    ActivePower_Load_Sys; described as Total system load power.
    Both need to be checked.
  • #27 21410112
    Daro1003
    Level 33  
    I can see @michal.zd that you have been drawn into this topic, but that's the way it is if you do your job for the love of it and because you simply enjoy it and are not forced to do it.

    The indications may also refer to the battery, probably there will be some current percentage of discharge, some data concerning the charging itself and how much is currently flowing from the panels and how much from the battery.
    I wrote above that I do not own a battery and it is disabled in the options, but some data may appear anyway.
  • #28 21420031
    michal.zd
    Level 28  
    @Daro1003 spent some time experimenting and observing. For a week we checked the indications of the PZEM he has installed on the side of the house and the data received from the inverter. Conclusion:
    it is ok. Data practically the same, differences of 1 to 2 %.
    In summary, mqtt data transmitted from the broker (from data from Darek):
    
    ime/inverter/state S0, P 960, Avg 1020 Grid 230 Con 730    
            - kolejno S: Status, P: Moc z paneli PV, Avg: potem wyjaśnię,  Grid: moc do(wart.dodatnia) lub z (ujemna) sieci, Con: konsumpcja
    ime/inverter/json { "Time":"11:58:23", "Day":6, "State":0, "P":960, "Avg":1020, "GP":230, "CP":730, "Grid": ....    
            - łatwo się domyślić 
    
    .

    Added after 9 [minutes]:

    for use in node-red, a ready-made json from topica: 'ime/inverter/json' is most suitable
    using the node "mqtt in"
    Screenshot showing the mqtt in node icon in the Node-RED application. .

    insert in 'Flow' and by double-clicking on it, give it the data:
    Editing MQTT node in Node-RED with subscription settings. .

    Server - with a 'plus' you have to define the address of the mqtt server, I have it like this:
    MQTT connection configuration in Node-RED with IP address 192.168.10.80. .
    Under the tab:
    User interface showing MQTT message settings in Node-RED. .
    nothing interesting ;) .
    Name is of course a proper name.

    I use node "debug" to preview the incoming data, by linking it to the output of the previous one you can watch in the node-red sidebar what the msg object looks like.

    Added after 4 [minutes]: .

    For the test he proposes:
    Node-RED flow diagram using MQTT connection .

    after 'Deploy' Deploy button in the Node-RED user interface. .
    messages will appear in the sidebar on the right:
    Screenshot of the debug panel in Node-RED showing JSON data. .

    If you do not see the messages, you may need to click on the worm: Screenshot showing a bug icon labeled Debug messages in Node-RED.

    For this, you need another block which will extract the data we need and pass it on to Domoticz, for example.
  • #29 21420435
    Daro1003
    Level 33  
    Appears to be set:


    Node-RED user interface with MQTT node settings. .
    MQTT-broker node configuration screen in Node-RED .
    Screenshot of MQTT node editor with Messages tab selected. .

    Nothing is flying maybe because the inverter is not sending anything or I have something wrong.

    Do we set anything in the Security tab ?
  • #30 21420445
    michal.zd
    Level 28  
    Check if mosquitto_sub is receiving something.
    And such a silly question: did you press the red Deploy button?

Topic summary

The discussion centers on the development and testing of "PV InverterBroker," a Linux-based program designed to communicate with Sofar's KTL and KTL-X series inverters. The software runs on various Linux platforms including OpenWrt routers, Debian laptops, and Raspberry Pi devices. It collects data from Sofar inverters via the WiFi logger LSW-3 and publishes it to an MQTT server (Mosquitto), enabling integration with automation tools like Node-RED and Domoticz. Key functionalities include accurate reading and conversion of inverter registers such as ActivePower_Output_Total, handling signed values for power flow (positive for feed-in, negative for consumption or battery charging), and providing detailed phase voltage and current measurements. The program supports sending data in Domoticz-compatible MQTT formats, facilitating direct integration without intermediaries. Users discussed calibration and validation of power measurements against PZEM-004T energy meters, confirming data accuracy within 1-2%. Challenges addressed include Domoticz sensor limitations requiring separate IDX assignments for voltage and current, and handling MQTT topic formatting issues. The software is open-source with source code and binaries available on GitHub, and includes configuration files for service deployment on Debian-based systems. Ongoing enhancements involve expanding data extraction to include individual PV string voltages and currents, and potential future support for energy storage data. The project aims to provide a comprehensive, real-time monitoring and control solution for Sofar inverters in home energy management systems.
Summary generated by the language model.
ADVERTISEMENT