deye-inverter-mqtt for Debian
=============================

Configuration
-------------

The daemon is configured through environment variables. The Debian package
ships the upstream example as a conffile:

    /etc/deye-inverter-mqtt/config.env

Edit it (at the very least DEYE_LOGGER_IP_ADDRESS, DEYE_LOGGER_SERIAL_NUMBER
and MQTT_HOST) and restart the service:

    systemctl restart deye-inverter-mqtt

Upstream is shipped as a docker image and reads a "config.env" from the
current working directory only. The Debian package patches the entry point to
look for the file above as well, so the same configuration is used no matter
where the command is started from. The lookup order is:

  1. the file named by the DEYE_CONFIG_FILE environment variable, if set,
  2. ./config.env, if it exists (upstream behaviour, handy for local testing),
  3. /etc/deye-inverter-mqtt/config.env.

Variables that are already set in the environment are never overwritten by the
file. Note that the file is skipped altogether when DEYE_LOGGER_SERIAL_NUMBER
is already set in the environment, which is how upstream decides that the
configuration comes from the environment:

    DEYE_CONFIG_FILE=~/my-inverter.env deye-inverter-mqtt r 3

Note that the file is world readable and may contain the MQTT broker password.
Restrict it with dpkg-statoverride(8) if that matters on your system.

Service
-------

The package enables and starts the deye-inverter-mqtt systemd service, which
runs the bridge as a daemon and starts it again on reboot. The service runs
under a dynamically allocated user (DynamicUser=yes), so it needs no system
account of its own; consequently every path it reads has to be world readable.

Only one instance per inverter
------------------------------

The MQTT client id is derived from the logger serial number
("deye-inverter-<serial>"), so two copies of this application configured for
the same inverter cannot use the same broker at the same time: the broker
evicts the older connection, both processes reconnect in a loop, and the
availability topic keeps flapping between "online" and "offline". If you
previously ran the upstream Docker image or the Home Assistant add-on, stop it
before enabling this service.

 -- Anton Gladky <gladk@debian.org>, Wed, 12 Aug 2026 09:12:00 +0200
