hoylabs / OpenDTU-OnBattery

Software for ESP32 to talk to Hoymiles/TSUN/Solenso Inverters, VE.Direct devices, battery management systems, and related peripherals
GNU General Public License v2.0
301 stars 63 forks source link

MQTT subscriptions not updated when base topic changes #1045

Closed schlimmchen closed 1 month ago

schlimmchen commented 3 months ago

What happened?

Saw 918c3449da4dec639b9bfbb9846153b272a8ec4f (upstream).

To Reproduce Bug

Change the base topic in the MQTT setting. Notice that publishing to DPL topics using the new base does nothing as the respective software is still subscribed to the topic with the old base. True for other pieces of software as well (which?).

Expected Behavior

When changing MQTT settings, the new settings should work as expected, i.e., OpenDTU-OnBattery shall be subscribed using the new settings.

Install Method

Pre-Compiled binary from GitHub

What git-hash/version of OpenDTU?

123456

Relevant log/trace output

No response

Anything else?

No response

TomBrett72 commented 3 months ago

Hi @schlimmchen, thank you for reporting this. I see also a cycletime problem. I set up the global MQQT cycle time to 20s. But */powermeter/# values are sent in 10s intervall. I already made a restart of the DTU and try setup other values, f.i. 15s. No change. For monitoring I use a simple android MQQT-dashboard and therefor I need the same cycletime for all values. No big bug, but it would ne nice to have other then 10s intervall. Thank´s! grafik

schlimmchen commented 3 months ago

Please, don't hesitate to open a new issue. You comment has nothing to do with this issue.

AndreasBoehm commented 2 months ago

~~Could this commit fix the issue? https://github.com/skippermeister/OpenDTU-OnBattery/commit/f7fc22d64dd8fbf1e7f1511c95b5eb40ea752105~~

Or did you mean to say that that we need to add subscribe and unsubscribe to all MQTT handlers to make it work?

schlimmchen commented 2 months ago

Or did you mean to say that that we need to add subscribe and unsubscribe to all MQTT handlers to make it work?

Yes.

Did I link the upstream commit? Thomas did a fix to address this, but only for the upstream pieces of software.

I dont understand why the linked commit in skippermeister repo does. If it is important, it obviously needs to go into the upstream.

github-actions[bot] commented 2 weeks ago

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.