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:
- the ip of your inverter.
- operation to do
get
: retrieve data from inverter, must be followed by type of data:- systemInformation, batteryStatus, gridPVStatus, runningStatus, workingParameters, load, bmsStatus
customget
: sent custom query command, must be followed by command code (single byte, decimal or hex):- e.g.
0x98
- use with care, may cause unexpected/dangerous behaviour
- e.g.
set
: set configuration data- experimental support, may be dangerous and screw things up,
- syntax:
set <tag> <value>
, - see section Configurable parameters for supported parameters and their allowed values,
- some parameters require to shut down the inverter before configuring,
- the script should refuse setting of invalid values, but either way, be very VERY careful.
The script also takes few optional args:
- the
-v
flag to have a verbose output. - the
--port
arg to use a different port than default 8899 for inverter connection. - the
-h
or--help
flag to display the help about the command - the
--raw
arg to not parse a response from the inverter (only raw data will be shown, useful for debugging, testing and development) - the
--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