-
Notifications
You must be signed in to change notification settings - Fork 21
Description
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
Steps
-
Download the project code
git clone https://github.com/nmakel/solaredge_meterproxy.git cd solaredge_meterproxy
-
create a python virtual environment and active it
python3 -m venv venv source venv/bin/activate
-
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
-
install the requirements
pip install -r requirements.txt
-
plug in your USB adapter and figure out the device, like
/dev/ttyUSB0
or/dev/ttyACM0
-
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
-
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.
-
bring everything back online
-
start the script
python3 semp-rtu.py
-
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. -
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
-
After this when you view the status you should see
when you send Data over mqtt you should see the Total Power -
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)
-
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
-
all other json value you can fill out can be found here https://github.com/nmakel/solaredge_meterproxy/blob/master/devices/mqtt.py
-
how can now create a service for running and auto starting the meter proxy