Skip to content

Latest commit

 

History

History
147 lines (103 loc) · 3.24 KB

File metadata and controls

147 lines (103 loc) · 3.24 KB

Native Python Setup

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.

Requirements

  • 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

Install Python Dependencies

Debian / Ubuntu / Raspberry Pi OS:

sudo apt update
sudo apt install python3 python3-venv python3-pip

openSUSE:

sudo zypper install python3 python3-pip python3-virtualenv

Create 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.txt

Create Config

New setups use the standard config/config.json layout:

mkdir -p config data
cp config/config.template.json config/config.json

Edit only your local config/config.json:

nano config/config.json

Set 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 init

Older 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.

First Checks

Run local diagnostics:

python3 emsctl.py diagnose

Run a no-write validation if desired:

python3 -B ems-solarflow-api-control.py --dry-run --no-ha --once

Run preflight:

python3 -B ems-solarflow-api-control.py --preflight

Use hardware diagnostics only when you are ready for read-only probes to the configured local devices and meter:

python3 emsctl.py diagnose --hardware

Start EMS

Run a bounded live test first:

python3 -B ems-solarflow-api-control.py --duration 120

Then start the normal loop:

python3 -B ems-solarflow-api-control.py

If 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 diagnose

Run As A Service

After 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.

Useful Native CLI Commands

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 upgrade

Native backups are stored in data/backups/ by default.

More CLI details: cli.md.