How to display Sonos Volume on a LCD display 2004 IC2? Got screen working just need HA help?

esphome:
  name: sonos_display
  platform: ESP8266
  board: d1_mini_pro

wifi:
  ssid: "WHATEVER"
  password: "*********"

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "*******"

ota:
  password: "********"


sensor:
  - platform: homeassistant
    id: office_temperature
    entity_id: media_player.tv_speakers
    internal: true

i2c:
  sda: D2
  scl: D1

display:
  - platform: lcd_pcf8574
    dimensions: 16x2
    address: 0x27
    lambda: |-
     // Print inside temperature (from homeassistant sensor)
      if (id(office_temperature).state == id(office_temperature).state) {
        it.printf(0, 0, id(office_temperature).state);
      } else {
        it.print(0, 0, "waiting");
      }

How do i change this code to display my current volume on my Sonos, at present on the LCD display (2004) I get waiting so I know the config for that works.

To confirm I have gone into integration and added the sonos_display in there.

esphome:
  name: sonos_display
  platform: ESP8266
  board: d1_mini_pro

wifi:
  ssid: "WHATEVER"
  password: "WHATEVER"

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "SpoonBack55"

ota:
  password: "SpoonBack55"

text_sensor:
  - platform: homeassistant
    id: sonos_volume
    entity_id: sensor.media_volume
    internal: true


i2c:
  sda: D2
  scl: D1

display:
  - platform: lcd_pcf8574
    dimensions: 16x2
    address: 0x27
    lambda: |-
      it.printf(0, 0, id(sonos_volume).state.c_str());
          
sensor:
  - platform: template
    sensors:
      media_volume:
        friendly_name: "media_volume"
        value_template: "{{ state_attr('media_player.tv_speakers', 'volume_level') }}"

Why does this work

it.printf(id(sonos_volume).state.c_str());

Where as this fails?

it.printf("Volume", id(sonos_volume).state.c_str());

error when doing the compile

src/main.cpp: In lambda function:
src/main.cpp:126:51: warning: too many arguments for format [-Wformat-extra-args]
it.printf(“Vol”, sonos_volume->state.c_str());

one more question for the experts.

how do I display sonos_volume which come out like this 0.42 but have it displayed as this instead 42%

I know its some formatting command in it.printf but what???

This was the answer

it.printf(“volume: %s%%”, id(sonos_volume).state.c_str());

the %s added the volume from HA and the %% added a percentage sign after the volume to make it look tidy.

one more question for the experts.

how do I display sonos_volume which come out like this 0.42 but have it displayed as this instead 42%

I know its some formatting command in it.printf but what???

did it in home assistant was easier