Use input_number to get battery state lower then in a card

Hi Community,

I’ve been building a card which uses an input number to retrieve battery status. The input number works when testing it development tools. It gives the right number for the state Although the status of the slider is not used by the card i use.

type: vertical-stack
title: Batterij status <30
cards:
  - type: entities
    entities:
      - entity: input  
_number.battery_percentage_threshold
  - type: custom:auto-entities
    card:
      show_header_toggle: false
      type: entities
    filter:
      include:
        - attributes:
            state_class: measurement
            device_class: battery
          state: " {{ states(''input_number.battery_percentage_threshold'') | int }}"
      exclude:
        - name: /Ollie Batterij/
        - name: /Chris/
        - name: /Pixel/
        - name: /SM/
    sort:
      method: state
      nummeric: true

I have put this in the config.yaml Although i could do it with a helper in the UI

battery_percentage_threshold:
    name: Battery Percentage Threshold
    icon: mdi:battery-30
    initial: 25
    min: 0
    max: 100
    step: 1
    mode: slider
    unit_of_measurement: '%' 

Anyone has any idea to solve this?

The state filter does not support templates. Use a template filter (last example on the card github page).