The following example uses a dictionary to specify the font color based on the battery level. It contains three levels but it can be expanded to contain ten levels if you want.
{%- set wifi -%}
{%- set (c, i, d) = iif(true, ('#4CAF50', '', 'online'), ('#DC143C', '-off', 'offline')) -%}
<font color="{{c}}"><ha-icon icon="mdi:wifi{{i}}"></ha-icon></font><br/><font color="{{c}}">{{d}} </font>
{%- endset -%}
{%- set engine -%}
{%- set (c, i, d) = iif(true, ('#4CAF50', '', 'ein'), ('#7E7E7E', '-off', 'aus')) -%}
<font color="{{c}}"><ha-icon icon="mdi:engine{{i}}-outline"></ha-icon></font><br/><font color="{{c}}">{{d}} </font>
{%- endset -%}
{%- set battery -%}
{%- set b = states('sensor.cupra_born_state_of_charge') | int(0) -%}
{%- set i = iif(is_state('binary_sensor.cupra_born_car_is_online', 'charging'), '-charging-high', '') -%}
{%- set c = {b <= 10: '#DC143C', b > 10 and b < 70: '#f1c232', b >= 70: '#4CAF50'}.get(true, '#FFFFFF') -%}
<font color="{{c}}"><ha-icon icon="mdi:battery{{i}}"></ha-icon><br/><font color="{{c}}">{{b}}% </font>
{%- endset -%}
||||||
|:---:|---|:---:|---|:---:|
|{{ wifi }}||{{ engine }}||{{battery}}|
This is the dictionary portion:
{%- set c = {b <= 10: '#DC143C',
b > 10 and b < 70: '#f1c232',
b >= 70: '#4CAF50'}.get(true, '#FFFFFF') -%}
The same technique can be used to select the icon based on the battery level. Or my preference would be to use the round(-1)
function to get the closest icon value (10, 20, 30, etc) based on the battery level.
Example
{%- set i = "mdi:battery-" ~ b | round(-1) | int(0) -%}
Let me know if you need help to use this technique in the example I posted above. It amounts to nothing more than replacing this:
{%- set i = iif(is_state('binary_sensor.cupra_born_car_is_online', 'charging'), '-charging-high', '') -%}
with this:
{%- set i = "mdi:battery-" ~ b | round(-1) | int(0) if is_state('binary_sensor.cupra_born_car_is_online', 'charging') else "mdi:battery" -%}
BTW, is there anything else you want to add to this? Because I thought your original question was solved in this post.