1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.

Home Page:https://docs.openmqttgateway.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Publish mqtt message with retained flag

lhvo opened this issue · comments

commented

To avoid requesting the status of the devices after the reconnections, it would be great if messages are posted to MQTT with retained flag.

Have a look at the first section of the MQTT ADVANCED PARAMETERS, and in your case you'd likely want to set sensor_Retain to true

https://github.com/1technophile/OpenMQTTGateway/blob/development/main/User_config.h#L359-L380

commented

Does it mean that we have to re-build with the #define or can we configure it dynamically during runtime ?

Yes, this will require a custom build with the #define, as not all, especially very rarely requested options like this one, can be included for runtime changeability to avoid bloating the code and settings JSON publishings.

Does sounds a lot more daunting than it is though when using the Visual Studio Code way

https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation

This issue is stale because it has been open for 90 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.