Deye MQTT HA Plugin

Introduction

This plugin enables Home Assistant to automatically discover all values published by the "Deye Solar Inverter MQTT Bridge".

Energy usage diagram provided by Home Assistant filled with data from a "Deye solar inverter MQTT bridge":

Screenshot of energy usage diagram provided by Home Assistant filled with data from a Deye solar inverter

Installation

  1. Install Deye solar inverter MQTT bridge

  2. Extend the Deye solar inverter MQTT bridge configuration file config.env as described in this example:

    # Home Assistant Integration
    # ==========================
    PLUGINS_ENABLED=deye_plugin_ha_discovery
    DEYE_HA_PLUGIN_HA_MQTT_PREFIX=homeassistant
    DEYE_HA_PLUGIN_INVERTER_MANUFACTURER=<your manufacturer>
    DEYE_HA_PLUGIN_INVERTER_MODEL=<your inverter>
    # 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]/*
    
  3. Install the plugin from plugins directory as described in "How to start the docker container with custom plugins"

  4. Switch to the Home Assistant and install Utility Meter

  5. Configure a Utility Meter helper to reset the daily production counter at midnight.

    # Example configuration.yaml entry
    utility_meter:
      energy:
        name: "Production total (daily reset)"
        source: sensor.deye_inverter_mqtt_production_total
        cycle: daily
    

    or graphically

    Screenshot of Utility Meter setup part 1

    Screenshot of Utility Meter setup part 2

Requirements

Troubleshooting

  1. Check log of the deye-mqtt container for errors.

    docker logs deye-mqtt
    

    On demand increase the detail of the logging in config.env to LOG_LEVEL=DEBUG and restart the container.

  2. Checking the content published in the MQTT broker. You can use a graphical tool such as the MQTT Explorer for this.

Resources

Changelog

2024-10-03

  • Fix wrong unit for uptime sensor

2024-09-20

  • README extended
  • All energy topics uses state class "total_increasing" now
  • Add more MQTT topics

2024-08-30

  • first release

Known Bugs/Issues

Check the project issue tracker for current open bugs. New bugs can be reported there also.

License

This project is licensed under the Apache 2.0 license.

Copyright (c) 2024 Carsten Grohmann, mail <add at here> carstengrohmann.de

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Enjoy!

Carsten Grohmann