{"id":37621801,"url":"https://github.com/nmakel/solaredge_meterproxy","last_synced_at":"2026-01-16T10:40:14.118Z","repository":{"id":40394502,"uuid":"280630380","full_name":"nmakel/solaredge_meterproxy","owner":"nmakel","description":"Modbus proxy for SolarEdge inverters and unsupported kWh meters","archived":false,"fork":false,"pushed_at":"2024-04-29T18:00:03.000Z","size":614,"stargazers_count":34,"open_issues_count":16,"forks_count":21,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-27T10:43:48.204Z","etag":null,"topics":["modbus","modbus-rtu","modbus-tcp","p1","smartmeter","solaredge","solaredge-api","wattnode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmakel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-18T10:10:35.000Z","updated_at":"2025-05-19T13:46:32.000Z","dependencies_parsed_at":"2022-08-09T19:10:40.516Z","dependency_job_id":"993757ee-b970-4df5-bf5f-209eaaa0eca2","html_url":"https://github.com/nmakel/solaredge_meterproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nmakel/solaredge_meterproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmakel%2Fsolaredge_meterproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmakel%2Fsolaredge_meterproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmakel%2Fsolaredge_meterproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmakel%2Fsolaredge_meterproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmakel","download_url":"https://codeload.github.com/nmakel/solaredge_meterproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmakel%2Fsolaredge_meterproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["modbus","modbus-rtu","modbus-tcp","p1","smartmeter","solaredge","solaredge-api","wattnode"],"created_at":"2026-01-16T10:40:13.986Z","updated_at":"2026-01-16T10:40:14.086Z","avatar_url":"https://github.com/nmakel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# solaredge_meterproxy\n\nsolaredge_meterproxy is a python tool that responds to Modbus requests from SolarEdge power inverters with data from unsupported kWh meters. While SolarEdge only supports a [limited number](https://www.solaredge.com/se-supported-devices) of revenue meters, by masquerading as a supported meter it is possible to supply your own meter values to the SolarEdge inverter for production, consumption, import/export monitoring, and export limitation.\n\nThis tool simulates one or more [WattNode WNC-3Y-400-MB](https://ctlsys.com/product/wattnode-modbus/) revenue meters, functionally similar to the rebranded SE-WNC-3Y-400-MB-K1. The Modbus registers of these simulated meters can then be updated with values from otherwise unsupported kWh meters, or sourced from a variety of data sources.\n\nSolarEdge inverters only use Modbus RTU over RS485 to communicate with meters, this project supports both Modbus RTU when connected directly to an inverter over RS485, *and* Modbus TCP in case a Modbus TCP gateway is connected to the inverter. This functionality has been tested using an [ICP-DAS tGW-715](https://www.icpdas.com/en/product/tGW-715) and [Elfin EE11](http://www.hi-flying.com/elfin-ee10-elfin-ee11) Modbus TCP to RTU gateway.\n\nSupported devices and data sources:\n\n* [Eastron SDM120M](https://www.eastroneurope.com/products/view/sdm120modbus)\n* [Eastron SDM230M](https://www.eastroneurope.com/products/view/sdm230modbus)\n* [Eastron SDM630M](https://www.eastroneurope.com/products/view/sdm630modbus)\n* InfluxDB\n\n\n## Usage\n\nDecide whether you will be running a Modbus RTU or Modbus TCP server. If your device is directly connected to the inverter via RS485 using a serial device or USB dongle, choose Modbus RTU. If you have a Modbus TCP gateway connected to your inverter, choose Modbus TCP.\n\n### Modbus RTU\n\nRun `semp-rtu.py` on a device connected via RS485 to a SolarEdge inverter. \n```\n    usage: semp-rtu.py [-h] [-c CONFIG] [-v]\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -c CONFIG, --config CONFIG\n      -v, --verbose\n```\n\nBy default, `semp-rtu.py` assumes your RS485 device is located at `/dev/ttyUSB0` with a baud rate of `9600`. While configuring and testing solaredge_meterproxy, you should run `semp-rtu.py` in verbose mode. The Modbus server and source meter configurations can be set in `semp-rtu.conf`. See [Configuration File](https://github.com/nmakel/solaredge_meterproxy#configuration-file) for more information.\n\n### Modbus TCP\n\nRun `semp-tcp.py` on a device on the same network as a Modbus TCP gateway connected via RS485 to a SolarEdge inverter. \n```\n    usage: semp-tcp.py [-h] [-c CONFIG] [-v]\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -c CONFIG, --config CONFIG\n      -v, --verbose\n```\n\nBefore running `semp-tcp.py`, configure a TCP IP and port for it to listen on. Your Modbus TCP gateway will need to be configured as *TCP client*, connecting to the IP and port you assigned `semp-tcp.py`. While configuring and testing solaredge_meterproxy, you should run `semp-tcp.py` in verbose mode. The Modbus server and source meter configurations can be set in `semp-tcp.conf`. See [Configuration File](https://github.com/nmakel/solaredge_meterproxy#configuration-file) for more information.\n\n### Configure your SolarEdge Inverter\n\nConfiguration of the inverter takes place in the SetApp interface or the LCD display on the inverter. For more information, please read [SolarEdge's SetApp documentation](https://www.solaredge.com/products/installer-tools/setapp). You will need a SolarEdge installer account to access the SetApp application. The account is free, and the app is available on both iOS and Android.\n\n__If you have multiple SolarEdge inverters connected via Modbus, are currently using the SunSpec Modbus logger function, or have one or more revenue meters connected via Modbus, please read _all_ instructions below to be sure you know what you are doing. This guide assumes both RS485 ports are unused and disconnected.__\n\nFirst, ensure your SolarEdge inverter's Modbus address is set to 1:\n\n- Choose the first available RS485 device, in most cases __RS485-1__.\n- Set the __Protocol__ to __SunSpec (Non-SE Logger)__.\n- Set the __Device ID__ to __1__.\n\nNow, add a meter:\n\n- Set the __Protocol__ to __Modbus (Multi-Device)__.\n- Choose __Add Modbus Device__.\n- Choose __Meter__.\n- Select the newly added __Meter 1__.\n- Set __Meter Function__ to the functionality of the meter you will be proxying.\n- Set __Meter Protocol__ to __SolarEdge__.\n- Set __Device ID__ to __2__, or another unused Modbus ID if you have multiple devices connected.\n- Set the appropriate __CT Rating__ and __Grid Topology__ depending on your situation.\n\nThe SolarEdge inverter will now try to connect to a meter with Modbus address 2 on the RS485 device you selected. If you have configured and started solaredge_meterproxy with a matching meter configuration you should see a _Meters_ section at the bottom of the _Status_ page. Depending on the _function_ selected, metering functionality should now be available.\n\nIf, after configuring a meter in the SetApp interface, you see only meter connection errors, set `log_level` to `DEBUG` in your configuration file. After starting solaredge_meterproxy you should see Modbus read requests from the inverter. If you do, please open an issue with copies of these and your configuration file. If you don't, check your connection, RS485 adapter, or Modbus TCP gateway settings.\n\n### Configuration file\n\nThe server, and one or more source meters, can be configured in a python `configparser` formatted configuration file. If a configuration file is not specified, and `semp-rtu.conf` of `semp-tcp.conf` are not found, generic defaults will be loaded. Provide an alternate configuration file using the `--config` parameter.\n\nFor an overview of all configurable parameters, see `semp-rtu.conf` or `semp-tcp.conf`.\n\nDevice scripts contain additional, often required, configuration parameters. Consult the relevant device script for an overview when configuring source meters.\n\nAn example **Modbus RTU** configuration, with a SDM120 source that is accessible over Modbus TCP:\n\n```\n[server]\ndevice = /dev/ttyUSB0\nbaud = 9600\nlog_level = INFO\nmeters = meter1\n\n[meter1]\ntype=sdm120\nhost=10.0.0.124\nport=502\nsrc_address=1\ndst_address=2\n```\n\nAn example **Modbus TCP** configuration, with a SDM120 source that is accessible over Modbus RTU:\n\n```\n[server]\naddress = 10.0.0.123\nport = 5502\nlog_level = INFO\nmeters = sdm120\n\n[sdm120]\ntype=sdm120\ndevice=/dev/ttyUSB0\nbaud=9600\nsrc_address=1\ndst_address=2\n```\n\nIf you receive `DEBUG: Frame check failed, ignoring!!` errors, the Modbus TCP gateway is probably sending you RTU frames inside TCP packets. In that case, set the `framer = rtu` configuration parameter inside the `[server]` block.\n\n\n## Creating Device Scripts\n\nSupport for various kWh meters can be added by creating a Python script in the `devices` directory. This script should adhere to the following:\n\n* Its name corresponds to the device or source it masquerades.\n* It contains a `device()` function.\n* It contains a `values()` function.\n* Both functions accept the variables as defined in `/devices/generic.py`.\n\nFor a skeleton implementation, see `/devices/generic.py`.\n\n### device()\n\nThe `device()` function is called _once_. It gets passed a `configparser` object with the device's configuration parameters, as configured in the configuration file. It must return a data structure which contains either an active connection, or enough information to identify the device in a data store. This data structure will be passed to the `values()` function.\n\nWhile the intent is to masquerade another Modbus RTU or Modbus TCP device, it is possible to use virtually any type of data store. InfluxDB, or SQLite, for example.\n\n### values()\n\nThe `values()` function is called every `refresh_rate` seconds. It gets passed the data structure returned by `device()`, and must return a `dict`. The `/devices/generic.py` script contains a list of all possible dictionary keys. It is not required to return all, or in fact any, keys. Functionality of the SolarEdge inverter will depend on the values provided.\n\nSingle phase devices should put the single phase values in the generic _and_ first phase specific values, for example: `power_active` and `p1_power_active`, but also `voltage_ln` and `p1n_voltage`.\n\n\n## Contributing\n\nContributions are more than welcome, especially new device scripts, or modifications which broaden the use case of this tool.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmakel%2Fsolaredge_meterproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmakel%2Fsolaredge_meterproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmakel%2Fsolaredge_meterproxy/lists"}