Binary sensor with state_topic equal to entity_id?

Hi,
I have defined several (MQTT) binary sensors.

Example:

binary_sensor:
    - name: "Raam bureau zijkant open/dicht"
      object_id: "tex_zone_z035_w10_1"
      unique_id: "tex_zone_z035_w10_1"
      state_topic: "texecom2mqtt/contacts/binary_sensor.tex_zone_z035_w10_1"
      icon: mdi:shield-account
      device_class: window
      payload_on: "1"
      payload_off: "0"

They are working fine. The ID of that sensor is “binary_sensor.tex_zone_z035_w10_1”. And the way my MQTT is set up, the MQTT topic will always match the entity ID.

Is it possible to replace the value of state_topic with the entity_id (preceeded with a fixed “texecom2mqtt/contacts”)? I think that set up is a lot cleaner.

Does anyone have some input on this?

Is it possible to have a variable in “state_topic” that refers to the entity ID of this sensor?