diff --git a/main/User_config.h b/main/User_config.h index 3be706a..765608c 100644 --- a/main/User_config.h +++ b/main/User_config.h @@ -158,7 +158,7 @@ # if MQTT_SECURE_DEFAULT # define JSON_MSG_BUFFER_MAX 2048 // Json message buffer size increased to handle certificate changes through MQTT, used for the queue and the coming MQTT messages # else -# define JSON_MSG_BUFFER_MAX JSON_MSG_BUFFER +# define JSON_MSG_BUFFER_MAX 898 // Minimum size for the cover MQTT discovery message # endif #endif diff --git a/main/ZmqttDiscovery.ino b/main/ZmqttDiscovery.ino index 1742e1c..787589d 100644 --- a/main/ZmqttDiscovery.ino +++ b/main/ZmqttDiscovery.ino @@ -240,7 +240,7 @@ void createDiscovery(const char* sensor_type, const char* payload_available, const char* payload_not_available, bool gateway_entity, const char* cmd_topic, const char* device_name, const char* device_manufacturer, const char* device_model, const char* device_id, bool retainCmd, const char* state_class, const char* state_off, const char* state_on, const char* enum_options, const char* command_template) { - StaticJsonDocument<1024> jsonBuffer; + StaticJsonDocument jsonBuffer; JsonObject sensor = jsonBuffer.to(); // If a component cannot render it's state (f.i. KAKU relays) no state topic