Set different colors for groups rectangle and text?

Hi guys
I have an area (rectangle) which reflects the temperature, meaning the rectangle will be blue if temperature is less than ‘x’ and red if higher than ‘y’, this works great.
To do this I used my temp sensor and set the CSS class according to its state (temperature), in addition, I want to show the temperature value in a text field, so I guess have 2 options:

  1. Duplicate the temp sensor in HA to be a mirror sensor with different ID (since in the SVG i can’t use the same ID twice) and use 1 for the rectangle and the other for the text field.
  2. Group the rectangle and the text field to one entity and give it the sensor id, the problem is the text color changes and becomes unreadable.

Is there a way of applying the color only to the rectangle?
Maybe setting the same ID to both entities outside Inkscape ?

Thanks !

I don’t see any suggestions from anyone…!
Did you achieve what you wanted. If yes, could you share your CSS and Yaml part for this.