Skip to content

inside: Setup Guide for external production and mqtt source #35

@macruch2

Description

@macruch2

Setup Guide for external production and mqtt source

This guide explains how to setup the project in order to simulate an SolarEdge Meter providing data for external production. The advantage is

  • you save money
  • you do not need to have enough space for installation on DIN rail
  • regardless of the physical wiring of your inverter(s)
  • more than on inverters on different circuits and phases can "inject" there production data in one software meter

The meter might also be used for other purpose as well, like consumption, production, import/export and so on. This guide assumes an exiting physical meter for import/export and another non SolarEdge inverter from which you would like to provide the production power so that the monitoring portal show e.g. the correct value for self consumption.

Requirements

  • USB to RS485 adapter, like Waveshare USB to RS485 (B) (CH343G-Version)
    • Waveshare has 3 contacts and seams to be terminated
  • Device with USB and capable of running Python, like Raspberry PI or Oranage PI
    • Operation system already running. This guide assumes linux
    • Python installed
    • Git installed
    • MQTT broker installed
  • Twisted Pair cable with at least 3 wires
  • data of your other production inverters

Schematic

Image

Steps

  1. Download the project code

    git clone https://github.com/nmakel/solaredge_meterproxy.git
    cd solaredge_meterproxy
    
  2. create a python virtual environment and active it

    python3 -m venv venv
    source venv/bin/activate
    
  3. adjust the requirements.txt as some newer versions are not working anymore with the project

    pymodbus==3.4.1
    influxdb>=5.3.0
    requests>=2.23.0
    sdm_modbus==0.6.0
    pyserial-asyncio>=0.6.0
    
  4. install the requirements

    pip install -r requirements.txt
    
  5. plug in your USB adapter and figure out the device, like /dev/ttyUSB0 or /dev/ttyACM0

  6. change the config file semp-rtu.conf using your adapter and mqtt

    [server]
    # Serving serial device, connected to the SolarEdge inverter.
    # optional, default: /dev/ttyUSB0
    device = /dev/ttyACM0
    
    # Serving serial baud rate.
    # optional, default: 9600
    #baud = 9600
    
    # Parity setting, N, E or O
    # optional, default: E
    #parity = E
    parity = N
    
    # Serving serial timeout, depends on line speed.
    # optional, float, default: 1
    #timeout = 1
    
    # Logging level, CRITICAL, ERROR, WARNING, INFO, DEBUG
    # optional, default: INFO
    #log_level = INFO
    
    # Masqueraded meters, comma separated.
    # optional, default: ''
    #meters = meter1, meter2
    meters = meter1
    
    # Meters defined in [server] need a config section, one per meter.
    # Depending on the type of meter that is to be masqueraded, you can
    # define a number of generic and type specific variables.
    [meter1]
    # Modbus address of the meter as defined in the SolarEdge inverter.
    # This value needs to be unique.
    # optional, default: 2
    dst_address = 3
    
    # Source meter type, which corresponds to a script in /devices.
    # The generic.py device returns null values.
    # optional, default: generic
    type = mqtt
    host = 192.168.xx.xx
    port = 1883
    willTopic = /lastwill
    
    # Masqueraded serial number.
    # Need not be correct, must be unique, must be an integer.
    # optional, default: 987654
    #serial_number = 987654
    
    # Current transformer amperage rating.
    # optional, default: 5
    #ct_current = 50
    
  7. extend the wiring from your inline meter as shown in the scematic. The Waveshare adapter seems to be terminated so put it at the end of the chain. It's better to shut down your inverter during this work.

  8. bring everything back online

  9. start the script python3 semp-rtu.py

  10. connect to your inverters wifi. If you have the solar edge app you can to the menu and choose the inverter mode.

    After this you can start your browser and go to 172.16.0.1.

  11. go to Site Communication

  12. go to RS485-1

  13. Add Modbus Device (Energy Meter)

  14. you might have to change the Device ID according to you configuration and change the Meter Function to External Production. You have also to change the Meter Protocoll to WattNode

  15. In you current Meter, change the Modbus Termination to OFF

  16. After this when you view the status you should see

    when you send Data over mqtt you should see the Total Power

  17. send your engery data over mqtt on the configured topic. The minimal payload could look like this

    {
      "power_active":0,
      "engery_active":4864.978,
      "import_energy_active":4864.978
      "l1_energy_active":4864.978,
      "l1_import_energy_active":4864.978
      "l1_power_active":0
    }

    power is the current power of all your inverters in Watt. Energy is the total produced energy over time in kWh. This value needs to be published as engery_active AND import_energy_active. Without import_energy_active you will only see the current power conditions in the app, but the consumption graphs are not effected. With import_energy_active the consumption data include your additional production and calculated self consumption is more correct. See discussion from inside: Setup Guide for external production and mqtt source #35 (comment)

  18. when you view the meter status in the app or on your inverter you should see the injected power value. From this time on the external production is shown together with the solar edge production

  19. all other json value you can fill out can be found here https://github.com/nmakel/solaredge_meterproxy/blob/master/devices/mqtt.py

  20. how can now create a service for running and auto starting the meter proxy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions