 char friendlyName[32];
 char configBuf[512];
 StaticJsonBuffer<512> HOME_ASSISTANT_MQTT_DISCOVERY_CONFIG;
-#define MQTT_MAX_PACKET_SIZE 768
 
 volatile uint8_t cmd = ARILUX_CMD_NOT_DEFINED;
 

          root["brightness_command_topic"] = ARILUX_MQTT_BRIGHTNESS_COMMAND_TOPIC;
          root["rgb_state_topic"] = ARILUX_MQTT_COLOR_STATE_TOPIC;
          root["rgb_command_topic"] = ARILUX_MQTT_COLOR_COMMAND_TOPIC;
          root["payload_on"] = ARILUX_MQTT_STATE_ON_PAYLOAD;
          root["payload_off"] = ARILUX_MQTT_STATE_OFF_PAYLOAD;
          root.printTo(configBuf, sizeof(configBuf));
          mqttClient.publish(HOME_ASSISTANT_MQTT_DISCOVERY_TOPIC, configBuf, true)
        #endif
        flash(true);
      } else {

#endif

#ifdef HOME_ASSISTANT_MQTT_DISCOVERY
  sprintf(HOME_ASSISTANT_MQTT_DISCOVERY_TOPIC,"%s/light/ARILUX_%s_%s_%s",HOME_ASSISTANT_MQTT_DISCOVERY_PREFIX,DEVICE_MODEL,chipid,arilux.getColorString());
#endif

  mqttClient.setServer(MQTT_SERVER, MQTT_PORT);
