library to publish to mqtt with QoS 1

Hi, I am in need of a library to publish a message to Mosquitto with QoS 1 from a ESP8266. I am currently using the pubsub library which is doing fine but it has one limitation as described below.
I am working on a door sensor in which the ESP8266 powers via a ATiny by pulling CH_PD HIGH. It then publishes the message and powers itself down by pulling CH_PD LOW. I am using the pubsub library to publish the message but the issue is that it seems to be working in a async QoS 0 mode to publish the message. Most of the times, the ESP powers down before the message has been published. To avoid this I put in a delay of 1 sec and it works fine but I need a better solution. Also because this sensor will be used in a security alarm it must guarantee that the message has been published which I think can happen if QoS 1 is implemented. I have seen many discussions on QoS >0 for pubsub library but none of them is for publishing , all of them talk about subscribing.
Can somebody suggest a way out here or point me to a library which can do this. Or maybe something else I can do to guarantee the publishing of the message?

Thanks
My code below:

/*
/*
 * 2.0 - Initial - 
 * 
*/
#include "DebugMacros.h"
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
ADC_MODE(ADC_VCC);

const char* ssid = "SSID";
const char* password = "PSWD";
const char* mqtt_server = "MQTT_SERVER";
const int mqtt_port = 1883;
const char *mqtt_user = "mqtt_user";
const char *mqtt_pass = "pswd";
const char *mqtt_client_name = "Main_Door_sensor"; // Client connections cant have the same connection name
const char *mqtt_topic = "home/main_door/status";
const char *mqtt__vcc_topic = "home/main_door/vcc";
IPAddress ip(192, 168, 1, 50); 
IPAddress gateway(192, 168, 1, 1); 
IPAddress subnet(255, 255, 255, 0);

WiFiClient espClient;
PubSubClient client(espClient);

// Variables
//Hold pin will hold CH_PD HIGH till we're executing the setup, the last step would be set it LOW which will power down the ESP
int HOLD_PIN = 0;  // defines GPIO 0 as the hold pin (will hold CH_PD high untill we power down).

void setup() 
{
  #ifdef DEBUG
    Serial.begin(115200);
  #endif
  pinMode(HOLD_PIN, OUTPUT);     // sets GPIO 0 to output
  digitalWrite(HOLD_PIN, HIGH);  // sets GPIO 0 to high (this holds CH_PD high even if the PIR output goes low)
  DPRINTLN(millis());

  setup_wifi();
  client.setServer(mqtt_server, mqtt_port);
  publishMessage();
  DPRINTLN(millis());
  DPRINTLN("powering down");
  //Allow a delay to let MQTT publish the message as the publish method is asyncronous, If I dont put this, the ESP powers down before the msg is published
  delay(1000);
  digitalWrite(HOLD_PIN, LOW);  // set GPIO 0 low this takes CH_PD & powers down the ESP
}

void setup_wifi() 
{

  WiFi.config(ip, gateway, subnet);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) 
    {
      delay(50);
    }
  DPRINT("WiFi connected, IP Address:");
  DPRINTLN(WiFi.localIP());
}


void publishMessage() {
  // Loop until we're reconnected
  char i = 0;
  while (!client.connected()) 
  {
    i++;
    DPRINT("Attempting MQTT connection...");
    // Attempt to connect
    if (client.connect(mqtt_client_name,mqtt_user,mqtt_pass)) {
      DPRINTLN("connected");
      // Once connected, publish an announcement...
      client.publish(mqtt_topic, "OPEN");
      DPRINTLN("published OPEN");
      
      //measure batery voltage and publish that too
      int battery_Voltage = ESP.getVcc();
      char batt_volt[6];
      itoa(battery_Voltage, batt_volt, 10);
      client.publish(mqtt__vcc_topic, batt_volt);
      DPRINTLN("published VCC");
    } 
    else 
    {
      DPRINT("failed, rc=");
      DPRINT(client.state());
      DPRINTLN(" try again in 2 seconds");
      delay(1000);
    }
    if(i >=3)
      break;
  }
}


void loop() 
{
  //Nothing to do here as the setup does all the work and then powers down the ESP by writing a LOW signal to CH_PD  

}

If I understand correctly, I have this suggestion: Subscribe to the published news on the other side. When the message is received, send a message to the ESP8266 with Qos1. Subscribe to this message on the ESP. If there is no night after x seconds, republish the ESP message. When the message comes, turn off the ESP. Do not know, if that's your option.
regards

I did it this way: (Send command message from "master arduino" to broker topic "to_client_01" => to a client arduino => client sends command back to broker topic "from_client_01 => master gets the command back, compares it and says good or not good.
For my project it works and I can be sure the subscriber gets the correct information.

/*
 Basic MQTT example

 This sketch demonstrates the basic capabilities of the library.
 It connects to an MQTT server then:
  - publishes "hello world" to the topic "outTopic"
  - subscribes to the topic "inTopic", printing out any messages
    it receives. NB - it assumes the received payloads are strings not binary

 It will reconnect to the server if the connection is lost using a blocking
 reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to
 achieve the same result without blocking the main loop.
 
*/

#include <SPI.h>
#include <UIPEthernet.h>
#include <PubSubClient.h>

// Update these with values suitable for your network.
byte mac[]    = {  0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress ip(192, 168, 1, 222);
IPAddress server(192, 168, 1, 240);

char command_client_01[]= "12345678";     // can be changed in program
bool command_client_01_active = true;     // true for sending
byte command_client_01_try = 0;           // number of tries
char command_client01_receive[]= "00000000";  // buffer for received msg form client
unsigned long previousMillis_01 = 0; // last time update 




EthernetClient ethClient;
PubSubClient client(ethClient);

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("MQTT message arrived ");
  
  if (!strcmp (topic,"from_client_01") && command_client_01_active){    // Check from which client
    Serial.print(topic);
    Serial.println("!");
    for (int i=0;i<length;i++) {
      command_client01_receive[i]= (char)payload[i];
    }
    if (!strcmp (command_client_01, command_client01_receive)){ // is it the right command
      Serial.println("Correct Answer!");
      command_client_01_active = false;
      command_client_01_try = 0;
    }else{
      Serial.println("Wrong Answer!");
    } 
  }
}


void reconnect() {
  // Loop until we're reconnected
  while (!client.connected()) {
    Serial.print("Attempting MQTT connection...");
    // Attempt to connect
    if (client.connect("arduinoClient")) {
      Serial.println("connected");
      // Once connected, publish an announcement...
      //client.publish("to_client_01",msg1);
      // ... and resubscribe
      client.subscribe("from_client_01");
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      Serial.println(" try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(5000);
    }
  }
}


void cmd_client_01() {
  command_client_01_try++;
  Serial.print("Command to Client_01: ");
  Serial.println(command_client_01);
  client.publish("to_client_01",command_client_01);
  Serial.print(" Try Nr: ");
  Serial.println(command_client_01_try);
  if (command_client_01_try > 5){ // stop after 5 tries
    Serial.println(" Failure Command Client_01!!!");
    command_client_01_active = false;
    command_client_01_try = 0;
  }
}

void setup()
{
  Serial.begin(9600);

  client.setServer(server, 1883);
  client.setCallback(callback);

  Ethernet.begin(mac, ip);
  // Allow the hardware to sort itself out
  delay(1500);
}

void loop()
{
  unsigned long currentMillis = millis(); 
  if (!client.connected()) {
    reconnect();
  }
  client.loop();
  
  if (command_client_01_active && (currentMillis - previousMillis_01 > 2000)){  // send command every 2sec.
    previousMillis_01 = currentMillis;
    cmd_client_01();
  }
  
}