Set state on binary sensor on startup

I have a esp01 that runs on batteries and put to deep sleep.
I want it to send a mqtt message to a switch (switch change to on) at startup.
Can’t figure out how to do this on the esp. I now use the bith_message but there must be another way.
Feels like kind of dirty workaround…

on HA i have this:

- platform: mqtt
  state_topic: "esp/iot03/binary_sensor/mailbox/state"
  command_topic: "esp/iot03/binary_sensor/mailbox/state/set"
  optimistic: true
  name: Brevlåda
  icon: mdi:mailbox

my esp:

mqtt:
  broker: xxx
  discovery: True
  username: xxx
  password: xxx
  topic_prefix: esp/iot03
  birth_message:
    topic: "esp/iot03/binary_sensor/mailbox/state"
    payload: "ON"

I need to set up the binary_sensor in esp. Not sure what to put there

binary_sensor:
 - platform: 

This is what I did on another project:

esphome:
  name: soverom_co2
  platform: ESP32
  board: esp-wrover-kit
  on_boot:
    - priority: -100
      then:
        - delay: 30s
        - if:
            condition:
              binary_sensor.is_on: workday
            then:
              - mhz19.abc_enable: co2sensor
              - logger.log: 'ABC is enabled on startup'
            else:
              - mhz19.abc_disable: co2sensor
              - logger.log: 'ABC is disabled on startup'

Platform: mqtt