Help for templete with battery sensor

Hi to all,

i have a silence s01, it is an elettric scooter that i connected to ha with an hass add in. i have 2 sensors, 1 is ‘sensor.silence_charging’ that may be True when is in charge, False when not; the other is ‘sensor.silence_batterysoc’ that get the soc in % of the battery.
I’d like to create a sensor templete that trigger when my battery scooter is less than 45%, im back to home (i have an entity called ‘person.svauz’) and the battery is NOT yet in charge.

im totally noob with templates, i tried to search in the forum and outside in the web but i can’t find anything that works for me

could someone give me a hint?

Thank you in advance

i tried this badge for the battery but it does not work… what am i doing wrong?

{% if is_state(‘sensor.silence_batterysoc’, < ‘45’) %}

  • entity: sensor.silence_batterysoc
    name: S01
    style: |
    @keyframes blinker { 50% { opacity: 0; } }
    :host {
    –label-badge-background-color: red;
    animation: blinker 1s linear infinite;
    display:
    {% if is_state(‘sensor.silence_batterysoc’, >= ‘45’) %}
    none;
    {% endif %}
    }