Closed meisterlampe closed 5 months ago
I propose a "git bisect" to find the commit that broke that feature.
I can confirm the issue as well as the fix proposed by @meisterlampe
That is the correct way of fixing it and I stumbled upon this independently and did the same fix in #640.
I tested the new version 2024.02.09 and can confirm, that the bug is fixed. Thanks a lot! 👍
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.
What happened?
My Pylontech-Battery is not discovered automatically within Home-Assistant. I checked with MQTT-Explorer and can see the current battery-values published to the topic
solar/battery
. But the Home-Assistant-Autodiscovery-Information expected in the topichomeassistant/sensor/dtu_battery_0001
is missing.To Reproduce Bug
The bug appears on a fresh openDTU-onBattery-System with MQTT and Pylontech-Battery configured
Expected Behavior
If Home Assistant MQTT Auto Discovery is enabled. A topic
homeassistant/sensor/dtu_battery_0001
should be created, that contains the information needed by Home Assistant.Install Method
Self-Compiled
What git-hash/version of OpenDTU?
2024.01.26
Relevant log/trace output
No response
Anything else?
I'm not that into C++, but I checked the class
MqttHandlePylontechHass
and for me it seems, that it is never called anywhere. So I just added it to the main.cpp and Auto-Discovery startet working again. ( https://github.com/helgeerbe/OpenDTU-OnBattery/compare/development...meisterlampe:OpenDTU-OnBattery:addMqttHandlePylontechHassToMain ).The name of the class
MqttHandlePylontechHass
indicates, that simply adding it to main.cpp is not intended. I guess it is not compatible with the other interface options or is this class used for all interfaces?