Help with value tempate

Hi,
I’m struggling with setting up a mqtt battery sensor to use in a Lovelace Picture card. I simply want to see “Battery: 87%” and not only the state.

Thats the working mqtt sensor, but the value is only "34%"

- platform: mqtt
  state_topic: "sileno/mower/battery/charge"
  name: "sileno Battery"
  unit_of_measurement: '%'

Thats what I tried, but it only shows “Battery: %” an NOT the value

- platform: mqtt
  state_topic: "sileno/mower/battery/charge"
  name: "sileno Battery"
  value_template: 'Battery: {{ states.sensor.sileno_battery.state }}'
  unit_of_measurement: '%'

Please help

should just be

- platform: mqtt
  state_topic: "sileno/mower/battery/charge"
  name: "sileno Battery"
  value_template: 'Battery: {{ value }}%'

But remember, if you do this, you will not be able to graph the data. It will treat it as a string. That’s why unit_of_measurement is omitted at this point, because it doesn’t matter.

You also won’t be able to treat it as a battery device_class. So your icon will not change based on the % of battery.

Thanks I didn’t know that.

So is there an other way to do this in Lovelace?

Is that picture elements? If so, just make another sensor with the word battery:. Or you could use an icon element to show the battery symbol and then have the percent next to it.

thanks I will try that