Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mounting plugin directory with docker compose #195

Closed
mikaabra opened this issue Sep 3, 2024 · 1 comment
Closed

Mounting plugin directory with docker compose #195

mikaabra opened this issue Sep 3, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@mikaabra
Copy link
Contributor

mikaabra commented Sep 3, 2024

Hardware (please complete the following information):

  • Inverter model: deye_sg04lp3

Software (please complete the following information):

  • Logger firmware version:
  • deye-inverter-mqtt version: latest
  • config.env (remove passwords before pasting):

DEYE_LOGGER_IP_ADDRESS=
DEYE_LOGGER_PORT=8899
DEYE_LOGGER_SERIAL_NUMBER=2957xxxxx
DEYE_LOGGER_PROTOCOL=tcp

# DEYE_LOGGER_MAX_REG_RANGE_LENGTH=256

MQTT_HOST=192.168.200.217
MQTT_PORT=1883
MQTT_USERNAME=mqtt_user
MQTT_PASSWORD=
MQTT_TOPIC_PREFIX=deye

# MQTT_TLS_ENABLED=true

# MQTT_TLS_INSECURE=true

# MQTT_TLS_CA_CERT_PATH=certs/ca.crt

# MQTT_TLS_CLIENT_CERT_PATH=certs/client.crt

# MQTT_TLS_CLIENT_KEY_PATH=certs/client.key

#LOG_LEVEL=DEBUG
LOG_LEVEL=INFO

# LOG_STREAM=STDOUT

PLUGINS_DIR=plugins
PLUGINS_ENABLED=deye_plugin_ha_discovery
DEYE_DATA_READ_INTERVAL=15
DEYE_PUBLISH_ON_CHANGE=true
DEYE_PUBLISH_ON_CHANGE_MAX_INTERVAL=360
DEYE_METRIC_GROUPS=deye_sg04lp3_battery,deye_sg04lp3,settings

DEYE_FEATURE_MQTT_PUBLISHER=true

# DEYE_FEATURE_TIME_OF_USE=false

# DEYE_FEATURE_ACTIVE_POWER_REGULATION=false

# DEYE_FEATURE_SET_TIME=false

## Sample multiinverter configuration with two loggers

# DEYE_LOGGER_COUNT=2

# DEYE_LOGGER_1_IP_ADDRESS=192.168.0.1

# DEYE_LOGGER_1_SERIAL_NUMBER=1234567890

# DEYE_LOGGER_1_PROTOCOL=at

# DEYE_LOGGER_2_IP_ADDRESS=192.168.0.2

# DEYE_LOGGER_2_SERIAL_NUMBER=1234567891

# DEYE_LOGGER_2_PROTOCOL=at

Home Assistant Integration

# ==========================

#PLUGINS_ENABLED=deye_plugin_ha_discovery
DEYE_HA_PLUGIN_HA_MQTT_PREFIX=homeassistant
DEYE_HA_PLUGIN_INVERTER_MANUFACTURER=deye
DEYE_HA_PLUGIN_INVERTER_MODEL=sg04lp3

# Topics not published to HA

# Use : as separator, supports Unix shell-style wildcards *, ?, [seq] and

# [!seq] as implemented with Python fnmatch,

DEYE_HA_PLUGIN_IGNORE_TOPIC_PATTERNS=settings/active_power_regulation:uptime:/pv[234]/

$ cat docker-compose.yaml
services:
deye-mqtt:
image: ghcr.io/kbialek/deye-inverter-mqtt
env_file:
- config.env
restart: unless-stopped
volumes:
- ./plugins:/home/swmike/deye-inverter-mqtt/plugins:ro

swmike@ubuntu-hemma:~/deye-inverter-mqtt$ ls -l plugins
total 12
-rw-rw-r-- 1 swmike swmike 10727 Sep 3 13:50 deye_plugin_ha_discovery.py

When I turn on info login (or even debug) I don't get the message I can see in the source that a plugin has been autodiscovered, so I presume the problem is mounting the plugin directory into the docker container when started with docker compose.

The current documentation only specifies how to mount the volumes when running with docker normally with the --volume command, so I tried to do the same thing with docker-compose.yaml and added a volume there, but I still can't make it work.

In other ways everything seems to work, it can connect using MQTT, data is being published over MQTT etc, but I just can't get the plugin to work.

deye-mqtt-1 | 2024-09-03 16:03:06,808 - DeyeDaemon - INFO - Please help me build the list of compatible inverters. #41
deye-mqtt-1 | 2024-09-03 16:03:06,809 - DeyeConnectorFactory - INFO - Creating Modbus/TCP Logger connector
deye-mqtt-1 | 2024-09-03 16:03:06,809 - DeyeProcessorFactory - INFO - Feature "Report metrics over MQTT": enabled
deye-mqtt-1 | 2024-09-03 16:03:06,809 - DeyeProcessorFactory - INFO - Feature "Set inverter time once online": disabled
deye-mqtt-1 | 2024-09-03 16:03:06,809 - DeyeProcessorFactory - INFO - Feature "Time-of-use configuration over MQTT": disabled
deye-mqtt-1 | 2024-09-03 16:03:06,809 - DeyeProcessorFactory - INFO - Feature "Active power regulation over MQTT": disabled
deye-mqtt-1 | 2024-09-03 16:03:07,822 - DeyeMqttClient - INFO - Successfully connected to MQTT Broker located at 192.168.200.217:1883
deye-mqtt-1 | 2024-09-03 16:03:12,822 - DeyeInverterState - INFO - Reading start
deye-mqtt-1 | 2024-09-03 16:03:12,823 - DeyeInverterState - INFO - Reading registers [metrics group: {'deye_sg04lp3'}, range: 0202-022e]
deye-mqtt-1 | 2024-09-03 16:03:13,379 - DeyeInverterState - INFO - Reading registers [metrics group: {'deye_sg04lp3_battery'}, range: 024a-024f]
deye-mqtt-1 | 2024-09-03 16:03:13,583 - DeyeInverterState - INFO - Reading registers [metrics group: {'deye_sg04lp3'}, range: 0256-027c]
deye-mqtt-1 | 2024-09-03 16:03:13,854 - DeyeInverterState - INFO - Reading registers [metrics group: {'deye_sg04lp3'}, range: 02a0-02a7]
deye-mqtt-1 | 2024-09-03 16:03:14,045 - DeyeInverterState - INFO - Reading registers [metrics group: {'settings_micro', 'settings'}, range: 0028-0028]
deye-mqtt-1 | 2024-09-03 16:03:14,231 - DeyeMqttClient - INFO - Logger is online
deye-mqtt-1 | 2024-09-03 16:03:14,265 - DeyeInverterState - INFO - Reading completed

So any help appreciated on getting plugins dir working with docker compose, and I can then suggest edits to the current documentation after I've made it work.

@mikaabra mikaabra added the help wanted Extra attention is needed label Sep 3, 2024
@mikaabra
Copy link
Contributor Author

mikaabra commented Sep 3, 2024

Sigh, as with everything, I find the solution right after posting an issue about it.

  volumes: 
   - ./plugins:/opt/deye_inverter_mqtt/plugins:ro

Adding that to the docker-compose.yaml makes it load the ha plug:

deye-mqtt-1 | 2024-09-03 16:08:28,629 - DeyePluginLoader - INFO - Loading custom event processor: 'HA Discovery Plugin'

@kbialek kbialek closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants