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

MQTT-Client-ID optional auch über die Config vergeben #1123

Closed
blenni opened this issue Jun 9, 2021 · 2 comments · Fixed by #1128
Closed

MQTT-Client-ID optional auch über die Config vergeben #1123

blenni opened this issue Jun 9, 2021 · 2 comments · Fixed by #1128
Labels
enhancement New feature or request

Comments

@blenni
Copy link
Contributor

blenni commented Jun 9, 2021

In meiner Anwendung (Verbindung über MQTT zu FHEM) habe ich das Problem, dass bei jedem Neustart von EVCC eine neue Client-ID erzeugt wird und damit in FHEM ein neues Device angelegt wird (bzw. im alten Device die Readings nicht mehr aktualisiert werden).

Aktuell wird (wenn ich das richtig verstanden habe) in evcc/provider/mqtt/client.go/ bei jedem Neustart von EVCC eine zufällige ID berechnet:

// ClientID created unique mqtt client id
func ClientID() string {
	pid := rand.Int31()
	return fmt.Sprintf("evcc-%d", pid)
}

Es wäre schön, wenn man diese Client-ID optional auch über die config vergeben könnte.

@andig
Copy link
Member

andig commented Jun 9, 2021

Ahhhh. Das ist by Design- anderenfalls könnten sich mehrere EVCC Instanzen nicht bei einem MQTT Server anmelden. Wir könnten das aber konfigurierbar machen ;)

@andig andig added the enhancement New feature or request label Jun 9, 2021
@andig
Copy link
Member

andig commented Jun 9, 2021

Magst Du einen PR machen? Die Änderung müsse in setup.go, configureMQTT passieren.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants