Power On SCSR04+

Hello, I am new to esphome and HomeAssistant. I am oprating HCSR04 on battry witch take about 6mA whille in-opration and 3mA when standby.

sensor:
  - platform: ultrasonic
    trigger_pin: D1
    echo_pin: D2
    name: "nodetank-level Test"

this work fine

but I want to reduce power further since I am using deep_sleep

deep_sleep:
  #run_duration: 10s
  sleep_duration: 10min

I want like this

1.connect to wifi
2.start gpio14/D5 as high/On which will power up hcsr04
3.fetch hcsr04 value
4.report values (publish the result) to Home Assitant
5. stop gpio14/D5 as low/off which will power down hcsr04; which will save (3mA)
6.Check for Home Assitant deep_sleep_disable_flag (for future OTA)

else deep_sleep for 10min (20uA state)

my full code/yaml is

esphome:
  name: nodetank-level
  friendly_name: NodeTank-Level
  platform: ESP8266
  board: nodemcuv2
  on_boot:
    priority: -100.0
    then:
      #- output.turn_on: gpio_d1
      #source https://www.randomdiyprojects.it/esphome-and-deep-sleep/
      - script.execute: deep_sleep_evaluation
# Enable logging
logger:
 level: DEBUG
# Enable Home Assistant API
api:
  encryption:
    key: "!secrat!"
ota:
  password: "secrat!"
web_server:
  port: 80
wifi:
  ssid: secrat!
  password: secrat!
  fast_connect: true
  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.161
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "secrat"
    password: "secrat"
captive_portal:
status_led:
  pin: D4  #gpio2 in-built led

switch:
  - platform: gpio
    pin: 14
    id: power_on_hcsr04
    - switch.turn_on: power_on_hcsr04

sensor:
  - platform: ultrasonic
    trigger_pin: D1
    echo_pin: D2
    name: "nodetank-level Test"

binary_sensor:
  - platform: homeassistant
    id: disable_deep_sleep
    entity_id: input_boolean.disable_deep_sleep

script:
  - id: deep_sleep_evaluation
    mode: queued
    then:
      - delay: 20s
      - if:
          condition:
            binary_sensor.is_on: disable_deep_sleep
          then:
            - logger.log: 'Deep Sleep Disabled'
          else:
            - deep_sleep.enter: deep_sleep_enabled
      - script.execute: deep_sleep_evaluation
deep_sleep:
  id: deep_sleep_enabled
  #run_duration: 20sec # move this value to -delay- deep_sleep_evaluation script parameter loop is wating 20sec.loop
  sleep_duration: 10min

Running on lipo4 battry with 700mAh

So what exactly is your question?

my question is, how can I power my “HCSR04 using D6/GPIO12”, and then read sensor data, in order to save power ?