Samil Power inverter tool
Project description
Samil Power inverter tool
Get model and status data from Samil Power inverters over the network.
Supported inverter series
- SolarRiver TL
- SolarRiver TL-D
- SolarLake TL
If you have a SolarLake TL-PM series inverter, check out this fork! -> semonet/solar
If you just need PVOutput.org uploading, you can also try the old version.
Features
- View inverter data
- Upload to PVOutput.org
- Publish to MQTT broker
Requirements
- Python 3
- Inverter needs to be in the same network
Installation
The package can be installed from PyPI:
$ pip install samil
On Ubuntu:
$ sudo apt install python3-pip
$ pip3 install --user samil
Usually samil
can then be found at ~/.local/bin/samil
.
Often that directory is already in PATH
, so you can call it using samil
.
You might need to relogin or add that directory to PATH
.
Usage
$ samil --help
Usage: samil [OPTIONS] COMMAND [ARGS]...
Samil Power inverter command-line tool.
Options:
--debug Enable debug output.
--version Show the version and exit.
--help Show this message and exit.
Commands:
monitor Print model and status info for an inverter.
mqtt Publish inverter data to an MQTT broker.
$ samil monitor --help
Usage: samil monitor [OPTIONS]
Print model and status info for an inverter.
When you have multiple inverters, run this command multiple times to
connect to all inverters.
Options:
--interval FLOAT RANGE Status interval. [default: 5.0]
--interface TEXT IP address of local network interface to bind to.
--help Show this message and exit.
$ samil mqtt --help
Usage: samil mqtt [OPTIONS]
Publish inverter data to an MQTT broker.
Options:
-h, --host TEXT MQTT broker hostname/IP address. [default: localhost]
-p, --port INTEGER MQTT broker port. [default: 1883]
--client-id TEXT Client ID used when connecting to the broker. If not
provided, one will be randomly generated.
--tls Enable SSL/TLS support.
--username TEXT MQTT username.
--password TEXT MQTT password.
--interface TEXT IP address of local network interface to bind to.
--help Show this message and exit.
Info
The protocol used by these inverters is described here.
The following units are used for the status values:
- Voltage in volts
- Current in amperes
- Energy in kilowatt hours
- Power in watts
- Temperature in degrees Celcius
- Operating time in hours
This project was originally a fork of zombiekipling/solriv but is now completely rewritten to implement new requirements.
As a library
You can use this project as a library. For documentation you will need to read through the source code.
Example to get started:
from samil import InverterListener
with InverterListener() as listener:
# Search for an inverter
inverter = listener.accept_inverter()
with inverter:
# Use with statement to automatically close the connection after use
# Model info
model = inverter.model()
model["serial_number"] # E.g. DW413B8080
# ... (see source code)
status = inverter.status()
status["output_power"] # E.g. 513 Watt
# ... (see source code)
Development info
Development installation:
pip install -e .
pip install -r dev-requirements.txt
Lint code: flake8
Run testcases: python -m unittest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for samil-2.0.0.post2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfa991c8d0296a9a81feb5195671f050c1304ce1897ec98928f1cf36361a2649 |
|
MD5 | 90ec7f225185b107d3d9b09f6046adb8 |
|
BLAKE2b-256 | 9937a6d7479b210330a9999d3650b0d31cc5099fce397a5f284eb14012d0555a |