This repository contains local API documentation for the Sermatec solar inverter and communication scripts.
Whole communication with the inverter runs through the UART-TCP converter USR-WIFI232-B2, which supports 802.11 b/g/n. It works either in a station mode (for connection to the home AP) or in a access point mode (local connection mode in the official ap). See docs below for more technical information.
If you want to contribute, please check the guidelines first: CONTRIBUTING.md
.
If you want to help with decoding the proprietary Sermatec protocol, choose if you want to use the physical Android device or a virtual one and continue with the appropriate guide.
This is no longer needed due to protocol description extracted from the official app. However, the guides may be still useful for another project, so I preserve them here.
RE_AVD.md
: Android virtual device configuration.RE_PHYSICAL_DEVICE.md
: Physical device configuration.RE_DATA_INSPECTION.md
: Data inspection guide.This is available in separate repository.
The script takes very few args to run:
get
: retrieve data from inverter, must be followed by type of data:
customget
: sent custom query command, must be followed by command code (single byte, decimal or hex):
0x98
set
: set configuration data
set <tag> <value>
,The script also takes few optional args:
-v
flag to have a verbose output.--port
arg to use a different port than default 8899 for inverter connection.-h
or --help
flag to display the help about the command--raw
arg to not parse a response from the inverter (only raw data will be shown, useful for debugging, testing and development)--protocolFilePath
arg to supply a custom path to JSON describing the protocol. Usually not needed.Having battery info on an inverter with 10.0.0.254 ip:
python3 -m src.sermatec_inverter 10.0.0.254 get batteryStatus
Having grid info using the verbose mode with a 192.168.0.254 inverter with port 8900:
python3 -m src.sermatec_inverter -v --port=8900 192.168.0.254 get gridPVStatus
Tag | Description | Supported values | Inverter has to be shut down |
---|---|---|---|
onOff |
Turn inverter on or off. | 1: on, 0: off | no |
operatingMode |
Change inverter operating mode. | "General Mode", "Energy Storage Mode", "Micro-grid", "Peak-Valley", "AC Coupling" | no |
antiBackflow |
Enable backflow protection. | 1: on, 0: off | yes |
soc |
Change lower-limit of on-grid battery SOC | 10-100 | no |
git clone https://github.com/andreondra/sermatec-inverter.git
cd sermatec-inverter
python3 -m src.sermatec_inverter --help
This method require to have both docker
and docker compose
setup on your computer (docker compose
is now embedded officially when you install docker).
Refer to this official documentation to have it installed.
Once done: you can use the docker-compose to run the app in a controlled environment:
git clone https://github.com/andreondra/sermatec-inverter.git
cd sermatec-inverter
docker compose run python-bash
Once the container started, you'll be in a bash environment with all your need for working and running the script:
python3 -m sermatec_inverter --help
pip install sermatec-inverter
python3 -m sermatec_inverter --help
The project is licensed under the MIT License. (C) Ondrej Golasowski