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
  • #31 21420447
    Daro1003
    Level 33  
    It looks like this:

    Screenshot showing terminal output of an inverter with information on voltage, state, and time. .

    Time, tensions
  • ADVERTISEMENT
  • #32 21420450
    michal.zd
    Level 28  
    Aa after removing this slash in the config file you still have to stop and start the broker again.
    It still has two // so....

    Added after 1 [minute]: .

    You can already basically run the broker without the --d parameter, it will then not provide information on the screen.
  • #33 21420459
    Daro1003
    Level 33  
    in screen ctrl and c
    and I fired back

    after which :

    Screenshot of a terminal with MQTT subscription results containing inverter data. .

    in NodeRed no change.
  • #34 21420465
    michal.zd
    Level 28  
    😄 space removed from there too. See the inf from mosquitto, there can be no spaces in the topic
    Between the word inverter and /state and /json
    Simply in the etc/ime file you have an unnecessary space after the topic name.
    I have not immunized the program against this.
  • ADVERTISEMENT
  • #35 21420478
    Daro1003
    Level 33  
    That's what I thought I saw that there was a space between the / / I removed one it looks like this:

    Screenshot of a terminal displaying JSON messages from an inverter.

    But in the node still nothing:

    Data flow diagram in Node-RED with MQTT and debug nodes. .
  • #36 21420505
    michal.zd
    Level 28  
    Deploy you have to press. The red button and the dots above the node indicate that you have not saved this flow to the server. Press the red Deploy button.
  • #37 21420512
    Daro1003
    Level 33  
    I still did a reboot of RBPi in the meantime and restarted but it did nothing.

    As you wrote deploy and it flies:

    View of Node-RED tool with connected blocks MQTT Inverter and debug 1, and a debug panel on the right. .
  • #38 21420528
    michal.zd
    Level 28  
    Well, at last 😉 .
    I'll apply a few corrections to the program tomorrow, including that minus sign instead of the 65tys value.
    I couldn't do it in the evening because my inverter isn't working at the time.
  • Helpful post
    #39 21420551
    Daro1003
    Level 33  
    I don't know if you've noticed, but the G parameter also blows some number out of the water when there's not too much production as you can see in the screenshots today.
  • #40 21420604
    michal.zd
    Level 28  
    Because Grid also has negative values when it draws from the grid.

    Added after 2 [minutes]:

    Anyway, in the uploaded data from the broker, I specifically left the raw data from the inverter to see exactly what is there. Now after your tests you can give plus/minus accordingly.
    The data for mosquitto also had such high values, I will correct all of this tomorrow and give it for testing.
    On the minus it goes down in the evening, when there is already a lack of energy from the pv, also you can do the test right then.
  • #41 21453475
    michal.zd
    Level 28  
    The next version of the programme got the possibility to send mqtt messages immediately in a format understood by domoticz.
    Also, there is no need for a node-red intermediary.
  • #42 21453527
    Daro1003
    Level 33  
    I am already using.

    Integrating the Sofar inverter into Domoticz is actually now a few steps.
    1. we copy the corresponding three files from @michal.zd to the raspberry.
    2. we assign permissions to the file.
    3) We fill in the IP and SN details of Sofar's wi-fi module and IDXs in Domoticz.
    4. run the program ./inverterbroker -d

    The data flies in Domoticz.
  • ADVERTISEMENT
  • #43 21453569
    michal.zd
    Level 28  
    5. something needs to be added in domoticz, here hints @Daro1003

    Re.4. it is possible to run the broker like a service, I will upload the service configuration file for Debian. RpiOs is the Debian version specifically.
    Running 'manual' with param --d is for debugging.
  • #44 21453586
    Daro1003
    Level 33  
    michal.zd wrote:
    5. In domoticz you need to add something, here hints @Daro1003
    .

    Yes Domoticz users will certainly know you need to create a virtual sensor in domoticz.

    Added after 11 [hours] 6 [minutes]:

    The topic is still alive colleague @michal.zd agreed at my urging as well as request to expand the program with more data from the inverter.
    I suggested to extract the voltage and power data on the individual strings of the inverter so that the data can be viewed from the panels.

    Unfortunately I don't have the energy storage I am planning to make so if I manage to do this I will still ask the author of the program to update with data from the energy storage.
  • #45 21480795
    michal.zd
    Level 28  
    I have added information about the voltage and current of strings PV1 and PV2. The voltage and current will be shown in one message for one string in the svalue "voltage;current".

    NOTE there has been a change to the domoticz parmetisation. details below. .

    programme downloadable on Git.
    https://github.com/michalzd/pvInverterBroker/...mqtt/dist/Release/GNU-Linux/RaspberryPi/ARM11
    there is also a sample configuration file: https://github.com/michalzd/pvInverterBroker/tree/mqtt/dist/etc
    which must be located in the /etc/ime directory
  • #46 21482451
    Daro1003
    Level 33  
    It is a bit of a problem how to fly current and voltage data in one because there is no block in Domoticz to have these two indications together.
    You can make a current block and a voltage block but that's two blocks and two different IDYs.


    Screenshot of the Domoticz virtual sensor creation interface with a dropdown list of sensor types. .

    This is the case for temperature and humidity but unfortunately current and voltage are separate.
  • #47 21482458
    michal.zd
    Level 28  
    Aa, so domoticz has some of its default sensors. It doesn't have voltage and current together?
    And does it make any difference? If you set temp and humidity it will receive data?
  • #48 21482465
    Daro1003
    Level 33  
    michal.zd wrote:
    Aa, so domoticz has some of its default sensors. Isn't there voltage and current together?
    .

    Yes exactly this is part of the list I have uploaded I create a voltage sensor and have the voltage block and the IDX given. And the same with current I create such a sensor I have another block and IDX.

    michal.zd wrote:
    And does it make any difference? If you set temp and humidity it will receive data?
    .

    I haven't tested but even if it does it will be data in degrees and so strange in appearance rather - something I've tried to send like that before and it didn't work very well.
  • #49 21482487
    michal.zd
    Level 28  
    Strange restrictions. The domoticz documentation allows sending several values in one mqtt message at the same time there is no way to receive this.
    As you define the sensor, there is no way to specify how many and what data?
    What is in that list in the picture?

    Ps.can be done as single values.
  • #50 21482756
    Daro1003
    Level 33  
    michal.zd wrote:
    What's on that list in the picture?


    This is the menu for creating a sensor and we have what is on the list to choose from:


    Virtual sensor creation interface with a dropdown list of types. Virtual sensor creation interface with a dropdown menu for selecting sensor type. .

    And that's it, once the name is selected and entered, the finished sensor-block with IDX appears:

    View of a sensor panel named Panel String 1 with a lightning symbol, showing 0 V. .

    You can go into the edit options and that's it altogether name icon description:

    Sensor editing menu with settings and options. .
  • #51 21482795
    michal.zd
    Level 28  
    And are these idx indexes, can they be given their own, or is that not to be changed?
    The question is whether you need to give further parameters to enter this idx, or can you just use another value.
  • #52 21482912
    Daro1003
    Level 33  
    IDX - is assigned by Domoticz automatically once a sensor or switch has been created it cannot be changed.
    There are, for example, sensors that I have created in the past and deleted and will not return to them again new numbers are added.

    There is no way to influence this. I can ask around on the Domoticz forum but I'm pretty sure there's no way to edit IDX because in so much time I think I'd have come across it.

    Added after 2 [minutes]: .

    Rather, it must be so in your program that it can be completed:
    PV1 current - xxx IDX
    PV2 current - xxx IDX
    PV1 voltage - xxx IDX
    PV2 voltage - xxx IDX

    Then it will be ok.

    From this list you can see that you can have temperature and humidity in one block and something else and that's about it.
  • #53 21483027
    michal.zd
    Level 28  
    Daro1003 wrote:
    From this list you can see that temperature and humidity can be had in one block and something else and that's it in total.
    .
    That is, the list is imposed by the program.
    Daro1003 wrote:
    Then it will be ok.
    .
    Indeed, in such a situation there is no other way.
    This is what I will do.
  • ADVERTISEMENT
  • #54 21483112
    Daro1003
    Level 33  
    As with these three power data what IDX I enter is what it shows me at in Domoticz and that's cool.
    If you do that with voltage and current from the PV it's elegant.
  • #55 21483283
    michal.zd
    Level 28  
    I have added the voltage and current information of strings PV1 and PV2 as four mqtt messages.
    The voltage and current will be shown in two messages, as agreed with @Daro1003

    into the configuration file in etc/time/inverterbroker
    specify idx according to domoticz.
    
    #domoticz
    domoticz_topic       domoticz/in
    domoticz_inverter_state    1020
    domoticz_pvpower_idx    1026
    domoticz_gridpower_idx    1027
    domoticz_consumption_idx 1028
    # informacja o napieciach i pradach stringów PV
    domoticz_pv1_voltage_idx  1030
    domoticz_pv1_current_idx  1031
    domoticz_pv2_voltage_idx  1032
    domoticz_pv2_current_idx  1033
    
    
    .

    The program as usual can be downloaded on Git.
    https://github.com/michalzd/pvInverterBroker/...mqtt/dist/Release/GNU-Linux/RaspberryPi/ARM11
    There is also a sample configuration file: https://github.com/michalzd/pvInverterBroker/tree/mqtt/dist/etc
    which must be located in the /etc/ime directory
    In addition, there is also a configuration file for the service run by system.d : https://github.com/michalzd/pvInverterBroker/tree/mqtt/dist/service_config/lib_systemd_system
    this file must be in the directory: /lib/systemd/system/
  • #56 21483603
    Daro1003
    Level 33  
    It is already working for me:


    Control panel displaying data on energy production and consumption. .

    Thanks @michal.zd you are GREAT.
  • #57 21483631
    michal.zd
    Level 28  
    Well, that's great.

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