Customise entity_id via yaml

Hi,

I notice that via the HA webui it is possible to change a sensors entity_id to something else. However I’m struggling to do this via editing the yaml file.

Currently I’ve got a MQTT binary sensor defined as:

binary_sensor:
  - platform: mqtt
    state_topic: "device/xxxx/status"
    name: 'Bedroom Node 0 Status'
    device_class: connectivity
    payload_on: "ON"
    payload_off: "OFF"

Ideally I’d like to specify it’s entity id in the yaml and not have it based on the string I enter for the name field. Could someone point me in the right direction please?