[SOLVED] - Sensor attribute not working - xiaomi chuangmi plug

Hello,
I have created some sensors and templates previously that rounds values for the Lovelace cards for example.

Now I tried to create a sensor from the temperature attribute of a device, a xiaomi plug or in particular “chuangmi” plug, which you can see here

The code I used before in such cases did not create an error but also does not show a result except the new sensor shows “unknown” but not the temperature figure. I tried it even without round in case could have been a string and not an integer.

  - platform: template
    sensors:
      temperatur_drucker_xiaomi:
        friendly_name: "TEMPERATUR - DRUCKER am 'Xiaomi Socket'"
        value_template: "{{ state_attr ( 'sensor.switch.chuangmi_plug_m1' , 'temperature' | round(0) ) }}"

What am I missing ?
thx

SOLVED

I did not get the sensor cause in this case it is the switch itself and therefore has to be “replaced”

value_template: “{{ state_attr ( ‘switch.chuangmi_plug_m1’ , ‘temperature’ | round(0) ) }}”