Help with DeepSleep on ESP8266 sensor reading using ESP-NOW

I have been working on this for about 5 days and am at my wits end. I prefer to figure things out myself but I am now just wasting time and finally need to ask for some help.

It's a pretty simple project but I can't get deepsleep working properly on the Wemos D1 mini PRO. It's a remote water tank water level sensor using the JSN-SR04T sensor, operated from a battery so I am trying to keep power consumption to a minimum. I am switching on the sensor with a PN2907, take a reading, then switch it off. I have the project working just fine without the deepsleep function, ESP-NOW works 100% and the WiFi receiver is picking up the data properly. I'll post my code which is pieced together from various sources. My problem is I don't know where to put the Esp.Deepsleep(5E6); statement. I've tried it in the loop, in the setup and numerous other places. In the loop it sleeps but then the data from the sensor doesn't output, just says 0.00.

Anyway, some guidance from those who know ESP-NOW and such would be greatly appreciated.

Thank you.

//transmitter unit

#include <ESP8266WiFi.h>
#include <SoftwareSerial.h>
#include <espnow.h>

float distance;

// RECEIVER MAC Address
uint8_t receiverAddress[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC};
char sensor_id[20] = "test";
const char* payload = "\Distance\ %.02f";

typedef struct sensor_message {
   char id[20];
   char payload[180];
} sensor_message;

// Create a struct_message called myMessage
sensor_message myMessage;

void setup() {
  pinMode(D7, OUTPUT);
  pinMode(D3, OUTPUT);
  pinMode(D2, INPUT);
  digitalWrite(D7, HIGH);
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  setupEspNow();
  }
  
 void setupEspNow() {  
  if (esp_now_init() != 0) {
    Serial.println("Error initializing ESP-NOW");
    delay(1000);
    ESP.restart();
  }

  esp_now_set_self_role(ESP_NOW_ROLE_CONTROLLER);
  esp_now_register_send_cb(onDataSent);
  
  int status = esp_now_add_peer(receiverAddress, ESP_NOW_ROLE_SLAVE, 1, NULL, 0);
  if (status == 0) {
    Serial.println("Adding peer succeeded");
  } else {
    Serial.print("Adding peer failed.");
  }
}

void onDataSent(uint8_t* mac_addr, uint8_t sendStatus) {
  if (sendStatus == 0){
    Serial.println("Delivery succeeded");
  } else{
    Serial.print("Delivery failed!");
  }
}

void getSensordata(){
  digitalWrite(D7, LOW);
  delay(100);
  digitalWrite(D3, LOW);
  delayMicroseconds(10);
  digitalWrite(D3, HIGH);
  delayMicroseconds(50);
  digitalWrite(D3, LOW);
  distance = pulseIn(D2, HIGH)/58;
  Serial.print("Distance: ");
  Serial.println(distance);
  delay(100);
  digitalWrite(D7, HIGH); 
  delay(3000); 
}
  
  void loop() {
  getSensordata();
  strcpy(myMessage.id, sensor_id);
  snprintf(myMessage.payload, 180, payload, distance);

  int status = esp_now_send(receiverAddress, (uint8_t *) &myMessage, sizeof(myMessage));
  if (status == 0) {
    Serial.println("Sending message succeeded");
  } else {
    Serial.print("Sending message failed");
  }
  
}