tbnobody / OpenDTU

Software for ESP32 to talk to Hoymiles/TSUN/Solenso Inverters
GNU General Public License v2.0
1.83k stars 511 forks source link

[Request] Configurable MQTT topic #813

Open alekob opened 1 year ago

alekob commented 1 year ago

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

It could be beneficial to have a dedicated MQTT topic for each inverter instead of using the serial number. Please consider the case when an inverter needs to be replaced, all subsequent systems would need to be adaped to listen to the new serial number.

Describe alternatives you've considered

A solution could be to add a new configuration field for each inverter to specify the topic to be used. In the case the field is empty, the serial number shall be used, also to not break already existing implementations

Additional context

No response

stefan123t commented 4 months ago

I like the proposed PR #1004 from @Brunhilde, i.e. simply a switch to change the inverter name.

Difficulty is with the API and the writable topics. These are documented to use the Inverter Serial ID and not the Inverter Name. We would have to either make them usable both or switch the behaviour using the switch too. This would require us to at least update the MQTT topic list / tree and the API endpoint documentation.