OpenEVSE / ESP8266_WiFi_v2.x

ESP8266 WiFi for OpenEVSE Version 2.x
https://openevse.openenergymonitor.org
76 stars 47 forks source link

Inability to set MQTT clientID #250

Closed denisfrench closed 4 years ago

denisfrench commented 4 years ago

I'm happily using the Losant platform (which includes a cloud-based MQTT server) as the basis of my homebrew home automation setup.

The Losant MQTT protocol requires the client ID to be sent with every connection (https://docs.losant.com/mqtt/overview/#authentication).

I do not yet own an OpenEVSE, but it is not clear to me where within the UI or code the clientID can be set.

I'm pretty sure there are other MQTT implementations that are similar (eg Cayenne).

beikeland commented 4 years ago

https://github.com/OpenEVSE/ESP8266_WiFi_v2.x/blob/master/src/mqtt.cpp#L101 https://pubsubclient.knolleary.net/api.html

denisfrench commented 4 years ago

Ahh, I see.

So it always connects to the MQTT server using a clientID which is hard-coded to a unique ID derived from the MAC address.

Recompiling with the Losant-specified clientID is simple enough, but I suggest being able to specify the clientID within the UI would be a useful feature.

beikeland commented 4 years ago

Maybe you the newly configurable hostname could be applied here as well?

https://github.com/OpenEVSE/ESP8266_WiFi_v2.x/commit/981495188064f19b2fe641eb0547d9af8f7ed3f0

glynhudson commented 4 years ago

Maybe you the newly configurable hostname could be applied here as well?

Configurable hostname is now available in V2.9.0 release