Docker is recommended for normal users. Native Python remains supported for developers, manual installs, local debugging, and service-manager setups where you want to control the Python environment yourself.
- Python 3.11 or newer
- network access from this host to the grid meter
- network access from this host to each Zendure device
- Zendure device IP address and serial number
- grid meter type and IP address
Debian / Ubuntu / Raspberry Pi OS:
sudo apt update
sudo apt install python3 python3-venv python3-pipopenSUSE:
sudo zypper install python3 python3-pip python3-virtualenvCreate and use a virtual environment from the repository checkout:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtNew setups use the standard config/config.json layout:
mkdir -p config data
cp config/config.template.json config/config.jsonEdit only your local config/config.json:
nano config/config.jsonSet real grid meter and Zendure values, then review power, SOC, battery, and PV limits. Template placeholder values force safe mode until replaced.
You can also run the optional setup assistant, which now writes
config/config.json:
python3 emsctl.py config initOlder checkouts may still use a root config.json. That legacy layout is still
read as a fallback, but new setups should use config/config.json. See
Config Layout.
Run local diagnostics:
python3 emsctl.py diagnoseRun a no-write validation if desired:
python3 -B ems-solarflow-api-control.py --dry-run --no-ha --onceRun preflight:
python3 -B ems-solarflow-api-control.py --preflightUse hardware diagnostics only when you are ready for read-only probes to the configured local devices and meter:
python3 emsctl.py diagnose --hardwareRun a bounded live test first:
python3 -B ems-solarflow-api-control.py --duration 120Then start the normal loop:
python3 -B ems-solarflow-api-control.pyIf you keep the config somewhere else, pass it explicitly:
python3 -B ems-solarflow-api-control.py --config /path/to/config.json
python3 emsctl.py --config /path/to/config.json diagnoseAfter a successful bounded live run, use your preferred service manager. Keep
the working directory set to the repository root, or pass --config with an
absolute path.
This repository includes a starting systemd template:
ems-solarflow.service.template
Copy it to your local service location and adjust User, WorkingDirectory,
and ExecStart for your installation.
python3 emsctl.py status
python3 emsctl.py interactive
python3 emsctl.py diagnose
python3 emsctl.py diagnose --deep
python3 emsctl.py diagnose --control
python3 emsctl.py diagnose --control-quality --sample-seconds 60
python3 emsctl.py backup create
python3 emsctl.py config upgrade --dry-run
python3 emsctl.py config upgradeNative backups are stored in data/backups/ by default.
More CLI details: cli.md.