diff --git a/provider/mqtt/client.go b/provider/mqtt/client.go index 98b4ef6f9..e59324643 100644 --- a/provider/mqtt/client.go +++ b/provider/mqtt/client.go @@ -129,7 +129,7 @@ func (m *Client) Publish(topic string, retained bool, payload interface{}) error return nil } -// Listen validates uniqueness and registers and attaches listener +// Listen attaches listener to slice of listeners for given topic func (m *Client) Listen(topic string, callback func(string)) error { m.mux.Lock() m.listener[topic] = append(m.listener[topic], callback) diff --git a/server/mqtt.go b/server/mqtt.go index 3ab374367..f52c41449 100644 --- a/server/mqtt.go +++ b/server/mqtt.go @@ -287,7 +287,8 @@ func (m *MQTT) listenLoadpointSetters(topic string, site site.API, lp loadpoint. } if err == nil { err = m.Handler.ListenSetter(topic+"/vehicle", func(payload string) error { - if payload == "" { + // https://github.com/evcc-io/evcc/issues/11184 empty payload is swallowed by listener + if payload == "-" { lp.SetVehicle(nil) return nil }