From fdaddcdbdd708bed69f0a568754d6d03ad4d5498 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 15 Nov 2020 17:30:15 +0100 Subject: [PATCH] json size of ha-sensors --- src/mqtt.cpp | 2 +- src/mqtt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mqtt.cpp b/src/mqtt.cpp index eb0601eb0..da80f71d2 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -719,7 +719,7 @@ void Mqtt::register_mqtt_ha_binary_sensor(const __FlashStringHelper * name, cons snprintf_P(topic, sizeof(topic), PSTR("homeassistant/binary_sensor/ems-esp/%s/config"), entity); // queue MQTT publish - publish(topic, doc.as()); + publish_retain(topic, doc.as(), true); } // HA config for a normal 'sensor' type diff --git a/src/mqtt.h b/src/mqtt.h index faf8c8f04..4932e9f1d 100644 --- a/src/mqtt.h +++ b/src/mqtt.h @@ -38,7 +38,7 @@ using uuid::console::Shell; -#define EMSESP_MAX_JSON_SIZE_HA_CONFIG 256 // for small HA config payloads +#define EMSESP_MAX_JSON_SIZE_HA_CONFIG 384 // for small HA config payloads #define EMSESP_MAX_JSON_SIZE_SMALL 384 // for smaller json docs when using StaticJsonDocument #define EMSESP_MAX_JSON_SIZE_MEDIUM 768 // for medium json docs from ems devices, when using StaticJsonDocument #define EMSESP_MAX_JSON_SIZE_LARGE 1024 // for large json docs from ems devices, like boiler or thermostat data. Using StaticJsonDocument