Custom:numberbox-card compare values in secondary_info

Hey,

can someone explain to me how I can compare two values ​​in secondary_Info?

i have a sensor (sensor.Test ) and a helper (input_number.test).

if both are the same then ok if different then xxx

somehow I can’t get it to use an if is_state template here.

type: entities
entities:
  - type: custom:numberbox-card
    entity: input_number.test
    icon: mdi:sine-wave
    card_mod:
      style: |
        :host {
            --mdc-icon-size: 30px;
             {% if states['sensor.rgb_treppe_helligkeitssensor'].state < states['number.template_number'].state  %}
            --paper-item-icon-color: red;
            {% endif %}
          }
         :host {         
            {% if states['sensor.rgb_treppe_helligkeitssensor'].state > states['number.template_number'].state  %}
            --paper-item-icon-color: magenta;
            {% endif %}
          }

        :host {
            {% if states['sensor.rgb_treppe_helligkeitssensor'].state == states['number.template_number'].state  %}
            --paper-item-icon-color: green;
            {% endif %}
          }
          
          
          
    entities:
      - sensor.lightlevel_5
    secondary_info: >
      compare: <b style='color:[[ if states('sensor.lightlevel_5') ==
      states('input_number.test') ]]'>equal // unequal </b>
    name: Sensor
    border: false

the only thing I’ve managed to do so far is to create a template sensor and then output it as secondary_info.

  - name: sensor_equal
    unique_id: sensor_equal
    state: >-
      {% if states('sensor.lightlevel_5') == states('input_number.test') %}
       equal
      {% else %}  unequal
      {% endif %}
    secondary_info: >
      equal: <b style="color:red"> %sensor.equal:state </b><br
      />