Using state_topic value in for name of device

I’m using MQTT to create sensors from the Victron Cerbo. They already have a custom name on the crerbo. I would like to use that name in the state_topic as the name for the sensor. How would I go about doing that?

- state_topic: "victron/N/ID/tank/124/CustomName"
  unique_id: id
  value_template: '{{ value_json.value }}'
  name: "Fresh Water"
  device: {
    identifiers: [
      "Cerbo GX"
    ],
    }

The name configuration variable for MQTT Sensors does not support templates, only static strings.