How to custom the hover text of a box plot

I think you might have a slight misconception of how the hovertemplate works.

You canโ€™t just use f- strings to show variables in the hover. The data you want to show needs (I think) to be self contained within the figure. Like this example: