Get information from Deye Microinverter
Project description
inverter
Get information from Deye Microinverter
The whole thing is just a learning exercise for now. We will see.
quickstart
Currently just clone the project and just start the cli (that will create a virtualenv and installs every dependencies)
Note: Please enable https://www.piwheels.org/ if you are on a Raspberry Pi !
e.g.:
~$ git clone https://github.com/jedie/inverter-connect.git
~$ cd inverter-connect
~/inverter-connect$ ./cli.py --help
The output of ./cli.py --help
looks like:
Usage: ./cli.py [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────╮
│ debug-settings Display (anonymized) MQTT server username and password │
│ print-at-commands Print one or more AT command values from Inverter. │
│ print-values Print all known register values from Inverter, e.g.: │
│ publish-loop Publish current data via MQTT for Home Assistant (endless loop) │
│ read-register Read register(s) from the inverter │
│ set-time Set current date time in the inverter device. │
│ store-settings Store MQTT server settings. │
│ test-mqtt-connection Test connection to MQTT Server │
│ version Print version and exit │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
most important commands
publish-loop
Help from ./cli.py print-values --help
Looks like:
Usage: ./cli.py publish-loop [OPTIONS] IP
Publish current data via MQTT for Home Assistant (endless loop)
The "Daily Production" count will be cleared in the night, by set the current date time via
AT-command.
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ * --port INTEGER RANGE [1000<=x<=65535] Port of the inverter │
│ [default: 48899; 1000<=x<=65535] │
│ [required] │
│ * --inverter TEXT Prefix of yaml config files in │
│ inverter/definitions/ │
│ [default: deye_2mppt] │
│ [required] │
│ --log/--no-log [default: log] │
│ --verbose/--no-verbose [default: verbose] │
│ --debug/--no-debug [default: no-debug] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
print-values
Help from ./cli.py print-values --help
Looks like:
Usage: ./cli.py print-values [OPTIONS] IP
Print all known register values from Inverter, e.g.:
.../inverter-connect$ ./cli.py print-values 192.168.123.456
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --port INTEGER RANGE [1000<=x<=65535] Port of the inverter │
│ [default: 48899; 1000<=x<=65535] │
│ * --inverter TEXT Prefix of yaml config files in │
│ inverter/definitions/ │
│ [default: deye_2mppt] │
│ [required] │
│ --verbose/--no-verbose [default: verbose] │
│ --debug/--no-debug [default: no-debug] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
Example output of print-values
call:
print-at-commands
Help from ./cli.py print-at-commands --help
Looks like:
Usage: ./cli.py print-at-commands [OPTIONS] IP [COMMANDS]...
Print one or more AT command values from Inverter.
Use all known AT commands, if no one is given, e.g.:
.../inverter-connect$ ./cli.py print-at-commands 192.168.123.456
Or specify one or more AT-commands, e.g.:
.../inverter-connect$ ./cli.py print-at-commands 192.168.123.456 WEBVER .../inverter-connect$
./cli.py print-at-commands 192.168.123.456 WEBVER WEBU
e.g.: Set NTP server, enable NTP and check the values:
.../inverter-connect$ ./cli.py print-at-commands 192.168.123.456 NTPSER=192.168.1.1 NTPEN=on
NTPSER NTPEN
wait a while and request the current date time:
.../inverter-connect$ ./cli.py print-at-commands 192.168.123.456 NTPTM
(Note: The prefix "AT+" will be added to every command)
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --port INTEGER RANGE [1000<=x<=65535] Port of the inverter │
│ [default: 48899; 1000<=x<=65535] │
│ --verbose/--no-verbose [default: verbose] │
│ --debug/--no-debug [default: no-debug] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
Example output of print-at-commands
call:
read-register
Help from ./cli.py read-register --help
Looks like:
Usage: ./cli.py read-register [OPTIONS] IP REGISTER LENGTH
Read register(s) from the inverter
e.g.: read 3 registers starting from 0x16:
.../inverter-connect$ ./cli.py read-register 192.168.123.456 0x16 3
e.g.: read the first 32 registers:
.../inverter-connect$ ./cli.py read-register 192.168.123.456 0 32
The start address can be pass as decimal number or as hex string, e.g.: 0x123
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --port INTEGER RANGE [1000<=x<=65535] Port of the inverter │
│ [default: 48899; 1000<=x<=65535] │
│ --verbose/--no-verbose [default: verbose] │
│ --debug/--no-debug [default: no-debug] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
Example output of read-register
call:
start development
For development, we have a separate CLI, just call it:
~/inverter-connect$ ./dev-cli.py --help
The output of ./dev-cli.py --help
looks like:
Usage: ./dev-cli.py [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────╮
│ check-code-style Check code style by calling darker + flake8 │
│ coverage Run and show coverage. │
│ fix-code-style Fix code style of all inverter source code files via darker │
│ install Run pip-sync and install 'inverter' via pip as editable. │
│ mypy Run Mypy (configured in pyproject.toml) │
│ publish Build and upload this project to PyPi │
│ safety Run safety check against current requirements files │
│ test Run unittests │
│ tox Run tox │
│ update Update "requirements*.txt" dependencies files │
│ update-test-snapshot-files Update all test snapshot files (by remove and recreate all snapshot │
│ files) │
│ version Print version and exit │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
credits
Others before me have done good work. In particular, I have learned a lot from the following projects:
- https://github.com/s10l/deye-logger-at-cmd
- https://github.com/kbialek/deye-inverter-mqtt
- https://github.com/StephanJoubert/home_assistant_solarman
The included definitions yaml files are from:
various links
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 inverter_connect-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7314486ca86d0fd3d3700da7d91cc931f61dea9fff812c8e57ace22848d72e0 |
|
MD5 | 396a49d01b6f6d37584f150d3f855da6 |
|
BLAKE2b-256 | 519abb7efd77717384bd3155862f5a3fadee0a246b3f64d367268a60258e9661 |